CfnResources.generated.ps1

<#
WARNING: THIS FILE IS AUTO-GENERATED! MANUAL CHANGES TO THIS
          FILE *WILL BE LOST* AFTER THE NEXT AUTO-GENERATION!
 
Generated By: [ebekker]
Generated At: [20160401_154324]
Generated On: [EZS-001322]
Generated W/: [Generate-CfnResources.ps1]
#>


$AWSCFN_RESOURCE_TYPES = @(
,'AWS::AutoScaling::AutoScalingGroup'
,'AWS::AutoScaling::LaunchConfiguration'
,'AWS::AutoScaling::LifecycleHook'
,'AWS::AutoScaling::ScalingPolicy'
,'AWS::AutoScaling::ScheduledAction'
,'AWS::AutoScaling::Trigger'
,'AWS::CloudFormation::Stack'
,'AWS::CloudFormation::WaitCondition'
,'AWS::CloudFormation::WaitConditionHandle'
,'AWS::CloudFront::Distribution'
,'AWS::CloudTrail::Trail'
,'AWS::CloudWatch::Alarm'
,'AWS::CodeDeploy::Application'
,'AWS::CodeDeploy::DeploymentConfig'
,'AWS::CodeDeploy::DeploymentGroup'
,'AWS::CodePipeline::CustomActionType'
,'AWS::CodePipeline::Pipeline'
,'AWS::Config::ConfigRule'
,'AWS::Config::ConfigurationRecorder'
,'AWS::Config::DeliveryChannel'
,'AWS::DataPipeline::Pipeline'
,'AWS::DirectoryService::MicrosoftAD'
,'AWS::DirectoryService::SimpleAD'
,'AWS::DynamoDB::Table'
,'AWS::EC2::CustomerGateway'
,'AWS::EC2::DHCPOptions'
,'AWS::EC2::EIP'
,'AWS::EC2::EIPAssociation'
,'AWS::EC2::Instance'
,'AWS::EC2::InternetGateway'
,'AWS::EC2::NatGateway'
,'AWS::EC2::NetworkAcl'
,'AWS::EC2::NetworkAclEntry'
,'AWS::EC2::NetworkInterface'
,'AWS::EC2::NetworkInterfaceAttachment'
,'AWS::EC2::PlacementGroup'
,'AWS::EC2::Route'
,'AWS::EC2::RouteTable'
,'AWS::EC2::SecurityGroup'
,'AWS::EC2::SecurityGroupEgress'
,'AWS::EC2::SecurityGroupIngress'
,'AWS::EC2::SpotFleet'
,'AWS::EC2::Subnet'
,'AWS::EC2::SubnetNetworkAclAssociation'
,'AWS::EC2::SubnetRouteTableAssociation'
,'AWS::EC2::Volume'
,'AWS::EC2::VolumeAttachment'
,'AWS::EC2::VPC'
,'AWS::EC2::VPCDHCPOptionsAssociation'
,'AWS::EC2::VPCEndpoint'
,'AWS::EC2::VPCGatewayAttachment'
,'AWS::EC2::VPCPeeringConnection'
,'AWS::EC2::VPNConnection'
,'AWS::EC2::VPNConnectionRoute'
,'AWS::EC2::VPNGateway'
,'AWS::EC2::VPNGatewayRoutePropagation'
,'AWS::ECR::Repository'
,'AWS::ECS::Cluster'
,'AWS::ECS::Service'
,'AWS::ECS::TaskDefinition'
,'AWS::EFS::FileSystem'
,'AWS::EFS::MountTarget'
,'AWS::ElastiCache::CacheCluster'
,'AWS::ElastiCache::ParameterGroup'
,'AWS::ElastiCache::ReplicationGroup'
,'AWS::ElastiCache::SecurityGroup'
,'AWS::ElastiCache::SecurityGroupIngress'
,'AWS::ElastiCache::SubnetGroup'
,'AWS::ElasticBeanstalk::Application'
,'AWS::ElasticBeanstalk::ApplicationVersion'
,'AWS::ElasticBeanstalk::ConfigurationTemplate'
,'AWS::ElasticBeanstalk::Environment'
,'AWS::ElasticLoadBalancing::LoadBalancer'
,'AWS::Elasticsearch::Domain'
,'AWS::EMR::Cluster'
,'AWS::EMR::InstanceGroupConfig'
,'AWS::EMR::Step'
,'AWS::IAM::AccessKey'
,'AWS::IAM::Group'
,'AWS::IAM::InstanceProfile'
,'AWS::IAM::ManagedPolicy'
,'AWS::IAM::Policy'
,'AWS::IAM::Role'
,'AWS::IAM::User'
,'AWS::IAM::UserToGroupAddition'
,'AWS::Kinesis::Stream'
,'AWS::KMS::Key'
,'AWS::Lambda::EventSourceMapping'
,'AWS::Lambda::Function'
,'AWS::Lambda::Permission'
,'AWS::Logs::Destination'
,'AWS::Logs::LogGroup'
,'AWS::Logs::LogStream'
,'AWS::Logs::MetricFilter'
,'AWS::Logs::SubscriptionFilter'
,'AWS::OpsWorks::App'
,'AWS::OpsWorks::ElasticLoadBalancerAttachment'
,'AWS::OpsWorks::Instance'
,'AWS::OpsWorks::Layer'
,'AWS::OpsWorks::Stack'
,'AWS::RDS::DBCluster'
,'AWS::RDS::DBClusterParameterGroup'
,'AWS::RDS::DBInstance'
,'AWS::RDS::DBParameterGroup'
,'AWS::RDS::DBSecurityGroup'
,'AWS::RDS::DBSecurityGroupIngress'
,'AWS::RDS::DBSubnetGroup'
,'AWS::RDS::EventSubscription'
,'AWS::RDS::OptionGroup'
,'AWS::Redshift::Cluster'
,'AWS::Redshift::ClusterParameterGroup'
,'AWS::Redshift::ClusterSecurityGroup'
,'AWS::Redshift::ClusterSecurityGroupIngress'
,'AWS::Redshift::ClusterSubnetGroup'
,'AWS::Route53::HealthCheck'
,'AWS::Route53::HostedZone'
,'AWS::Route53::RecordSet'
,'AWS::Route53::RecordSetGroup'
,'AWS::S3::Bucket'
,'AWS::S3::BucketPolicy'
,'AWS::SDB::Domain'
,'AWS::SNS::Topic'
,'AWS::SNS::TopicPolicy'
,'AWS::SQS::Queue'
,'AWS::SQS::QueuePolicy'
,'AWS::SSM::Document'
,'AWS::WAF::ByteMatchSet'
,'AWS::WAF::IPSet'
,'AWS::WAF::Rule'
,'AWS::WAF::SqlInjectionMatchSet'
,'AWS::WAF::WebACL'
,'AWS::WorkSpaces::Workspace'

)

function Add-CfnResource {
<#
.SYNOPSIS
The required Resources section declare the AWS resources that you want as part of your stack, such as an Amazon EC2 instance or an Amazon S3 bucket.
 
.DESCRIPTION
You must declare each resource separately; however, you can specify multiple resources of the same type.
 
Resources can be added to a template using one of two forms, either a generic Resource declaration or a strongly-typed Resource-specific declaration. This cmdlet provides the generic Resource declaration support.
 
.PARAMETER ResourceName
The logical ID which must be alphanumeric (A-Za-z0-9) and unique within the template.
 
You use the logical name to reference the resource in other parts of the template. For example, if you want to map an Amazon Elastic Block Store to an Amazon EC2 instance, you reference the logical IDs to associate the block stores with the instance.
 
.PARAMETER Type
The resource type identifies the type of resource that you are declaring.
 
For example, the AWS::EC2::Instance declares an Amazon EC2 instance. For a list of all the resource types, see AWS Resource Types Reference.
 
.PARAMETER RawType
An alternative to the Type parameter, this allows you to specify an unrestricted and unvalidated type name.
 
.PARAMETER Properties
Resource properties are additional options that you can specify for a resource.
 
For example, for each Amazon EC2 instance, you must specify an AMI ID for that instance. You declare the AMI ID as a property of the instance.
 
If a resource does not require any properties to be declared, omit the properties.
 
Property values can be literal strings, lists of strings, Booleans, parameter references, pseudo references, or the value returned by a function. These rules apply when you combine literals, lists, references, and functions to obtain a value.
 
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html
#>

    [CmdletBinding(DefaultParameterSetName="Type")]
    param(
        [Parameter(Mandatory,Position=0)]
        [string]$ResourceName,
        [Parameter(Mandatory,ParameterSetName="Type",Position=1)]
        [ValidateSet(
#region -- Resource Types --
'AWS::AutoScaling::AutoScalingGroup'
        ,'AWS::AutoScaling::LaunchConfiguration'
        ,'AWS::AutoScaling::LifecycleHook'
        ,'AWS::AutoScaling::ScalingPolicy'
        ,'AWS::AutoScaling::ScheduledAction'
        ,'AWS::AutoScaling::Trigger'
        ,'AWS::CloudFormation::Stack'
        ,'AWS::CloudFormation::WaitCondition'
        ,'AWS::CloudFormation::WaitConditionHandle'
        ,'AWS::CloudFront::Distribution'
        ,'AWS::CloudTrail::Trail'
        ,'AWS::CloudWatch::Alarm'
        ,'AWS::CodeDeploy::Application'
        ,'AWS::CodeDeploy::DeploymentConfig'
        ,'AWS::CodeDeploy::DeploymentGroup'
        ,'AWS::CodePipeline::CustomActionType'
        ,'AWS::CodePipeline::Pipeline'
        ,'AWS::Config::ConfigRule'
        ,'AWS::Config::ConfigurationRecorder'
        ,'AWS::Config::DeliveryChannel'
        ,'AWS::DataPipeline::Pipeline'
        ,'AWS::DirectoryService::MicrosoftAD'
        ,'AWS::DirectoryService::SimpleAD'
        ,'AWS::DynamoDB::Table'
        ,'AWS::EC2::CustomerGateway'
        ,'AWS::EC2::DHCPOptions'
        ,'AWS::EC2::EIP'
        ,'AWS::EC2::EIPAssociation'
        ,'AWS::EC2::Instance'
        ,'AWS::EC2::InternetGateway'
        ,'AWS::EC2::NatGateway'
        ,'AWS::EC2::NetworkAcl'
        ,'AWS::EC2::NetworkAclEntry'
        ,'AWS::EC2::NetworkInterface'
        ,'AWS::EC2::NetworkInterfaceAttachment'
        ,'AWS::EC2::PlacementGroup'
        ,'AWS::EC2::Route'
        ,'AWS::EC2::RouteTable'
        ,'AWS::EC2::SecurityGroup'
        ,'AWS::EC2::SecurityGroupEgress'
        ,'AWS::EC2::SecurityGroupIngress'
        ,'AWS::EC2::SpotFleet'
        ,'AWS::EC2::Subnet'
        ,'AWS::EC2::SubnetNetworkAclAssociation'
        ,'AWS::EC2::SubnetRouteTableAssociation'
        ,'AWS::EC2::Volume'
        ,'AWS::EC2::VolumeAttachment'
        ,'AWS::EC2::VPC'
        ,'AWS::EC2::VPCDHCPOptionsAssociation'
        ,'AWS::EC2::VPCEndpoint'
        ,'AWS::EC2::VPCGatewayAttachment'
        ,'AWS::EC2::VPCPeeringConnection'
        ,'AWS::EC2::VPNConnection'
        ,'AWS::EC2::VPNConnectionRoute'
        ,'AWS::EC2::VPNGateway'
        ,'AWS::EC2::VPNGatewayRoutePropagation'
        ,'AWS::ECR::Repository'
        ,'AWS::ECS::Cluster'
        ,'AWS::ECS::Service'
        ,'AWS::ECS::TaskDefinition'
        ,'AWS::EFS::FileSystem'
        ,'AWS::EFS::MountTarget'
        ,'AWS::ElastiCache::CacheCluster'
        ,'AWS::ElastiCache::ParameterGroup'
        ,'AWS::ElastiCache::ReplicationGroup'
        ,'AWS::ElastiCache::SecurityGroup'
        ,'AWS::ElastiCache::SecurityGroupIngress'
        ,'AWS::ElastiCache::SubnetGroup'
        ,'AWS::ElasticBeanstalk::Application'
        ,'AWS::ElasticBeanstalk::ApplicationVersion'
        ,'AWS::ElasticBeanstalk::ConfigurationTemplate'
        ,'AWS::ElasticBeanstalk::Environment'
        ,'AWS::ElasticLoadBalancing::LoadBalancer'
        ,'AWS::Elasticsearch::Domain'
        ,'AWS::EMR::Cluster'
        ,'AWS::EMR::InstanceGroupConfig'
        ,'AWS::EMR::Step'
        ,'AWS::IAM::AccessKey'
        ,'AWS::IAM::Group'
        ,'AWS::IAM::InstanceProfile'
        ,'AWS::IAM::ManagedPolicy'
        ,'AWS::IAM::Policy'
        ,'AWS::IAM::Role'
        ,'AWS::IAM::User'
        ,'AWS::IAM::UserToGroupAddition'
        ,'AWS::Kinesis::Stream'
        ,'AWS::KMS::Key'
        ,'AWS::Lambda::EventSourceMapping'
        ,'AWS::Lambda::Function'
        ,'AWS::Lambda::Permission'
        ,'AWS::Logs::Destination'
        ,'AWS::Logs::LogGroup'
        ,'AWS::Logs::LogStream'
        ,'AWS::Logs::MetricFilter'
        ,'AWS::Logs::SubscriptionFilter'
        ,'AWS::OpsWorks::App'
        ,'AWS::OpsWorks::ElasticLoadBalancerAttachment'
        ,'AWS::OpsWorks::Instance'
        ,'AWS::OpsWorks::Layer'
        ,'AWS::OpsWorks::Stack'
        ,'AWS::RDS::DBCluster'
        ,'AWS::RDS::DBClusterParameterGroup'
        ,'AWS::RDS::DBInstance'
        ,'AWS::RDS::DBParameterGroup'
        ,'AWS::RDS::DBSecurityGroup'
        ,'AWS::RDS::DBSecurityGroupIngress'
        ,'AWS::RDS::DBSubnetGroup'
        ,'AWS::RDS::EventSubscription'
        ,'AWS::RDS::OptionGroup'
        ,'AWS::Redshift::Cluster'
        ,'AWS::Redshift::ClusterParameterGroup'
        ,'AWS::Redshift::ClusterSecurityGroup'
        ,'AWS::Redshift::ClusterSecurityGroupIngress'
        ,'AWS::Redshift::ClusterSubnetGroup'
        ,'AWS::Route53::HealthCheck'
        ,'AWS::Route53::HostedZone'
        ,'AWS::Route53::RecordSet'
        ,'AWS::Route53::RecordSetGroup'
        ,'AWS::S3::Bucket'
        ,'AWS::S3::BucketPolicy'
        ,'AWS::SDB::Domain'
        ,'AWS::SNS::Topic'
        ,'AWS::SNS::TopicPolicy'
        ,'AWS::SQS::Queue'
        ,'AWS::SQS::QueuePolicy'
        ,'AWS::SSM::Document'
        ,'AWS::WAF::ByteMatchSet'
        ,'AWS::WAF::IPSet'
        ,'AWS::WAF::Rule'
        ,'AWS::WAF::SqlInjectionMatchSet'
        ,'AWS::WAF::WebACL'
        ,'AWS::WorkSpaces::Workspace'

#endregion
        )]
        [string]$Type,
        [Parameter(Mandatory,ParameterSetName="RawType",Position=1)]
        [string]$RawType,
        [System.Collections.IDictionary]$Properties,
        [object]$Condition,
        [Parameter(Position=2)]
        [scriptblock]$PropertiesBlock
    )

    $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
    if (-not $tResources) {
        throw "Template Resources collection is not in scope"
    }
        
    if ($tResources.Contains($ResourceName)) {
        throw "Duplicate Resource name [$ResourceName]"
    }

    if ($RawType) {
        $Type = $RawType
    }

    $r = [ordered]@{ Type = $Type }
    $rProperties = [ordered]@{}

    if ($Properties -and $Properties.Count) {
        foreach ($pk in $Properties.Keys) {
            $rProperties = $Properties[$pk]
        }
    }

    if ($Condition) {
        $r.Condition = $Condition
    }

    if ($PropertiesBlock) {
        & $PropertiesBlock
    }

    if ($rProperties -and $rProperties.Count) {
        $r.Properties = $rProperties
    }

    $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Resource -Value Add-CfnResource

function Add-CfnAutoScaling_AutoScalingGroupResource {
<#
.SYNOPSIS
The AWS::AutoScaling::AutoScalingGroup type creates an Auto Scaling group.
.PARAMETER AvailabilityZones
Contains a list of Availability Zones for the group.
.PARAMETER Cooldown
The number of seconds after a scaling activity completes before any further scaling activities can start.
.PARAMETER DesiredCapacity
Specifies the desired capacity for the auto scaling group.
.PARAMETER HealthCheckGracePeriod
The length of time in seconds after a new EC2 instance comes into service that Auto Scaling starts checking its health.
.PARAMETER HealthCheckType
The service you want the health status from, Amazon EC2 or Elastic Load Balancer. Valid values are "EC2" or "ELB."
.PARAMETER InstanceId
The ID of the Amazon EC2 instance you want to use to create the Auto Scaling group. Use this property if you want to create an Auto Scaling group by using an existing Amazon EC2 instance instead of a launch configuration.
.PARAMETER LaunchConfigurationName
Specifies the name of the associated AWS::AutoScaling::LaunchConfiguration.
.PARAMETER LoadBalancerNames
A list of load balancers associated with this auto scaling group.
.PARAMETER MaxSize
The maximum size of the auto scaling group.
.PARAMETER MetricsCollection
Enables the monitoring of group metrics of an Auto Scaling group.
.PARAMETER MinSize
The minimum size of the auto scaling group.
.PARAMETER NotificationConfiguration
An embedded property that configures an auto scaling group to send notifications when specified events take place.
.PARAMETER NotificationConfigurations
An embedded property that configures an auto scaling group to send notifications when specified events take place.
.PARAMETER PlacementGroup
The name of an existing cluster placement group into which you want to launch your instances.
.PARAMETER Tags
The tags you want to attach to this resource.
.PARAMETER TerminationPolicies
A termination policy or a list of termination policies that are used to select the instances to terminate. The policies are executed in the order that you list them.
.PARAMETER VPCZoneIdentifier
A list of subnet identifiers of Amazon Virtual Private Clouds (Amazon VPCs).
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER CreationPolicy
You associate the CreationPolicy attribute with a resource to prevent its status from reaching create complete until AWS CloudFormation receives a specified number of success signals or the timeout period is exceeded. To signal a resource, you can use the cfn-signal helper script or SignalResource API. AWS CloudFormation publishes valid signals to the stack events so that you track the number of signals sent.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-creationpolicy.html
.PARAMETER UpdatePolicy
You can use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::AutoScaling::AutoScalingGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [ValidateSet('us-east-1a','us-east-1b','us-east-1c','us-east-1d','us-east-1e','us-west-1a','us-west-1b','us-west-1c','us-west-2a','us-west-2b','us-west-2c','eu-west-1a','eu-west-1b','eu-west-1c','ap-northeast-1a','ap-northeast-1b','ap-northeast-1c','ap-southeast-1a','ap-southeast-1b','ap-southeast-2a','ap-southeast-2b','sa-east-1a','sa-east-1b')]
    [string[]]$AvailabilityZones, #[array][string] allowed-values array-type description required type

    [string]$Cooldown, # description required type

    [string]$DesiredCapacity, # description required type

    [int]$HealthCheckGracePeriod, # description required type

    [ValidateSet('EC2','ELB')]
    [string]$HealthCheckType, # allowed-values description required type

    [string]$InstanceId, # description required type

    [string]$LaunchConfigurationName, # description required resource-ref-type type

    [string[]]$LoadBalancerNames, #[array][string] array-type description required resource-ref-type type

    [string]$MaxSize, # description required type

    [System.Collections.IDictionary[]]$MetricsCollection, #[array][System.Collections.IDictionary] array-type description properties required type

    [string]$MinSize, # description required type

    [System.Collections.IDictionary]$NotificationConfiguration, # description properties required type

    [System.Collections.IDictionary[]]$NotificationConfigurations, #[array][System.Collections.IDictionary] array-type description properties required type

    [string]$PlacementGroup, # description required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [string[]]$TerminationPolicies, #[array][string] array-type description required type

    [string[]]$VPCZoneIdentifier, #[array][string] array-type description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [hashtable]$CreationPolicy,
    [hashtable]$UpdatePolicy,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::AutoScaling::AutoScalingGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AvailabilityZones) {
    $rProperties.AvailabilityZones = $AvailabilityZones
  }
  if ($Cooldown) {
    $rProperties.Cooldown = $Cooldown
  }
  if ($DesiredCapacity) {
    $rProperties.DesiredCapacity = $DesiredCapacity
  }
  if ($HealthCheckGracePeriod) {
    $rProperties.HealthCheckGracePeriod = $HealthCheckGracePeriod
  }
  if ($HealthCheckType) {
    $rProperties.HealthCheckType = $HealthCheckType
  }
  if ($InstanceId) {
    $rProperties.InstanceId = $InstanceId
  }
  if ($LaunchConfigurationName) {
    $rProperties.LaunchConfigurationName = $LaunchConfigurationName
  }
  if ($LoadBalancerNames) {
    $rProperties.LoadBalancerNames = $LoadBalancerNames
  }
  if ($MaxSize) {
    $rProperties.MaxSize = $MaxSize
  }
  if ($MetricsCollection) {
    $rProperties.MetricsCollection = $MetricsCollection
  }
  if ($MinSize) {
    $rProperties.MinSize = $MinSize
  }
  if ($NotificationConfiguration) {
    $rProperties.NotificationConfiguration = $NotificationConfiguration
  }
  if ($NotificationConfigurations) {
    $rProperties.NotificationConfigurations = $NotificationConfigurations
  }
  if ($PlacementGroup) {
    $rProperties.PlacementGroup = $PlacementGroup
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      if (-not ($tv -is [System.Collections.IDictionary])) {
        throw "Tag property [Tags] requires a dictionary of values"
      }
      foreach ($tvp in $tv.Keys) {
        if ($tvp -notin ('Value','PropagateAtLaunch')) {
          throw "Tag property [Tags] must be a dictionary with keys ['Value','PropagateAtLaunch']"
        }
        $t[$tvp] = $tv[$tvp]
      }
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  if ($TerminationPolicies) {
    $rProperties.TerminationPolicies = $TerminationPolicies
  }
  if ($VPCZoneIdentifier) {
    $rProperties.VPCZoneIdentifier = $VPCZoneIdentifier
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($CreationPolicy) {
    $r.CreationPolicy = $CreationPolicy
  }
  if ($UpdatePolicy) {
    $r.UpdatePolicy = $UpdatePolicy
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-AutoScaling-AutoScalingGroup -Value Add-CfnAutoScaling_AutoScalingGroupResource

function Add-CfnAutoScaling_LaunchConfigurationResource {
<#
.SYNOPSIS
The AWS::AutoScaling::LaunchConfiguration type creates an Auto Scaling launch configuration that can be used by an Auto Scaling group to configure EC2 instances in the Auto Scaling group.
.PARAMETER AssociatePublicIpAddress
Indicates whether Amazon EC2 instances in the Auto Scaling group receive public IP addresses. If you specify true, each instance in the Auto Scaling receives a unique public IP address.
.PARAMETER BlockDeviceMappings
Specifies how block devices are exposed to the instance. You can specify virtual devices and EBS volumes.
.PARAMETER ClassicLinkVPCId
The ID of a ClassicLink-enabled VPC to link your EC2-Classic instances to. You can specify this property only for EC2-Classic instances.
.PARAMETER ClassicLinkVPCSecurityGroups
The IDs of one or more security groups for the VPC that you specified in the ClassicLinkVPCId property.
.PARAMETER EbsOptimized
Specifies whether the launch configuration is optimized for EBS I/O. This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance. Additional fees are incurred when using EBS-optimized instances.
.PARAMETER IamInstanceProfile
Provides the name or the Amazon Resource Name (ARN) of the instance profile associated with the IAM role for the instance. The instance profile contains the IAM role.
.PARAMETER ImageId
Provides the unique ID of the Amazon Machine Image (AMI) that was assigned during registration.
.PARAMETER InstanceId
The ID of the Amazon EC2 instance you want to use to create the launch configuration. Use this property if you want the launch configuration to use settings from an existing Amazon EC2 instance.
.PARAMETER InstanceMonitoring
Indicates whether or not instance monitoring should be enabled for this autoscaling group. This is enabled by default. To turn it off, set InstanceMonitoring to "false".
.PARAMETER InstanceType
The instance type. For example, "m1.small".
.PARAMETER KernelId
The kernel ID
.PARAMETER KeyName
Provides the name of the EC2 key pair.
.PARAMETER PlacementTenancy
The tenancy of the instance. An instance with a tenancy of dedicated runs on single-tenant hardware and can only be launched in a VPC.
.PARAMETER RamdiskId
The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, refer to the AWS Resource Center and search for the kernel ID.
.PARAMETER SecurityGroups
A list containing the EC2 security groups to assign to the Amazon EC2 instances in the Auto Scaling group. The list can contain the name of existing EC2 security groups, references to AWS::EC2::SecurityGroup resources created in the template, or both.
.PARAMETER SpotPrice
The spot price for this autoscaling group. If a spot price is set, then the autoscaling group will launch when the current spot price is less than the amount specified in the template.
.PARAMETER UserData
The user data available to the launched EC2 instances.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::AutoScaling::LaunchConfiguration
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [bool]$AssociatePublicIpAddress, # description required type

    [System.Collections.IDictionary[]]$BlockDeviceMappings, #[array][System.Collections.IDictionary] array-type description properties required type

    [string]$ClassicLinkVPCId, # description required resource-ref-type type

    [string[]]$ClassicLinkVPCSecurityGroups, #[array][string] array-type description required resource-ref-type type

    [bool]$EbsOptimized, # description required type

    [string]$IamInstanceProfile, # description required resource-ref-type type

    [string]$ImageId, # description required type

    [string]$InstanceId, # description required type

    [bool]$InstanceMonitoring, # description required type

    [ValidateSet('*','t1.micro','m1.small','m1.medium','m1.large','m1.xlarge','m2.xlarge','m2.2xlarge','m2.4xlarge','m3.medium','m3.large','m3.xlarge','m3.2xlarge','c1.medium','c1.xlarge','cr1.8xlarge','c3.large','c3.xlarge','c3.2xlarge','c3.4xlarge','c3.8xlarge','cc1.4xlarge','cc2.8xlarge','cg1.4xlarge','g2.2xlarge','g2.2xlarge','hi1.4xlarge','hs1.8xlarge','i2.xlarge','i2.2xlarge','i2.4xlarge','i2.8xlarge','r3.large','r3.xlarge','r3.2xlarge','r3.4xlarge','r3.8xlarge')]
    [string]$InstanceType, # allowed-values description required type

    [string]$KernelId, # description required type

    [string]$KeyName, # description required type

    [string]$PlacementTenancy, # description required type

    [string]$RamdiskId, # description required type

    [string[]]$SecurityGroups, #[array][string] array-type description required resource-ref-type type

    [string]$SpotPrice, # description required type

    [string]$UserData, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::AutoScaling::LaunchConfiguration" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AssociatePublicIpAddress) {
    $rProperties.AssociatePublicIpAddress = $AssociatePublicIpAddress
  }
  if ($BlockDeviceMappings) {
    $rProperties.BlockDeviceMappings = $BlockDeviceMappings
  }
  if ($ClassicLinkVPCId) {
    $rProperties.ClassicLinkVPCId = $ClassicLinkVPCId
  }
  if ($ClassicLinkVPCSecurityGroups) {
    $rProperties.ClassicLinkVPCSecurityGroups = $ClassicLinkVPCSecurityGroups
  }
  if ($EbsOptimized) {
    $rProperties.EbsOptimized = $EbsOptimized
  }
  if ($IamInstanceProfile) {
    $rProperties.IamInstanceProfile = $IamInstanceProfile
  }
  if ($ImageId) {
    $rProperties.ImageId = $ImageId
  }
  if ($InstanceId) {
    $rProperties.InstanceId = $InstanceId
  }
  if ($InstanceMonitoring) {
    $rProperties.InstanceMonitoring = $InstanceMonitoring
  }
  if ($InstanceType) {
    $rProperties.InstanceType = $InstanceType
  }
  if ($KernelId) {
    $rProperties.KernelId = $KernelId
  }
  if ($KeyName) {
    $rProperties.KeyName = $KeyName
  }
  if ($PlacementTenancy) {
    $rProperties.PlacementTenancy = $PlacementTenancy
  }
  if ($RamdiskId) {
    $rProperties.RamdiskId = $RamdiskId
  }
  if ($SecurityGroups) {
    $rProperties.SecurityGroups = $SecurityGroups
  }
  if ($SpotPrice) {
    $rProperties.SpotPrice = $SpotPrice
  }
  if ($UserData) {
    $rProperties.UserData = $UserData
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-AutoScaling-LaunchConfiguration -Value Add-CfnAutoScaling_LaunchConfigurationResource

function Add-CfnAutoScaling_LifecycleHookResource {
<#
.SYNOPSIS
Use AWS::AutoScaling::LifecycleHook to control the state of an instance in an Auto Scaling group after it is launched or terminated.
.PARAMETER AutoScalingGroupName
The name of the Auto Scaling group for the lifecycle hook.
.PARAMETER DefaultResult
The action the Auto Scaling group takes when the lifecycle hook timeout elapses or if an unexpected failure occurs.
.PARAMETER HeartbeatTimeout
The amount of time that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action that you specified in the DefaultResult property.
.PARAMETER LifecycleHookName
The name of the lifecycle hook. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the lifecycle hook name.
.PARAMETER LifecycleTransition
The state of the Amazon EC2 instance to which you want to attach the lifecycle hook.
.PARAMETER NotificationMetadata
Additional information that you want to include when Auto Scaling sends a message to the notification target.
.PARAMETER NotificationTargetARN
The Amazon resource name (ARN) of the notification target that Auto Scaling uses to notify you when an instance is in the transition state for the lifecycle hook.
.PARAMETER RoleARN
The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target. The role requires permissions to Amazon SNS and Amazon SQS.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::AutoScaling::LifecycleHook
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$AutoScalingGroupName, # description required resource-ref-type type

    [string]$DefaultResult, # description required type

    [int]$HeartbeatTimeout, # description required type

    [string]$LifecycleHookName, # description required type

    [string]$LifecycleTransition, # description required type

    [string]$NotificationMetadata, # description required type

    [string]$NotificationTargetARN, # description required resource-ref-type type

    [string]$RoleARN, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::AutoScaling::LifecycleHook" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AutoScalingGroupName) {
    $rProperties.AutoScalingGroupName = $AutoScalingGroupName
  }
  if ($DefaultResult) {
    $rProperties.DefaultResult = $DefaultResult
  }
  if ($HeartbeatTimeout) {
    $rProperties.HeartbeatTimeout = $HeartbeatTimeout
  }
  if ($LifecycleHookName) {
    $rProperties.LifecycleHookName = $LifecycleHookName
  }
  if ($LifecycleTransition) {
    $rProperties.LifecycleTransition = $LifecycleTransition
  }
  if ($NotificationMetadata) {
    $rProperties.NotificationMetadata = $NotificationMetadata
  }
  if ($NotificationTargetARN) {
    $rProperties.NotificationTargetARN = $NotificationTargetARN
  }
  if ($RoleARN) {
    $rProperties.RoleARN = $RoleARN
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-AutoScaling-LifecycleHook -Value Add-CfnAutoScaling_LifecycleHookResource

function Add-CfnAutoScaling_ScalingPolicyResource {
<#
.SYNOPSIS
The AWS::AutoScaling::ScalingPolicy resource adds a scaling policy to an auto scaling group. A scaling policy specifies whether to scale the auto scaling group up or down, and by how much.
.PARAMETER AdjustmentType
Specifies whether the ScalingAdjustment is an absolute number or a percentage of the current capacity.
.PARAMETER AutoScalingGroupName
The name or Amazon Resource Name (ARN) of the Auto Scaling Group that you want to attach the policy to.
.PARAMETER Cooldown
The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.
.PARAMETER EstimatedInstanceWarmup
The estimated time, in seconds, until a newly launched instance can send metrics to CloudWatch.
.PARAMETER MetricAggregationType
The aggregation type for the CloudWatch metrics.
.PARAMETER MinAdjustmentMagnitude
For the PercentChangeInCapacity adjustment type, the minimum number of instances to scale.
.PARAMETER MinAdjustmentStep
The minimum number of instances that are added or removed when the Auto Scaling group scales up or down. You can use this property only when you specify PercentChangeInCapacity for the AdjustmentType property.
.PARAMETER PolicyType
An Auto Scaling policy type. You can specify SimpleScaling or StepScaling. By default, AWS CloudFormation specifies SimpleScaling.
.PARAMETER ScalingAdjustment
The number of instances by which to scale. AdjustmentType determines the interpretation of this number (e.g., as an absolute number or as a percentage of the existing Auto Scaling group size). A positive increment adds to the current capacity and a negative value removes from the current capacity.
.PARAMETER StepAdjustments
A set of adjustments that enable you to scale based on the size of the alarm breach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::AutoScaling::ScalingPolicy
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [ValidateSet('ChangeInCapacity','ExactCapacity','PercentChangeInCapacity')]
    [string]$AdjustmentType, # allowed-values description required type

    [string]$AutoScalingGroupName, # description required resource-ref-type type

    [string]$Cooldown, # description required type

    [int]$EstimatedInstanceWarmup, # description required type

    [ValidateSet('Minimum','Maximum','Average')]
    [string]$MetricAggregationType, # allowed-values description required type

    [int]$MinAdjustmentMagnitude, # description required type

    [int]$MinAdjustmentStep, # description required type

    [ValidateSet('SimpleScaling','StepScaling')]
    [string]$PolicyType, # allowed-values description required type

    [int]$ScalingAdjustment, # description required type

    [System.Collections.IDictionary]$StepAdjustments, # description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::AutoScaling::ScalingPolicy" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AdjustmentType) {
    $rProperties.AdjustmentType = $AdjustmentType
  }
  if ($AutoScalingGroupName) {
    $rProperties.AutoScalingGroupName = $AutoScalingGroupName
  }
  if ($Cooldown) {
    $rProperties.Cooldown = $Cooldown
  }
  if ($EstimatedInstanceWarmup) {
    $rProperties.EstimatedInstanceWarmup = $EstimatedInstanceWarmup
  }
  if ($MetricAggregationType) {
    $rProperties.MetricAggregationType = $MetricAggregationType
  }
  if ($MinAdjustmentMagnitude) {
    $rProperties.MinAdjustmentMagnitude = $MinAdjustmentMagnitude
  }
  if ($MinAdjustmentStep) {
    $rProperties.MinAdjustmentStep = $MinAdjustmentStep
  }
  if ($PolicyType) {
    $rProperties.PolicyType = $PolicyType
  }
  if ($ScalingAdjustment) {
    $rProperties.ScalingAdjustment = $ScalingAdjustment
  }
  if ($StepAdjustments) {
    $rProperties.StepAdjustments = $StepAdjustments
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-AutoScaling-ScalingPolicy -Value Add-CfnAutoScaling_ScalingPolicyResource

function Add-CfnAutoScaling_ScheduledActionResource {
<#
.SYNOPSIS
The AWS::AutoScaling::AutoScalingGroup type creates an Auto Scaling group.
.PARAMETER AutoScalingGroupName
The name or ARN of the Auto Scaling group.
.PARAMETER DesiredCapacity
The number of Amazon EC2 instances that should be running in the Auto Scaling group.
.PARAMETER EndTime
The time in UTC for this schedule to end. For example, 2010-06-01T00:00:00Z.
.PARAMETER MaxSize
The maximum number of Amazon EC2 instances in the Auto Scaling group.
.PARAMETER MinSize
The minimum number of Amazon EC2 instances in the Auto Scaling group.
.PARAMETER Recurrence
The time when recurring future actions will start. You specify the start time by following the Unix cron syntax format.
.PARAMETER StartTime
The time in UTC for this schedule to start. For example, 2010-06-01T00:00:00Z.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::AutoScaling::ScheduledAction
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$AutoScalingGroupName, # description required resource-ref-type type

    [string]$DesiredCapacity, # description required type

    [string]$EndTime, # description required type

    [int]$MaxSize, # description required type

    [int]$MinSize, # description required type

    [string]$Recurrence, # description required type

    [string]$StartTime, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::AutoScaling::ScheduledAction" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AutoScalingGroupName) {
    $rProperties.AutoScalingGroupName = $AutoScalingGroupName
  }
  if ($DesiredCapacity) {
    $rProperties.DesiredCapacity = $DesiredCapacity
  }
  if ($EndTime) {
    $rProperties.EndTime = $EndTime
  }
  if ($MaxSize) {
    $rProperties.MaxSize = $MaxSize
  }
  if ($MinSize) {
    $rProperties.MinSize = $MinSize
  }
  if ($Recurrence) {
    $rProperties.Recurrence = $Recurrence
  }
  if ($StartTime) {
    $rProperties.StartTime = $StartTime
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-AutoScaling-ScheduledAction -Value Add-CfnAutoScaling_ScheduledActionResource

function Add-CfnAutoScaling_TriggerResource {
<#
.SYNOPSIS
Creates an Auto Scaling trigger that determines when scaling activities should occur for the Auto Scaling group. This type does not support updates.
.PARAMETER AutoScalingGroupName
The name of the Auto Scaling group.
.PARAMETER BreachDuration
The amount of time to wait while the trigger is firing before performing scaling activities in response to the breach.
.PARAMETER Dimensions
A list of CloudWatch dimensions used to retrieve metric statistics that the trigger uses to determine when to fire.
.PARAMETER LowerBreachScaleIncrement
The incremental amount to use when performing scaling activities when the lower threshold has been breached.
.PARAMETER LowerThreshold
The lower limit for the metric. The trigger fires if all data points in the last BreachDuration seconds exceed the upper threshold or fall below the lower threshold.
.PARAMETER MetricName
The metric name used by the trigger to determine when to fire.
.PARAMETER Namespace
The namespace used by the trigger to determine when to fire.
.PARAMETER Period
The period used in retrieving metric statistics used by the trigger to determine when to fire.
.PARAMETER Statistic
The statistic used by the trigger to determine which metric statistics to examine.
.PARAMETER Unit
The standard unit associated with a measure, used by the trigger when fetching the metric statistics it uses to determine when to activate.
.PARAMETER UpperBreachScaleIncrement
The incremental amount to use when performing scaling activities when the upper threshold has been breached. Must be a negative or positive integer, or integer percentage value.
.PARAMETER UpperThreshold
The upper limit of the metric used. The trigger fires if all data points in the last BreachDuration seconds exceed the upper threshold or fall below the lower threshold.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::AutoScaling::Trigger
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$AutoScalingGroupName, # description required resource-ref-type type

    [string]$BreachDuration, # description required type

    [System.Collections.IDictionary[]]$Dimensions, #[array][System.Collections.IDictionary] array-type description properties required type

    [string]$LowerBreachScaleIncrement, # description required type

    [string]$LowerThreshold, # description required type

    [string]$MetricName, # description required type

    [string]$Namespace, # description required type

    [string]$Period, # description required type

    [string]$Statistic, # description required type

    [string]$Unit, # description required type

    [string]$UpperBreachScaleIncrement, # description required type

    [string]$UpperThreshold, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::AutoScaling::Trigger" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AutoScalingGroupName) {
    $rProperties.AutoScalingGroupName = $AutoScalingGroupName
  }
  if ($BreachDuration) {
    $rProperties.BreachDuration = $BreachDuration
  }
  if ($Dimensions) {
    $rProperties.Dimensions = $Dimensions
  }
  if ($LowerBreachScaleIncrement) {
    $rProperties.LowerBreachScaleIncrement = $LowerBreachScaleIncrement
  }
  if ($LowerThreshold) {
    $rProperties.LowerThreshold = $LowerThreshold
  }
  if ($MetricName) {
    $rProperties.MetricName = $MetricName
  }
  if ($Namespace) {
    $rProperties.Namespace = $Namespace
  }
  if ($Period) {
    $rProperties.Period = $Period
  }
  if ($Statistic) {
    $rProperties.Statistic = $Statistic
  }
  if ($Unit) {
    $rProperties.Unit = $Unit
  }
  if ($UpperBreachScaleIncrement) {
    $rProperties.UpperBreachScaleIncrement = $UpperBreachScaleIncrement
  }
  if ($UpperThreshold) {
    $rProperties.UpperThreshold = $UpperThreshold
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-AutoScaling-Trigger -Value Add-CfnAutoScaling_TriggerResource

function Add-CfnCloudFormation_StackResource {
<#
.SYNOPSIS
The AWS::CloudFormation::Stack type embeds a stack as a resource in a template.
.PARAMETER Parameters
The set of parameters passed to AWS CloudFormation when this embedded stack is created.
.PARAMETER TemplateURL
The URL of a template that specifies the stack that you want to create as a resource.
.PARAMETER TimeoutInMinutes
The length of time, in minutes, that AWS CloudFormation waits for the embedded stack to reach the CREATE_COMPLETE state.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::CloudFormation::Stack
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [object]$Parameters, # description required type

    [string]$TemplateURL, # description required type

    [string]$TimeoutInMinutes, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::CloudFormation::Stack" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Parameters) {
    $rProperties.Parameters = $Parameters
  }
  if ($TemplateURL) {
    $rProperties.TemplateURL = $TemplateURL
  }
  if ($TimeoutInMinutes) {
    $rProperties.TimeoutInMinutes = $TimeoutInMinutes
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-CloudFormation-Stack -Value Add-CfnCloudFormation_StackResource

function Add-CfnCloudFormation_WaitConditionResource {
<#
.SYNOPSIS
The following properties are available with the AWS::CloudFormation::WaitCondition type.
.PARAMETER Count
The number of success signals that AWS CloudFormation must receive before it continues the stack creation process.
.PARAMETER Handle
A reference to the wait condition handle used to signal this wait condition.
.PARAMETER Timeout
The length of time (in seconds) to wait for the number of signals that the Count property specifies.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER CreationPolicy
You associate the CreationPolicy attribute with a resource to prevent its status from reaching create complete until AWS CloudFormation receives a specified number of success signals or the timeout period is exceeded. To signal a resource, you can use the cfn-signal helper script or SignalResource API. AWS CloudFormation publishes valid signals to the stack events so that you track the number of signals sent.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-creationpolicy.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::CloudFormation::WaitCondition
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Count, # description required type

    [string]$Handle, # description required resource-ref-type type

    [string]$Timeout, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [hashtable]$CreationPolicy,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::CloudFormation::WaitCondition" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Count) {
    $rProperties.Count = $Count
  }
  if ($Handle) {
    $rProperties.Handle = $Handle
  }
  if ($Timeout) {
    $rProperties.Timeout = $Timeout
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($CreationPolicy) {
    $r.CreationPolicy = $CreationPolicy
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-CloudFormation-WaitCondition -Value Add-CfnCloudFormation_WaitConditionResource

function Add-CfnCloudFormation_WaitConditionHandleResource {
<#
.SYNOPSIS
The AWS::CloudFormation::WaitConditionHandle type has no properties.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::CloudFormation::WaitConditionHandle
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::CloudFormation::WaitConditionHandle" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-CloudFormation-WaitConditionHandle -Value Add-CfnCloudFormation_WaitConditionHandleResource

function Add-CfnCloudFront_DistributionResource {
<#
.SYNOPSIS
Creates an Amazon CloudFront download distribution.
.PARAMETER DistributionConfig
The distribution's configuration information.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::CloudFront::Distribution
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$DistributionConfig, # description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::CloudFront::Distribution" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($DistributionConfig) {
    $rProperties.DistributionConfig = $DistributionConfig
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-CloudFront-Distribution -Value Add-CfnCloudFront_DistributionResource

function Add-CfnCloudTrail_TrailResource {
<#
.SYNOPSIS
The AWS::CloudTrail::Trail resource creates a trail and specifies where logs are published.
.PARAMETER CloudWatchLogsLogGroupArn
The Amazon Resource Name (ARN) of a log group to which CloudTrail logs will be delivered.
.PARAMETER CloudWatchLogsRoleArn
The role ARN that Amazon CloudWatch Logs (CloudWatch Logs) assumes to write logs to a log group.
.PARAMETER EnableLogFileValidation
Indicates whether CloudTrail validates the integrity of log files. When you disable log file integrity validation, CloudTrail stops creating digest files.
.PARAMETER IncludeGlobalServiceEvents
Indicates whether the trail is publishing events from global services, such as IAM, to the log files.
.PARAMETER IsLogging
Indicates whether the CloudTrail trail is currently logging AWS API calls.
.PARAMETER IsMultiRegionTrail
Indicates whether the CloudTrail trail is created in the region in which you create the stack (false) or in all regions (true).
.PARAMETER KMSKeyId
The AWS Key Management Service (AWS KMS) key ID that you want to use to encrypt CloudTrail logs.
.PARAMETER S3BucketName
The name of the Amazon S3 bucket where CloudTrail publishes log files.
.PARAMETER S3KeyPrefix
An Amazon S3 object key prefix that precedes the name of all log files.
.PARAMETER SnsTopicName
The name of an Amazon SNS topic that is notified when new log files are published.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::CloudTrail::Trail
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$CloudWatchLogsLogGroupArn, # description required type

    [string]$CloudWatchLogsRoleArn, # description required type

    [bool]$EnableLogFileValidation, # description required type

    [bool]$IncludeGlobalServiceEvents, # description required type

    [bool]$IsLogging, # description required type

    [bool]$IsMultiRegionTrail, # description required type

    [string]$KMSKeyId, # description required resource-ref-type type

    [string]$S3BucketName, # description required resource-ref-type type

    [string]$S3KeyPrefix, # description required type

    [string]$SnsTopicName, # description required resource-ref-type type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::CloudTrail::Trail" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($CloudWatchLogsLogGroupArn) {
    $rProperties.CloudWatchLogsLogGroupArn = $CloudWatchLogsLogGroupArn
  }
  if ($CloudWatchLogsRoleArn) {
    $rProperties.CloudWatchLogsRoleArn = $CloudWatchLogsRoleArn
  }
  if ($EnableLogFileValidation) {
    $rProperties.EnableLogFileValidation = $EnableLogFileValidation
  }
  if ($IncludeGlobalServiceEvents) {
    $rProperties.IncludeGlobalServiceEvents = $IncludeGlobalServiceEvents
  }
  if ($IsLogging) {
    $rProperties.IsLogging = $IsLogging
  }
  if ($IsMultiRegionTrail) {
    $rProperties.IsMultiRegionTrail = $IsMultiRegionTrail
  }
  if ($KMSKeyId) {
    $rProperties.KMSKeyId = $KMSKeyId
  }
  if ($S3BucketName) {
    $rProperties.S3BucketName = $S3BucketName
  }
  if ($S3KeyPrefix) {
    $rProperties.S3KeyPrefix = $S3KeyPrefix
  }
  if ($SnsTopicName) {
    $rProperties.SnsTopicName = $SnsTopicName
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-CloudTrail-Trail -Value Add-CfnCloudTrail_TrailResource

function Add-CfnCloudWatch_AlarmResource {
<#
.SYNOPSIS
The AWS::CloudWatch::Alarm type creates an Amazon CloudWatch alarm.
.PARAMETER ActionsEnabled
Indicates whether or not actions should be executed during any changes to the alarm's state. Either true or false.
.PARAMETER AlarmActions
The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
.PARAMETER AlarmDescription
The description for the alarm.
.PARAMETER AlarmName
A name for the alarm. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the alarm name.
.PARAMETER ComparisonOperator
The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand.
.PARAMETER Dimensions
The dimensions for the alarm's associated metric.
.PARAMETER EvaluationPeriods
The number of periods over which data is compared to the specified threshold.
.PARAMETER InsufficientDataActions
The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
.PARAMETER MetricName
The name for the alarm's associated metric.
.PARAMETER Namespace
The namespace for the alarm's associated metric.
.PARAMETER OKActions
The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Number (ARN). Currently the only action supported is publishing to an Amazon SNS topic or an Amazon Auto Scaling policy.
.PARAMETER Period
The period in seconds over which the specified statistic is applied.
.PARAMETER Statistic
The statistic to apply to the alarm's associated metric.
.PARAMETER Threshold
The value against which the specified statistic is compared.
.PARAMETER Unit
The unit for the alarm's associated metric.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::CloudWatch::Alarm
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$ActionsEnabled, # description required type

    [string[]]$AlarmActions, #[array][string] array-type description required resource-ref-type type

    [string]$AlarmDescription, # description required type

    [string]$AlarmName, # description required type

    [ValidateSet('GreaterThanOrEqualToThreshold','GreaterThanThreshold','LessThanThreshold','LessThanOrEqualToThreshold')]
    [string]$ComparisonOperator, # allowed-values description required type

    [System.Collections.IDictionary[]]$Dimensions, #[array][System.Collections.IDictionary] array-type description properties required type

    [string]$EvaluationPeriods, # description required type

    [string[]]$InsufficientDataActions, #[array][string] array-type description required resource-ref-type type

    [string]$MetricName, # description required type

    [string]$Namespace, # description required type

    [string[]]$OKActions, #[array][string] array-type description required resource-ref-type type

    [string]$Period, # description required type

    [ValidateSet('SampleCount','Average','Sum','Minimum','Maximum')]
    [string]$Statistic, # allowed-values description required type

    [string]$Threshold, # description required type

    [ValidateSet('Seconds','Microseconds','Milliseconds','Bytes','Kilobytes','Megabytes','Gigabytes','Terabytes','Bits','Kilobits','Megabits','Gigabits','Terabits','Percent','Count','Bytes/Second','Kilobytes/Second','Megabytes/Second','Gigabytes/Second','Terabytes/Second','Bits/Second','Kilobits/Second','Megabits/Second','Gigabits/Second','Terabits/Second','Count/Second','None')]
    [string]$Unit, # allowed-values description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::CloudWatch::Alarm" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($ActionsEnabled) {
    $rProperties.ActionsEnabled = $ActionsEnabled
  }
  if ($AlarmActions) {
    $rProperties.AlarmActions = $AlarmActions
  }
  if ($AlarmDescription) {
    $rProperties.AlarmDescription = $AlarmDescription
  }
  if ($AlarmName) {
    $rProperties.AlarmName = $AlarmName
  }
  if ($ComparisonOperator) {
    $rProperties.ComparisonOperator = $ComparisonOperator
  }
  if ($Dimensions) {
    $rProperties.Dimensions = $Dimensions
  }
  if ($EvaluationPeriods) {
    $rProperties.EvaluationPeriods = $EvaluationPeriods
  }
  if ($InsufficientDataActions) {
    $rProperties.InsufficientDataActions = $InsufficientDataActions
  }
  if ($MetricName) {
    $rProperties.MetricName = $MetricName
  }
  if ($Namespace) {
    $rProperties.Namespace = $Namespace
  }
  if ($OKActions) {
    $rProperties.OKActions = $OKActions
  }
  if ($Period) {
    $rProperties.Period = $Period
  }
  if ($Statistic) {
    $rProperties.Statistic = $Statistic
  }
  if ($Threshold) {
    $rProperties.Threshold = $Threshold
  }
  if ($Unit) {
    $rProperties.Unit = $Unit
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-CloudWatch-Alarm -Value Add-CfnCloudWatch_AlarmResource

function Add-CfnCodeDeploy_ApplicationResource {
<#
.SYNOPSIS
The AWS::CodeDeploy::Application resource creates an AWS CodeDeploy application.
.PARAMETER ApplicationName
A name for the application. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the application name.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::CodeDeploy::Application
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$ApplicationName, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::CodeDeploy::Application" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($ApplicationName) {
    $rProperties.ApplicationName = $ApplicationName
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-CodeDeploy-Application -Value Add-CfnCodeDeploy_ApplicationResource

function Add-CfnCodeDeploy_DeploymentConfigResource {
<#
.SYNOPSIS
The AWS::CodeDeploy::DeploymentConfig resource creates a set of deployment rules, deployment success conditions, and deployment failure conditions that AWS CodeDeploy uses during a deployment.
.PARAMETER DeploymentConfigName
A name for the deployment configuration. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the deployment configuration name.
.PARAMETER MinimumHealthyHosts
The minimum number of healthy instances that must be available at any time during an AWS CodeDeploy deployment.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::CodeDeploy::DeploymentConfig
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$DeploymentConfigName, # description required type

    [System.Collections.IDictionary]$MinimumHealthyHosts, # description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::CodeDeploy::DeploymentConfig" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($DeploymentConfigName) {
    $rProperties.DeploymentConfigName = $DeploymentConfigName
  }
  if ($MinimumHealthyHosts) {
    $rProperties.MinimumHealthyHosts = $MinimumHealthyHosts
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-CodeDeploy-DeploymentConfig -Value Add-CfnCodeDeploy_DeploymentConfigResource

function Add-CfnCodeDeploy_DeploymentGroupResource {
<#
.SYNOPSIS
The AWS::CodeDeploy::DeploymentGroup resource creates an AWS CodeDeploy deployment group that details which application revision to use and which instances your application revisions are deployed to.
.PARAMETER ApplicationName
The name of an AWS CodeDeploy application for this deployment group.
.PARAMETER AutoScalingGroups
A list of associated Auto Scaling groups that AWS CodeDeploy automatically deploys revisions to when new instances are created.
.PARAMETER Deployment
The application revision that will be deployed to this deployment group.
.PARAMETER DeploymentConfigName
A deployment configuration name or a predefined configuration name.
.PARAMETER DeploymentGroupName
A name for the deployment group. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the deployment group name.
.PARAMETER Ec2TagFilters
The Amazon EC2 tags to filter on. AWS CodeDeploy includes all instances that match the tag filter with this deployment group.
.PARAMETER OnPremisesInstanceTagFilters
The on-premises instance tags to filter on.
.PARAMETER ServiceRoleArn
A service role Amazon Resource Name (ARN) that grants AWS CodeDeploy permission to make calls to AWS services on your behalf.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::CodeDeploy::DeploymentGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$ApplicationName, # description required resource-ref-type type

    [string[]]$AutoScalingGroups, #[array][string] array-type description required resource-ref-type type

    [System.Collections.IDictionary]$Deployment, # description properties required type

    [string]$DeploymentConfigName, # description required resource-ref-type type

    [string]$DeploymentGroupName, # description required type

    [System.Collections.IDictionary]$Ec2TagFilters, # array-type description properties required type

    [System.Collections.IDictionary]$OnPremisesInstanceTagFilters, # array-type description properties required type

    [string]$ServiceRoleArn, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::CodeDeploy::DeploymentGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($ApplicationName) {
    $rProperties.ApplicationName = $ApplicationName
  }
  if ($AutoScalingGroups) {
    $rProperties.AutoScalingGroups = $AutoScalingGroups
  }
  if ($Deployment) {
    $rProperties.Deployment = $Deployment
  }
  if ($DeploymentConfigName) {
    $rProperties.DeploymentConfigName = $DeploymentConfigName
  }
  if ($DeploymentGroupName) {
    $rProperties.DeploymentGroupName = $DeploymentGroupName
  }
  if ($Ec2TagFilters) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Ec2TagFilters.Keys) {
      $t = @{ Key = $tk }
      $tv = $Ec2TagFilters[$tk]
      if (-not ($tv -is [System.Collections.IDictionary])) {
        throw "Tag property [Ec2TagFilters] requires a dictionary of values"
      }
      foreach ($tvp in $tv.Keys) {
        if ($tvp -notin ('Value','Type')) {
          throw "Tag property [Ec2TagFilters] must be a dictionary with keys ['Value','Type']"
        }
        $t[$tvp] = $tv[$tvp]
      }
      $tagsList += $t
    }
    $rProperties.Ec2TagFilters = $tagsList
  }
  if ($OnPremisesInstanceTagFilters) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $OnPremisesInstanceTagFilters.Keys) {
      $t = @{ Key = $tk }
      $tv = $OnPremisesInstanceTagFilters[$tk]
      if (-not ($tv -is [System.Collections.IDictionary])) {
        throw "Tag property [OnPremisesInstanceTagFilters] requires a dictionary of values"
      }
      foreach ($tvp in $tv.Keys) {
        if ($tvp -notin ('Value','Type')) {
          throw "Tag property [OnPremisesInstanceTagFilters] must be a dictionary with keys ['Value','Type']"
        }
        $t[$tvp] = $tv[$tvp]
      }
      $tagsList += $t
    }
    $rProperties.OnPremisesInstanceTagFilters = $tagsList
  }
  if ($ServiceRoleArn) {
    $rProperties.ServiceRoleArn = $ServiceRoleArn
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-CodeDeploy-DeploymentGroup -Value Add-CfnCodeDeploy_DeploymentGroupResource

function Add-CfnCodePipeline_CustomActionTypeResource {
<#
.SYNOPSIS
The AWS::CodePipeline::CustomActionType resource creates a custom action for activities that aren't included in the AWS CodePipeline default actions, such as running an internally developed build process or a test suite.
.PARAMETER Category
The category of the custom action, such as a source action or a build action.
.PARAMETER ConfigurationProperties
The configuration properties for the custom action.
.PARAMETER InputArtifactDetails
The input artifact details for this custom action.
.PARAMETER OutputArtifactDetails
The output artifact details for this custom action.
.PARAMETER Provider
The name of the service provider that AWS CodePipeline uses for this custom action.
.PARAMETER Settings
URLs that provide users information about this custom action.
.PARAMETER Version
The version number of this custom action.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::CodePipeline::CustomActionType
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Category, # description required type

    [System.Collections.IDictionary[]]$ConfigurationProperties, #[array][System.Collections.IDictionary] array-type description properties required type

    [System.Collections.IDictionary]$InputArtifactDetails, # description properties required type

    [System.Collections.IDictionary]$OutputArtifactDetails, # description properties required type

    [string]$Provider, # description required type

    [System.Collections.IDictionary]$Settings, # description properties required type

    [string]$Version, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::CodePipeline::CustomActionType" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Category) {
    $rProperties.Category = $Category
  }
  if ($ConfigurationProperties) {
    $rProperties.ConfigurationProperties = $ConfigurationProperties
  }
  if ($InputArtifactDetails) {
    $rProperties.InputArtifactDetails = $InputArtifactDetails
  }
  if ($OutputArtifactDetails) {
    $rProperties.OutputArtifactDetails = $OutputArtifactDetails
  }
  if ($Provider) {
    $rProperties.Provider = $Provider
  }
  if ($Settings) {
    $rProperties.Settings = $Settings
  }
  if ($Version) {
    $rProperties.Version = $Version
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-CodePipeline-CustomActionType -Value Add-CfnCodePipeline_CustomActionTypeResource

function Add-CfnCodePipeline_PipelineResource {
<#
.SYNOPSIS
The AWS::CodePipeline::Pipeline resource creates an AWS CodePipeline pipeline that describes how software changes go through a release process.
.PARAMETER ArtifactStore
The Amazon Simple Storage Service (Amazon S3) location where AWS CodePipeline stores pipeline artifacts.
.PARAMETER DisableInboundStageTransitions
Prevents artifacts in a pipeline from transitioning to the stage that you specified.
.PARAMETER Name
The name of your AWS CodePipeline pipeline.
.PARAMETER RestartExecutionOnUpdate
Indicates whether to rerun the AWS CodePipeline pipeline after you update it.
.PARAMETER RoleArn
A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make calls to AWS services on your behalf.
.PARAMETER Stages
Defines the AWS CodePipeline pipeline stages.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::CodePipeline::Pipeline
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$ArtifactStore, # description properties required type

    [System.Collections.IDictionary[]]$DisableInboundStageTransitions, #[array][System.Collections.IDictionary] array-type description properties required type

    [string]$Name, # description required type

    [bool]$RestartExecutionOnUpdate, # description required type

    [string]$RoleArn, # description required resource-ref-type type

    [System.Collections.IDictionary[]]$Stages, #[array][System.Collections.IDictionary] array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::CodePipeline::Pipeline" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($ArtifactStore) {
    $rProperties.ArtifactStore = $ArtifactStore
  }
  if ($DisableInboundStageTransitions) {
    $rProperties.DisableInboundStageTransitions = $DisableInboundStageTransitions
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  if ($RestartExecutionOnUpdate) {
    $rProperties.RestartExecutionOnUpdate = $RestartExecutionOnUpdate
  }
  if ($RoleArn) {
    $rProperties.RoleArn = $RoleArn
  }
  if ($Stages) {
    $rProperties.Stages = $Stages
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-CodePipeline-Pipeline -Value Add-CfnCodePipeline_PipelineResource

function Add-CfnConfig_ConfigRuleResource {
<#
.SYNOPSIS
The AWS::Config::ConfigRule resource uses an AWS Lambda (Lambda) function that evaluates configuration items to assess whether your AWS resources comply with your specified configurations.
.PARAMETER ConfigRuleName
A name for the AWS Config rule. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the rule name.
.PARAMETER Description
A description about this AWS Config rule.
.PARAMETER InputParameters
Input parameter values that are passed to the AWS Config rule (Lambda function).
.PARAMETER MaximumExecutionFrequency
The maximum frequency at which the AWS Config rule runs evaluations.
.PARAMETER Scope
Defines which AWS resources will trigger an evaluation when their configurations change.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Config::ConfigRule
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$ConfigRuleName, # description required type

    [string]$Description, # description required type

    [object]$InputParameters, # description required type

    [ValidateSet('*','One_Hour','Three_Hours','Six_Hours','Twelve_Hours','TwentyFour_Hours')]
    [string]$MaximumExecutionFrequency, # allowed-values description required type

    [System.Collections.IDictionary]$Scope, # description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Config::ConfigRule" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($ConfigRuleName) {
    $rProperties.ConfigRuleName = $ConfigRuleName
  }
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($InputParameters) {
    $rProperties.InputParameters = $InputParameters
  }
  if ($MaximumExecutionFrequency) {
    $rProperties.MaximumExecutionFrequency = $MaximumExecutionFrequency
  }
  if ($Scope) {
    $rProperties.Scope = $Scope
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Config-ConfigRule -Value Add-CfnConfig_ConfigRuleResource

function Add-CfnConfig_ConfigurationRecorderResource {
<#
.SYNOPSIS
The AWS::Config::ConfigurationRecorder resource describes the AWS resource types for which AWS Config records configuration changes. The configuration recorder stores the configurations of the supported resources in your account as configuration items.
.PARAMETER Name
A name for the configuration recorder.
.PARAMETER RecordingGroup
Indicates whether to record configurations for all supported resources or for a list of resource types.
.PARAMETER RoleARN
The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that is used to make read or write requests to the delivery channel that you specify and to get configuration details for supported AWS resources.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Config::ConfigurationRecorder
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Name, # description required type

    [System.Collections.IDictionary]$RecordingGroup, # description properties required type

    [string]$RoleARN, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Config::ConfigurationRecorder" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Name) {
    $rProperties.Name = $Name
  }
  if ($RecordingGroup) {
    $rProperties.RecordingGroup = $RecordingGroup
  }
  if ($RoleARN) {
    $rProperties.RoleARN = $RoleARN
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Config-ConfigurationRecorder -Value Add-CfnConfig_ConfigurationRecorderResource

function Add-CfnConfig_DeliveryChannelResource {
<#
.SYNOPSIS
The AWS::Config::DeliveryChannel resource describes where AWS Config stores configuration changes to an AWS resource.
.PARAMETER ConfigSnapshotDeliveryProperties
Provides options for how AWS Config delivers configuration snapshots to the S3 bucket in your delivery channel.
.PARAMETER Name
A name for the delivery channel. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the delivery channel name.
.PARAMETER S3BucketName
The name of an S3 bucket where you want to store configuration history for the delivery channel.
.PARAMETER S3KeyPrefix
A key prefix (folder) for the specified S3 bucket.
.PARAMETER SnsTopicARN
The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (Amazon SNS) topic that AWS Config delivers notifications to.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Config::DeliveryChannel
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$ConfigSnapshotDeliveryProperties, # description properties required type

    [string]$Name, # description required type

    [string]$S3BucketName, # description required resource-ref-type type

    [string]$S3KeyPrefix, # description required type

    [string]$SnsTopicARN, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Config::DeliveryChannel" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($ConfigSnapshotDeliveryProperties) {
    $rProperties.ConfigSnapshotDeliveryProperties = $ConfigSnapshotDeliveryProperties
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  if ($S3BucketName) {
    $rProperties.S3BucketName = $S3BucketName
  }
  if ($S3KeyPrefix) {
    $rProperties.S3KeyPrefix = $S3KeyPrefix
  }
  if ($SnsTopicARN) {
    $rProperties.SnsTopicARN = $SnsTopicARN
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Config-DeliveryChannel -Value Add-CfnConfig_DeliveryChannelResource

function Add-CfnDataPipeline_PipelineResource {
<#
.SYNOPSIS
Creates a data pipeline that you can use to automate the movement and transformation of data.
.PARAMETER Activate
Indicates whether to validate and start the pipeline or stop an active pipeline. By default, the value is set to true.
.PARAMETER Description
A description for the pipeline.
.PARAMETER Name
A name for the pipeline. Because AWS CloudFormation assigns each new pipeline a unique identifier, you can use the same name for multiple pipelines that are associated with your AWS account.
.PARAMETER ParameterObjects
Defines the variables that are in the pipeline definition.
.PARAMETER ParameterValues
Defines the values for the parameters that are defined in the ParameterObjects property.
.PARAMETER PipelineObjects
A list of pipeline objects that make up the pipeline.
.PARAMETER PipelineTags
The tags that you want to attach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::DataPipeline::Pipeline
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [bool]$Activate, # description required type

    [string]$Description, # description required type

    [string]$Name, # description required type

    [System.Collections.IDictionary[]]$ParameterObjects, #[array][System.Collections.IDictionary] array-type description properties required type

    [System.Collections.IDictionary[]]$ParameterValues, #[array][System.Collections.IDictionary] array-type description properties required type

    [System.Collections.IDictionary[]]$PipelineObjects, #[array][System.Collections.IDictionary] array-type description properties required type

    [System.Collections.IDictionary]$PipelineTags, # array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::DataPipeline::Pipeline" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Activate) {
    $rProperties.Activate = $Activate
  }
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  if ($ParameterObjects) {
    $rProperties.ParameterObjects = $ParameterObjects
  }
  if ($ParameterValues) {
    $rProperties.ParameterValues = $ParameterValues
  }
  if ($PipelineObjects) {
    $rProperties.PipelineObjects = $PipelineObjects
  }
  if ($PipelineTags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $PipelineTags.Keys) {
      $t = @{ Key = $tk }
      $tv = $PipelineTags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.PipelineTags = $tagsList
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-DataPipeline-Pipeline -Value Add-CfnDataPipeline_PipelineResource

function Add-CfnDirectoryService_MicrosoftADResource {
<#
.SYNOPSIS
The AWS::DirectoryService::MicrosoftAD resource creates a Microsoft Active Directory in AWS so that your directory users and groups can access the AWS Management Console and AWS applications using their existing credentials.
.PARAMETER CreateAlias
A unique alias to assign to the Microsoft Active Directory in AWS.
.PARAMETER EnableSso
Whether to enable single sign-on for a Microsoft Active Directory in AWS.
.PARAMETER Name
The fully qualified name for the Microsoft Active Directory in AWS, such as corp.example.com.
.PARAMETER Password
The password for the default administrative user, Admin.
.PARAMETER ShortName
The NetBIOS name for your domain, such as CORP.
.PARAMETER VpcSettings
Specifies the VPC settings of the Microsoft Active Directory server in AWS.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::DirectoryService::MicrosoftAD
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [bool]$CreateAlias, # description required type

    [bool]$EnableSso, # description required type

    [string]$Name, # description required type

    [string]$Password, # description required type

    [string]$ShortName, # description required type

    [System.Collections.IDictionary]$VpcSettings, # description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::DirectoryService::MicrosoftAD" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($CreateAlias) {
    $rProperties.CreateAlias = $CreateAlias
  }
  if ($EnableSso) {
    $rProperties.EnableSso = $EnableSso
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  if ($Password) {
    $rProperties.Password = $Password
  }
  if ($ShortName) {
    $rProperties.ShortName = $ShortName
  }
  if ($VpcSettings) {
    $rProperties.VpcSettings = $VpcSettings
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-DirectoryService-MicrosoftAD -Value Add-CfnDirectoryService_MicrosoftADResource

function Add-CfnDirectoryService_SimpleADResource {
<#
.SYNOPSIS
The AWS::DirectoryService::SimpleAD resource creates an AWS Directory Service Simple Active Directory (Simple AD) in AWS so that you can seamlessly join Amazon Elastic Compute Cloud (Amazon EC2) Windows instances to your domain.
.PARAMETER CreateAlias
Creates an alias for a directory and assigns the alias to the directory.
.PARAMETER Description
A description of the directory.
.PARAMETER EnableSso
Whether to enable single-sign on for a directory.
.PARAMETER Name
The fully qualified name for the directory, such as corp.example.com.
.PARAMETER Password
The password for the directory administrator. AWS Directory Service creates a directory administrator account with the user name Administrator and this password.
.PARAMETER ShortName
The short name of the directory, such as CORP.
.PARAMETER Size
The size of the directory.
.PARAMETER VpcSettings
Specifies the VPC settings of the directory server.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::DirectoryService::SimpleAD
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [bool]$CreateAlias, # description required type

    [string]$Description, # description required type

    [bool]$EnableSso, # description required type

    [string]$Name, # description required type

    [string]$Password, # description required type

    [string]$ShortName, # description required type

    [ValidateSet('Large','Small','*')]
    [string]$Size, # allowed-values description required type

    [System.Collections.IDictionary]$VpcSettings, # description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::DirectoryService::SimpleAD" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($CreateAlias) {
    $rProperties.CreateAlias = $CreateAlias
  }
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($EnableSso) {
    $rProperties.EnableSso = $EnableSso
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  if ($Password) {
    $rProperties.Password = $Password
  }
  if ($ShortName) {
    $rProperties.ShortName = $ShortName
  }
  if ($Size) {
    $rProperties.Size = $Size
  }
  if ($VpcSettings) {
    $rProperties.VpcSettings = $VpcSettings
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-DirectoryService-SimpleAD -Value Add-CfnDirectoryService_SimpleADResource

function Add-CfnDynamoDB_TableResource {
<#
.SYNOPSIS
Creates an Amazon DynamoDB table.
.PARAMETER AttributeDefinitions
A list of AttributeName and AttributeValue objects that describe the key schema for the table and indexes.
.PARAMETER GlobalSecondaryIndexes
Global secondary indexes to be created on the table. You can create up to 5 global secondary indexes.
.PARAMETER KeySchema
The complete index key schema for the global secondary index, which consists of one or more pairs of attribute names and key types.
.PARAMETER LocalSecondaryIndexes
Local secondary indexes to be created on the table. You can create up to 5 local secondary indexes. Each index is scoped to a given hash key value. The size of each hash key can be up to 10 gigabytes.
.PARAMETER ProvisionedThroughput
New throughput for the specified table, consisting of values for ReadCapacityUnits and WriteCapacityUnits.
.PARAMETER TableName
A name for the table. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the table name.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::DynamoDB::Table
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary[]]$AttributeDefinitions, #[array][System.Collections.IDictionary] array-type description properties required type

    [System.Collections.IDictionary[]]$GlobalSecondaryIndexes, #[array][System.Collections.IDictionary] array-type description properties required type

    [System.Collections.IDictionary[]]$KeySchema, #[array][System.Collections.IDictionary] array-type description properties required type

    [System.Collections.IDictionary[]]$LocalSecondaryIndexes, #[array][System.Collections.IDictionary] array-type description properties required type

    [System.Collections.IDictionary]$ProvisionedThroughput, # description properties required type

    [string]$TableName, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::DynamoDB::Table" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AttributeDefinitions) {
    $rProperties.AttributeDefinitions = $AttributeDefinitions
  }
  if ($GlobalSecondaryIndexes) {
    $rProperties.GlobalSecondaryIndexes = $GlobalSecondaryIndexes
  }
  if ($KeySchema) {
    $rProperties.KeySchema = $KeySchema
  }
  if ($LocalSecondaryIndexes) {
    $rProperties.LocalSecondaryIndexes = $LocalSecondaryIndexes
  }
  if ($ProvisionedThroughput) {
    $rProperties.ProvisionedThroughput = $ProvisionedThroughput
  }
  if ($TableName) {
    $rProperties.TableName = $TableName
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-DynamoDB-Table -Value Add-CfnDynamoDB_TableResource

function Add-CfnEC2_CustomerGatewayResource {
<#
.SYNOPSIS
Provides information to AWS about your VPN customer gateway device.
.PARAMETER BgpAsn
The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number (ASN).
.PARAMETER IpAddress
The Internet-routable IP address for the customer gateway's outside interface. The address must be static.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER Type
The type of VPN connection this customer gateway supports. For example: ipsec.1
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::CustomerGateway
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [int]$BgpAsn, # description required type

    [string]$IpAddress, # description required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [string]$Type, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::CustomerGateway" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($BgpAsn) {
    $rProperties.BgpAsn = $BgpAsn
  }
  if ($IpAddress) {
    $rProperties.IpAddress = $IpAddress
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  if ($Type) {
    $rProperties.Type = $Type
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-CustomerGateway -Value Add-CfnEC2_CustomerGatewayResource

function Add-CfnEC2_DHCPOptionsResource {
<#
.SYNOPSIS
Creates a set of DHCP options for your VPC.
.PARAMETER DomainName
A domain name of your choice. Example: example.com
.PARAMETER DomainNameServers
The IP (IPv4) address of a domain name server. You can specify up to four addresses. Example: 10.0.0.1
.PARAMETER NetbiosNameServers
The IP address (IPv4) of a NetBIOS name server. You can specify up to four addresses. Example: 10.0.0.1
.PARAMETER NetbiosNodeType
Value indicating the NetBIOS node type (1, 2, 4, or 8). We recommend you only use 2 at this time (broadcast and multicast are currently not supported).
.PARAMETER NtpServers
The IP address of a Network Time Protocol (NTP) server. You can specify up to four addresses. Example: 10.0.0.1
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::DHCPOptions
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$DomainName, # description required type

    [ValidateSet('AmazonProvidedDNS','*')]
    [string[]]$DomainNameServers, #[array][string] allowed-values array-type description required type

    [string[]]$NetbiosNameServers, #[array][string] array-type description required type

    [ValidateSet('1','2','4','8','*')]
    [int[]]$NetbiosNodeType, #[array][int] allowed-values array-type description required type

    [string[]]$NtpServers, #[array][string] array-type description required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::DHCPOptions" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($DomainName) {
    $rProperties.DomainName = $DomainName
  }
  if ($DomainNameServers) {
    $rProperties.DomainNameServers = $DomainNameServers
  }
  if ($NetbiosNameServers) {
    $rProperties.NetbiosNameServers = $NetbiosNameServers
  }
  if ($NetbiosNodeType) {
    $rProperties.NetbiosNodeType = $NetbiosNodeType
  }
  if ($NtpServers) {
    $rProperties.NtpServers = $NtpServers
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-DHCPOptions -Value Add-CfnEC2_DHCPOptionsResource

function Add-CfnEC2_EIPResource {
<#
.SYNOPSIS
The AWS::EC2::EIP resource allocates an Elastic IP (EIP) address and can, optionally, associate it with an Amazon EC2 instance.
.PARAMETER Domain
Set to "vpc" to allocate the address to your Virtual Private Cloud (VPC). No other values are supported.
.PARAMETER InstanceId
The Instance ID of the Amazon EC2 instance that you want to associate with this Elastic IP address.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::EIP
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Domain, # description required type

    [string]$InstanceId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::EIP" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Domain) {
    $rProperties.Domain = $Domain
  }
  if ($InstanceId) {
    $rProperties.InstanceId = $InstanceId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-EIP -Value Add-CfnEC2_EIPResource

function Add-CfnEC2_EIPAssociationResource {
<#
.SYNOPSIS
The AWS::EC2::EIPAssociation resource associates an Elastic IP address with an Amazon EC2 instance. The Elastic IP address can be an existing Elastic IP address or an Elastic IP address allocated through an AWS::EC2::EIP resource.
.PARAMETER AllocationId
Allocation ID for the VPC Elastic IP address you want to associate with an Amazon EC2 instance in your VPC.
.PARAMETER EIP
Elastic IP address that you want to associate with the Amazon EC2 instance specified by the InstanceId property. You can specify an existing Elastic IP address or a reference to an Elastic IP address allocated with a AWS::EC2::EIP resource.
.PARAMETER InstanceId
Instance ID of the Amazon EC2 instance that you want to associate with the Elastic IP address specified by the EIP property.
.PARAMETER NetworkInterfaceId
The ID of the network interface to associate with the Elastic IP address (VPC only).
.PARAMETER PrivateIpAddress
The private IP address that you want to associate with the Elastic IP address. The private IP address is restricted to the primary and secondary private IP addresses that are associated with the network interface. By default, the private IP address that is associated with the EIP is the primary private IP address of the network interface.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::EIPAssociation
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$AllocationId, # description required type

    [string]$EIP, # description required resource-ref-type type

    [string]$InstanceId, # description required resource-ref-type type

    [string]$NetworkInterfaceId, # description required resource-ref-type type

    [string]$PrivateIpAddress, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::EIPAssociation" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AllocationId) {
    $rProperties.AllocationId = $AllocationId
  }
  if ($EIP) {
    $rProperties.EIP = $EIP
  }
  if ($InstanceId) {
    $rProperties.InstanceId = $InstanceId
  }
  if ($NetworkInterfaceId) {
    $rProperties.NetworkInterfaceId = $NetworkInterfaceId
  }
  if ($PrivateIpAddress) {
    $rProperties.PrivateIpAddress = $PrivateIpAddress
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-EIPAssociation -Value Add-CfnEC2_EIPAssociationResource

function Add-CfnEC2_InstanceResource {
<#
.SYNOPSIS
The AWS::EC2::Instance type creates an Amazon EC2 instance.
.PARAMETER AvailabilityZone
Specifies the name of the availability zone in which the instance is located. If not specified, the default availability zone for the region will be used.
.PARAMETER BlockDeviceMappings
Defines a set of Amazon EC2 Elastic Block Store (EBS) block device mappings.
.PARAMETER DisableApiTermination
Specifies whether the instance can be terminated through the API (specify "true"), or not (specify "false").
.PARAMETER EbsOptimized
This optimization provides dedicated throughput to Amazon EBS and an optimized configuration stack to provide optimal EBS I/O performance.
.PARAMETER IamInstanceProfile
A reference to an AWS::IAM::InstanceProfile type
.PARAMETER ImageId
Provides the unique ID of the Amazon Machine Image (AMI) that was assigned during registration.
.PARAMETER InstanceInitiatedShutdownBehavior
Indicates whether an instance stops or terminates when you shut down the instance from the instance's operating system shutdown command.
.PARAMETER InstanceType
The instance type. For example, "m1.small".
.PARAMETER KernelId
The kernel ID
.PARAMETER KeyName
Provides the name of the EC2 key pair.
.PARAMETER Monitoring
Specifies whether monitoring is enabled for the instance.
.PARAMETER NetworkInterfaces
A list of network interfaces to associate with this instance.
.PARAMETER PlacementGroupName
The name of an existing placement group that you want to launch the instance into (for cluster instances).
.PARAMETER PrivateIpAddress
If you're using an Amazon Virtual Private Cloud (VPC), you can optionally use this parameter to assign the instance a specific available IP address from the subnet (e.g., 10.0.0.25). By default, Amazon VPC selects an IP address from the subnet for the instance.
.PARAMETER RamdiskId
The ID of the RAM disk to select. Some kernels require additional drivers at launch. Check the kernel requirements for information about whether you need to specify a RAM disk. To find kernel requirements, refer to the AWS Resource Center and search for the kernel ID.
.PARAMETER SecurityGroupIds
A list that contains the security group IDs for VPC security groups to assign to the Amazon EC2 instance.
.PARAMETER SecurityGroups
Valid only for EC2 security groups. A list that contains the EC2 security groups to assign to the Amazon EC2 instance. The list can contain both the name of existing EC2 security groups or references to AWS::EC2::SecurityGroup resources created in the template.
.PARAMETER SourceDestCheck
Controls whether source/destination checking is enabled on the instance. Also determines if an instance in a VPC will perform network address translation (NAT).
.PARAMETER SsmAssociations
The Amazon EC2 Simple Systems Manager (SSM) document and parameter values to associate with this instance.
.PARAMETER SubnetId
If you're using Amazon Virtual Private Cloud, this specifies the ID of the subnet that you want to launch the instance into.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER Tenancy
The tenancy of the instance that you want to launch. This value can be either "default" or "dedicated". An instance that has a tenancy value of "dedicated" runs on single-tenant hardware and can be launched only into a VPC.
.PARAMETER UserData
Base64-encoded MIME user data that is made available to the instances.
.PARAMETER Volumes
The EBS volumes to attach to the instance.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER CreationPolicy
You associate the CreationPolicy attribute with a resource to prevent its status from reaching create complete until AWS CloudFormation receives a specified number of success signals or the timeout period is exceeded. To signal a resource, you can use the cfn-signal helper script or SignalResource API. AWS CloudFormation publishes valid signals to the stack events so that you track the number of signals sent.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-creationpolicy.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::Instance
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [ValidateSet('us-east-1a','us-east-1b','us-east-1c','us-east-1d','us-east-1e','us-west-1a','us-west-1b','us-west-1c','us-west-2a','us-west-2b','us-west-2c','eu-west-1a','eu-west-1b','eu-west-1c','ap-northeast-1a','ap-northeast-1b','ap-northeast-1c','ap-southeast-1a','ap-southeast-1b','ap-southeast-2a','ap-southeast-2b','sa-east-1a','sa-east-1b')]
    [string]$AvailabilityZone, # allowed-values description required type

    [System.Collections.IDictionary[]]$BlockDeviceMappings, #[array][System.Collections.IDictionary] array-type description properties required type

    [bool]$DisableApiTermination, # description required type

    [bool]$EbsOptimized, # description required type

    [string]$IamInstanceProfile, # description required resource-ref-type type

    [string]$ImageId, # description required type

    [string]$InstanceInitiatedShutdownBehavior, # description required type

    [ValidateSet('*','t1.micro','m1.small','m1.medium','m1.large','m1.xlarge','m2.xlarge','m2.2xlarge','m2.4xlarge','m3.medium','m3.large','m3.xlarge','m3.2xlarge','c1.medium','c1.xlarge','cr1.8xlarge','c3.large','c3.xlarge','c3.2xlarge','c3.4xlarge','c3.8xlarge','cc1.4xlarge','cc2.8xlarge','cg1.4xlarge','g2.2xlarge','g2.2xlarge','hi1.4xlarge','hs1.8xlarge','i2.xlarge','i2.2xlarge','i2.4xlarge','i2.8xlarge','r3.large','r3.xlarge','r3.2xlarge','r3.4xlarge','r3.8xlarge')]
    [string]$InstanceType, # allowed-values description required type

    [string]$KernelId, # description required type

    [string]$KeyName, # description required type

    [bool]$Monitoring, # description required type

    [System.Collections.IDictionary[]]$NetworkInterfaces, #[array][System.Collections.IDictionary] array-type description properties required type

    [string]$PlacementGroupName, # description required type

    [string]$PrivateIpAddress, # description required type

    [string]$RamdiskId, # description required type

    [string[]]$SecurityGroupIds, #[array][string] array-type description required resource-ref-type type

    [string[]]$SecurityGroups, #[array][string] array-type description required resource-ref-type type

    [bool]$SourceDestCheck, # description required type

    [System.Collections.IDictionary]$SsmAssociations, # description properties required type

    [string]$SubnetId, # description required resource-ref-type type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [string]$Tenancy, # description required type

    [string]$UserData, # description required type

    [System.Collections.IDictionary[]]$Volumes, #[array][System.Collections.IDictionary] array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [hashtable]$CreationPolicy,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::Instance" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AvailabilityZone) {
    $rProperties.AvailabilityZone = $AvailabilityZone
  }
  if ($BlockDeviceMappings) {
    $rProperties.BlockDeviceMappings = $BlockDeviceMappings
  }
  if ($DisableApiTermination) {
    $rProperties.DisableApiTermination = $DisableApiTermination
  }
  if ($EbsOptimized) {
    $rProperties.EbsOptimized = $EbsOptimized
  }
  if ($IamInstanceProfile) {
    $rProperties.IamInstanceProfile = $IamInstanceProfile
  }
  if ($ImageId) {
    $rProperties.ImageId = $ImageId
  }
  if ($InstanceInitiatedShutdownBehavior) {
    $rProperties.InstanceInitiatedShutdownBehavior = $InstanceInitiatedShutdownBehavior
  }
  if ($InstanceType) {
    $rProperties.InstanceType = $InstanceType
  }
  if ($KernelId) {
    $rProperties.KernelId = $KernelId
  }
  if ($KeyName) {
    $rProperties.KeyName = $KeyName
  }
  if ($Monitoring) {
    $rProperties.Monitoring = $Monitoring
  }
  if ($NetworkInterfaces) {
    $rProperties.NetworkInterfaces = $NetworkInterfaces
  }
  if ($PlacementGroupName) {
    $rProperties.PlacementGroupName = $PlacementGroupName
  }
  if ($PrivateIpAddress) {
    $rProperties.PrivateIpAddress = $PrivateIpAddress
  }
  if ($RamdiskId) {
    $rProperties.RamdiskId = $RamdiskId
  }
  if ($SecurityGroupIds) {
    $rProperties.SecurityGroupIds = $SecurityGroupIds
  }
  if ($SecurityGroups) {
    $rProperties.SecurityGroups = $SecurityGroups
  }
  if ($SourceDestCheck) {
    $rProperties.SourceDestCheck = $SourceDestCheck
  }
  if ($SsmAssociations) {
    $rProperties.SsmAssociations = $SsmAssociations
  }
  if ($SubnetId) {
    $rProperties.SubnetId = $SubnetId
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  if ($Tenancy) {
    $rProperties.Tenancy = $Tenancy
  }
  if ($UserData) {
    $rProperties.UserData = $UserData
  }
  if ($Volumes) {
    $rProperties.Volumes = $Volumes
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($CreationPolicy) {
    $r.CreationPolicy = $CreationPolicy
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-Instance -Value Add-CfnEC2_InstanceResource

function Add-CfnEC2_InternetGatewayResource {
<#
.SYNOPSIS
Creates a new Internet gateway in your AWS account. After creating the Internet gateway, you then attach it to a VPC.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::InternetGateway
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::InternetGateway" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-InternetGateway -Value Add-CfnEC2_InternetGatewayResource

function Add-CfnEC2_NatGatewayResource {
<#
.SYNOPSIS
The AWS::EC2::NatGateway resource creates a network address translation (NAT) gateway in the specified public subnet
.PARAMETER AllocationId
The allocation ID of an Elastic IP address to associate with the NAT gateway.
.PARAMETER SubnetId
The public subnet in which to create the NAT gateway.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::NatGateway
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$AllocationId, # description required type

    [string]$SubnetId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::NatGateway" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AllocationId) {
    $rProperties.AllocationId = $AllocationId
  }
  if ($SubnetId) {
    $rProperties.SubnetId = $SubnetId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-NatGateway -Value Add-CfnEC2_NatGatewayResource

function Add-CfnEC2_NetworkAclResource {
<#
.SYNOPSIS
Creates a new network ACL in a VPC.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER VpcId
The ID of the VPC where the network ACL will be created.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::NetworkAcl
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [string]$VpcId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::NetworkAcl" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  if ($VpcId) {
    $rProperties.VpcId = $VpcId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-NetworkAcl -Value Add-CfnEC2_NetworkAclResource

function Add-CfnEC2_NetworkAclEntryResource {
<#
.SYNOPSIS
Creates an entry (i.e., rule) in a network ACL with a rule number you specify. Each network ACL has a set of numbered ingress rules and a separate set of numbered egress rules.
.PARAMETER CidrBlock
The CIDR range to allow or deny, in CIDR notation (e.g., 172.16.0.0/24).
.PARAMETER Egress
Whether this rule applies to egress traffic from the subnet ("true") or ingress traffic to the subnet ("false").
.PARAMETER Icmp
The Internet Control Message Protocol (ICMP) code and type. Required: Conditional, required if specifying 1 (ICMP) for the protocol parameter.
.PARAMETER NetworkAclId
ID of the ACL where the entry will be created.
.PARAMETER PortRange
The range of port numbers for the UDP/TCP protocol. Required: Conditional, required if specifying 6 (TCP) or 17 (UDP) for the protocol parameter.
.PARAMETER Protocol
IP protocol the rule applies to. You can use -1 to mean all protocols. This must be -1 or a protocol number.
.PARAMETER RuleAction
ID of the ACL where the entry will be created.
.PARAMETER RuleNumber
Rule number to assign to the entry (e.g., 100). This must be a postive integer from 1 to 32766.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::NetworkAclEntry
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$CidrBlock, # description required type

    [bool]$Egress, # description required type

    [System.Collections.IDictionary]$Icmp, # description properties required type

    [string]$NetworkAclId, # description required resource-ref-type type

    [System.Collections.IDictionary]$PortRange, # description properties required type

    [int]$Protocol, # description required type

    [ValidateSet('allow','deny')]
    [string]$RuleAction, # allowed-values description required type

    [int]$RuleNumber, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::NetworkAclEntry" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($CidrBlock) {
    $rProperties.CidrBlock = $CidrBlock
  }
  if ($Egress) {
    $rProperties.Egress = $Egress
  }
  if ($Icmp) {
    $rProperties.Icmp = $Icmp
  }
  if ($NetworkAclId) {
    $rProperties.NetworkAclId = $NetworkAclId
  }
  if ($PortRange) {
    $rProperties.PortRange = $PortRange
  }
  if ($Protocol) {
    $rProperties.Protocol = $Protocol
  }
  if ($RuleAction) {
    $rProperties.RuleAction = $RuleAction
  }
  if ($RuleNumber) {
    $rProperties.RuleNumber = $RuleNumber
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-NetworkAclEntry -Value Add-CfnEC2_NetworkAclEntryResource

function Add-CfnEC2_NetworkInterfaceResource {
<#
.SYNOPSIS
Describes a network interface in an Elastic Compute Cloud (EC2) instance for AWS CloudFormation.
.PARAMETER Description
The description of this network interface.
.PARAMETER GroupSet
A list of security group IDs associated with this network interface.
.PARAMETER PrivateIpAddress
IP address of the interface within the subnet.
.PARAMETER PrivateIpAddresses
Assigns a list of private IP addresses to the network interface. You can specify a primary private IP address by setting the value of the Primary property to true in the PrivateIpAddressSpecification property. If you want Amazon EC2 to automatically assign private IP addresses, use the SecondaryPrivateIpAddressCount property and do not specify this property.
.PARAMETER SecondaryPrivateIpAddressCount
The number of secondary private IP addresses that Amazon EC2 automatically assigns to the network interface. Amazon EC2 uses the value of the PrivateIpAddress property as the primary private IP address. If you don't specify that property, Amazon EC2 automatically assigns both the primary and secondary private IP addresses.
.PARAMETER SourceDestCheck
Flag indicating whether traffic to or from the instance is validated.
.PARAMETER SubnetId
The ID of the subnet to associate with the network interface.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::NetworkInterface
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Description, # description required type

    [string[]]$GroupSet, #[array][string] array-type description required resource-ref-type type

    [string]$PrivateIpAddress, # description required type

    [System.Collections.IDictionary[]]$PrivateIpAddresses, #[array][System.Collections.IDictionary] array-type description properties required type

    [int]$SecondaryPrivateIpAddressCount, # description required type

    [bool]$SourceDestCheck, # description required type

    [string]$SubnetId, # description required resource-ref-type type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::NetworkInterface" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($GroupSet) {
    $rProperties.GroupSet = $GroupSet
  }
  if ($PrivateIpAddress) {
    $rProperties.PrivateIpAddress = $PrivateIpAddress
  }
  if ($PrivateIpAddresses) {
    $rProperties.PrivateIpAddresses = $PrivateIpAddresses
  }
  if ($SecondaryPrivateIpAddressCount) {
    $rProperties.SecondaryPrivateIpAddressCount = $SecondaryPrivateIpAddressCount
  }
  if ($SourceDestCheck) {
    $rProperties.SourceDestCheck = $SourceDestCheck
  }
  if ($SubnetId) {
    $rProperties.SubnetId = $SubnetId
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-NetworkInterface -Value Add-CfnEC2_NetworkInterfaceResource

function Add-CfnEC2_NetworkInterfaceAttachmentResource {
<#
.SYNOPSIS
Attaches an elastic network interface (ENI) to an Amazon EC2 instance. You can use this resource type to attach additional network interfaces to an instances without interruption.
.PARAMETER DeleteOnTermination
Whether to delete the network interface when the instance terminates. By default, this value is set to True.
.PARAMETER DeviceIndex
The network interface's position in the attachment order. For example, the first attached network interface has a DeviceIndex of 0.
.PARAMETER InstanceId
The ID of the instance to which you will attach the ENI.
.PARAMETER NetworkInterfaceId
The ID of the ENI that you want to attach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::NetworkInterfaceAttachment
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [bool]$DeleteOnTermination, # description required type

    [string]$DeviceIndex, # description required type

    [string]$InstanceId, # description required resource-ref-type type

    [string]$NetworkInterfaceId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::NetworkInterfaceAttachment" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($DeleteOnTermination) {
    $rProperties.DeleteOnTermination = $DeleteOnTermination
  }
  if ($DeviceIndex) {
    $rProperties.DeviceIndex = $DeviceIndex
  }
  if ($InstanceId) {
    $rProperties.InstanceId = $InstanceId
  }
  if ($NetworkInterfaceId) {
    $rProperties.NetworkInterfaceId = $NetworkInterfaceId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-NetworkInterfaceAttachment -Value Add-CfnEC2_NetworkInterfaceAttachmentResource

function Add-CfnEC2_PlacementGroupResource {
<#
.SYNOPSIS
The AWS::EC2::PlacementGroup resource is a logical grouping of instances within a single Availability Zone (AZ) that enables applications to participate in a low-latency, 10 Gbps network.
.PARAMETER Strategy
The placement strategy, which relates to the instance types that can be added to the placement group.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::PlacementGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Strategy, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::PlacementGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Strategy) {
    $rProperties.Strategy = $Strategy
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-PlacementGroup -Value Add-CfnEC2_PlacementGroupResource

function Add-CfnEC2_RouteResource {
<#
.SYNOPSIS
Creates a new route in a route table within a VPC. The route's target can be either a gateway attached to the VPC or a NAT instance in the VPC.
.PARAMETER DestinationCidrBlock
The CIDR address block used for the destination match. For example, "0.0.0.0/0". Routing decisions are based on the most specific match.
.PARAMETER GatewayId
The ID of a gateway attached to your VPC. For example: "igw-eaad4883". Required: Conditional. You must provide only one of the following: a GatewayID, InstanceID, or NetworkInterfaceId.
.PARAMETER InstanceId
The ID of a NAT instance in your VPC. For example, "i-1a2b3c4d". Required: Conditional. You must provide only one of the following: a GatewayID, InstanceID, or NetworkInterfaceId.
.PARAMETER NetworkInterfaceId
Allows the routing of network interface IDs. Required: Conditional. You must provide only one of the following: a GatewayID, InstanceID, or NetworkInterfaceId.
.PARAMETER RouteTableId
The ID of the route table where the route will be added.
.PARAMETER VpcPeeringConnectionId
The ID of a VPC peering connection.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::Route
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$DestinationCidrBlock, # description required type

    [string]$GatewayId, # description required resource-ref-type type

    [string]$InstanceId, # description required resource-ref-type type

    [string]$NetworkInterfaceId, # description required resource-ref-type type

    [string]$RouteTableId, # description required resource-ref-type type

    [string]$VpcPeeringConnectionId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::Route" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($DestinationCidrBlock) {
    $rProperties.DestinationCidrBlock = $DestinationCidrBlock
  }
  if ($GatewayId) {
    $rProperties.GatewayId = $GatewayId
  }
  if ($InstanceId) {
    $rProperties.InstanceId = $InstanceId
  }
  if ($NetworkInterfaceId) {
    $rProperties.NetworkInterfaceId = $NetworkInterfaceId
  }
  if ($RouteTableId) {
    $rProperties.RouteTableId = $RouteTableId
  }
  if ($VpcPeeringConnectionId) {
    $rProperties.VpcPeeringConnectionId = $VpcPeeringConnectionId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-Route -Value Add-CfnEC2_RouteResource

function Add-CfnEC2_RouteTableResource {
<#
.SYNOPSIS
Creates a new route table within a VPC. After you create a new route table, you can add routes and associate the table with a subnet.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER VpcId
The ID of the VPC where the route table will be created.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::RouteTable
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [string]$VpcId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::RouteTable" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  if ($VpcId) {
    $rProperties.VpcId = $VpcId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-RouteTable -Value Add-CfnEC2_RouteTableResource

function Add-CfnEC2_SecurityGroupResource {
<#
.SYNOPSIS
The AWS::EC2::SecurityGroup type creates an Amazon EC2 security group.
.PARAMETER GroupDescription
Description of the security group.
.PARAMETER SecurityGroupEgress
A list of EC2 security group egress rules.
.PARAMETER SecurityGroupIngress
A list of EC2 security group ingress rules.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER VpcId
ID of the VPC.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::SecurityGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$GroupDescription, # description required type

    [System.Collections.IDictionary[]]$SecurityGroupEgress, #[array][System.Collections.IDictionary] array-type description properties required type

    [System.Collections.IDictionary[]]$SecurityGroupIngress, #[array][System.Collections.IDictionary] array-type description properties required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [string]$VpcId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::SecurityGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($GroupDescription) {
    $rProperties.GroupDescription = $GroupDescription
  }
  if ($SecurityGroupEgress) {
    $rProperties.SecurityGroupEgress = $SecurityGroupEgress
  }
  if ($SecurityGroupIngress) {
    $rProperties.SecurityGroupIngress = $SecurityGroupIngress
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  if ($VpcId) {
    $rProperties.VpcId = $VpcId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-SecurityGroup -Value Add-CfnEC2_SecurityGroupResource

function Add-CfnEC2_SecurityGroupEgressResource {
<#
.SYNOPSIS
The AWS::EC2::SecurityGroupEgress type adds an egress rule to an Amazon VPC security group.
.PARAMETER CidrIp
The CIDR range. Required: Conditional�cannot be used when specifying a destination security group.
.PARAMETER DestinationSecurityGroupId
For VPC security groups only. Specifies the ID of the Amazon EC2 Security Group to allow access. If you specify CidrIp, do not specify SourceSecurityGroupId.
.PARAMETER FromPort
Start of port range for the TCP and UDP protocols, or an ICMP type number. An ICMP type number of -1 indicates a wildcard.
.PARAMETER GroupId
ID of the Amazon VPC security group to modify. This value can be a reference to an AWS::EC2::SecurityGroup resource that has a valid VpcId property or the ID of an existing Amazon VPC security group.
.PARAMETER IpProtocol
IP protocol name or number.
.PARAMETER ToPort
End of port range for the TCP and UDP protocols, or an ICMP code. An ICMP code of -1 indicates a wildcard.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::SecurityGroupEgress
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$CidrIp, # description required type

    [string]$DestinationSecurityGroupId, # description required resource-ref-type type

    [ValidateSet('*','@{display-label=SSH (22); value=22}','@{display-label=SMTP (25); value=25}','@{display-label=HTTP (80); value=80}','@{display-label=POP3 (110); value=110}','@{display-label=HTTPS (443); value=443}','@{display-label=MS_SQL (1433); value=1433}','@{display-label=RDP (3389); value=3389}')]
    [string]$FromPort, # allowed-values description required type

    [string]$GroupId, # description required resource-ref-type type

    [ValidateSet('*','tcp','udp','icmp')]
    [string]$IpProtocol, # allowed-values description required type

    [ValidateSet('*','@{display-label=SSH (22); value=22}','@{display-label=SMTP (25); value=25}','@{display-label=HTTP (80); value=80}','@{display-label=POP3 (110); value=110}','@{display-label=HTTPS (443); value=443}','@{display-label=MS_SQL (1433); value=1433}','@{display-label=RDP (3389); value=3389}')]
    [string]$ToPort, # allowed-values description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::SecurityGroupEgress" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($CidrIp) {
    $rProperties.CidrIp = $CidrIp
  }
  if ($DestinationSecurityGroupId) {
    $rProperties.DestinationSecurityGroupId = $DestinationSecurityGroupId
  }
  if ($FromPort) {
    $rProperties.FromPort = $FromPort
  }
  if ($GroupId) {
    $rProperties.GroupId = $GroupId
  }
  if ($IpProtocol) {
    $rProperties.IpProtocol = $IpProtocol
  }
  if ($ToPort) {
    $rProperties.ToPort = $ToPort
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-SecurityGroupEgress -Value Add-CfnEC2_SecurityGroupEgressResource

function Add-CfnEC2_SecurityGroupIngressResource {
<#
.SYNOPSIS
The AWS::EC2::SecurityGroupIngress type adds an ingress rule to an Amazon EC2 or VPC security group.
.PARAMETER CidrIp
The CIDR range. If you specify SourceSecurityGroupName, do not specify CidrIp.
.PARAMETER FromPort
Start of port range for the TCP and UDP protocols, or an ICMP type number. An ICMP type number of -1 indicates a wildcard.
.PARAMETER GroupId
Name of the EC2 security group to modify. This value can be a reference to an AWS::EC2::SecurityGroup resource or the name of an existing EC2 security group. Required: Yes, for VPC security groups; can be used instead of GroupName for EC2 security groups.
.PARAMETER GroupName
Name of the EC2 security group to modify. This value can be a reference to an AWS::EC2::SecurityGroup resource or the name of an existing EC2 security group. Required: Can be used instead of GroupId for EC2 security groups.
.PARAMETER IpProtocol
IP protocol name or number.
.PARAMETER SourceSecurityGroupId
For VPC security groups only. Specifies the ID of the Amazon EC2 Security Group to allow access. If you specify CidrIp, do not specify SourceSecurityGroupId.
.PARAMETER SourceSecurityGroupName
Specifies the name of the Amazon EC2 Security Group to allow access. If you specify CidrIp, do not specify SourceSecurityGroupName.
.PARAMETER SourceSecurityGroupOwnerId
Specifies the AWS Account ID of the owner of the Amazon EC2 Security Group specified in the SourceSecurityGroupName property.

If you specify SourceSecurityGroupName and that security group is owned by a different account than the account creating the stack, you must specify the SourceSecurityGroupOwnerId; otherwise, this property is optional.
.PARAMETER ToPort
End of port range for the TCP and UDP protocols, or an ICMP code. An ICMP code of -1 indicates a wildcard.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::SecurityGroupIngress
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$CidrIp, # description required type

    [ValidateSet('*','@{display-label=SSH (22); value=22}','@{display-label=SMTP (25); value=25}','@{display-label=HTTP (80); value=80}','@{display-label=POP3 (110); value=110}','@{display-label=HTTPS (443); value=443}','@{display-label=MS_SQL (1433); value=1433}','@{display-label=RDP (3389); value=3389}')]
    [string]$FromPort, # allowed-values description required type

    [string]$GroupId, # description required resource-ref-type type

    [string]$GroupName, # description required resource-ref-type type

    [ValidateSet('*','tcp','udp','icmp')]
    [string]$IpProtocol, # allowed-values description required type

    [string]$SourceSecurityGroupId, # description required resource-ref-type type

    [string]$SourceSecurityGroupName, # description required resource-ref-type type

    [string]$SourceSecurityGroupOwnerId, # description required type

    [ValidateSet('*','@{display-label=SSH (22); value=22}','@{display-label=SMTP (25); value=25}','@{display-label=HTTP (80); value=80}','@{display-label=POP3 (110); value=110}','@{display-label=HTTPS (443); value=443}','@{display-label=MS_SQL (1433); value=1433}','@{display-label=RDP (3389); value=3389}')]
    [string]$ToPort, # allowed-values description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::SecurityGroupIngress" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($CidrIp) {
    $rProperties.CidrIp = $CidrIp
  }
  if ($FromPort) {
    $rProperties.FromPort = $FromPort
  }
  if ($GroupId) {
    $rProperties.GroupId = $GroupId
  }
  if ($GroupName) {
    $rProperties.GroupName = $GroupName
  }
  if ($IpProtocol) {
    $rProperties.IpProtocol = $IpProtocol
  }
  if ($SourceSecurityGroupId) {
    $rProperties.SourceSecurityGroupId = $SourceSecurityGroupId
  }
  if ($SourceSecurityGroupName) {
    $rProperties.SourceSecurityGroupName = $SourceSecurityGroupName
  }
  if ($SourceSecurityGroupOwnerId) {
    $rProperties.SourceSecurityGroupOwnerId = $SourceSecurityGroupOwnerId
  }
  if ($ToPort) {
    $rProperties.ToPort = $ToPort
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-SecurityGroupIngress -Value Add-CfnEC2_SecurityGroupIngressResource

function Add-CfnEC2_SpotFleetResource {
<#
.SYNOPSIS
The AWS::EC2::SpotFleet resource creates a request for a collection of Spot instances.
.PARAMETER SpotFleetRequestConfigData
The configuration for a Spot fleet request.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::SpotFleet
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$SpotFleetRequestConfigData, # description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::SpotFleet" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($SpotFleetRequestConfigData) {
    $rProperties.SpotFleetRequestConfigData = $SpotFleetRequestConfigData
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-SpotFleet -Value Add-CfnEC2_SpotFleetResource

function Add-CfnEC2_SubnetResource {
<#
.SYNOPSIS
Creates a subnet in an existing VPC.
.PARAMETER AvailabilityZone
The availability zone you want the subnet in. Default: AWS selects a zone for you (recommended).
.PARAMETER CidrBlock
The CIDR block you want the subnet to cover (for example, "10.0.0.0/24").
.PARAMETER MapPublicIpOnLaunch
Indicates whether instances that are launched in this subnet receive a public IP address. By default, the value is false.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER VpcId
A Ref structure containing the ID of the VPC where you want to create the subnet. The VPC ID is provided as the value of the "Ref" property, as: { "Ref": "VPCID" }.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::Subnet
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$AvailabilityZone, # description required type

    [string]$CidrBlock, # description required type

    [bool]$MapPublicIpOnLaunch, # description required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [string]$VpcId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::Subnet" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AvailabilityZone) {
    $rProperties.AvailabilityZone = $AvailabilityZone
  }
  if ($CidrBlock) {
    $rProperties.CidrBlock = $CidrBlock
  }
  if ($MapPublicIpOnLaunch) {
    $rProperties.MapPublicIpOnLaunch = $MapPublicIpOnLaunch
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  if ($VpcId) {
    $rProperties.VpcId = $VpcId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-Subnet -Value Add-CfnEC2_SubnetResource

function Add-CfnEC2_SubnetNetworkAclAssociationResource {
<#
.SYNOPSIS
Associates a subnet with a network ACL.
.PARAMETER NetworkAclId
The ID of the new ACL to associate with the subnet.
.PARAMETER SubnetId
The ID representing the current association between the original network ACL and the subnet.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::SubnetNetworkAclAssociation
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$NetworkAclId, # description required resource-ref-type type

    [string]$SubnetId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::SubnetNetworkAclAssociation" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($NetworkAclId) {
    $rProperties.NetworkAclId = $NetworkAclId
  }
  if ($SubnetId) {
    $rProperties.SubnetId = $SubnetId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-SubnetNetworkAclAssociation -Value Add-CfnEC2_SubnetNetworkAclAssociationResource

function Add-CfnEC2_SubnetRouteTableAssociationResource {
<#
.SYNOPSIS
Associates a subnet with a route table.
.PARAMETER RouteTableId
The ID of the route table. This is commonly written as a reference to a route table declared elsewhere in the template. For example:
.PARAMETER SubnetId
The ID of the subnet. This is commonly written as a reference to a subnet declared elsewhere in the template.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::SubnetRouteTableAssociation
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$RouteTableId, # description required resource-ref-type type

    [string]$SubnetId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::SubnetRouteTableAssociation" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($RouteTableId) {
    $rProperties.RouteTableId = $RouteTableId
  }
  if ($SubnetId) {
    $rProperties.SubnetId = $SubnetId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-SubnetRouteTableAssociation -Value Add-CfnEC2_SubnetRouteTableAssociationResource

function Add-CfnEC2_VolumeResource {
<#
.SYNOPSIS
The AWS::EC2::Volume type creates a new Elastic Block Store volume. You can set a deletion policy for your volume to control how AWS CloudFormation handles the volume when the stack is deleted. For Elastic Block Store volumes, you can choose to retain the volume, to delete the volume, or to create a snapshot of the volume.
.PARAMETER AutoEnableIO
Indicates whether the volume is auto-enabled for I/O operations.
.PARAMETER AvailabilityZone
The Availability Zone in which to create the new volume.
.PARAMETER Encrypted
Indicates whether the volume is encrypted. Encrypted Amazon EBS volumes can only be attached to instance types that support Amazon EBS encryption.
.PARAMETER Iops
The number of I/O operations per second (IOPS) that the volume supports. This can be any value from 1-1000. Required: Conditional. Required when the volume type is "io1"; not used with standard volumes.
.PARAMETER KmsKeyId
The Amazon Resource Name (ARN) of the AWS Key Management Service master key that is used to create the encrypted volume.
.PARAMETER Size
The size of the volume, in gibibytes (GiBs). This can be any value from 1�1024. Required: Conditional. Required if you are not creating a volume from a snapshot. If you specify Size, do not specify SnapshotId.
.PARAMETER SnapshotId
The snapshot from which to create the new volume. Required: Conditional. Required if you are creating a volume from a snapshot. If you do not specify a value for SnapshotId, you should specify a value for Size.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER VolumeType
The volume type. This can be either "standard" or "io1". If no value is specified, "standard" will be used.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::Volume
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [bool]$AutoEnableIO, # description required type

    [ValidateSet('us-east-1a','us-east-1b','us-east-1c','us-east-1d','us-east-1e','us-west-1a','us-west-1b','us-west-1c','us-west-2a','us-west-2b','us-west-2c','eu-west-1a','eu-west-1b','eu-west-1c','ap-northeast-1a','ap-northeast-1b','ap-northeast-1c','ap-southeast-1a','ap-southeast-1b','ap-southeast-2a','ap-southeast-2b','sa-east-1a','sa-east-1b')]
    [string]$AvailabilityZone, # allowed-values description required type

    [bool]$Encrypted, # description required type

    [int]$Iops, # description required type

    [string]$KmsKeyId, # description required type

    [string]$Size, # description required type

    [string]$SnapshotId, # description required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [ValidateSet('standard','io1','gp2')]
    [string]$VolumeType, # allowed-values description required type

    [ValidateSet('Delete','Retain','Snapshot')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::Volume" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AutoEnableIO) {
    $rProperties.AutoEnableIO = $AutoEnableIO
  }
  if ($AvailabilityZone) {
    $rProperties.AvailabilityZone = $AvailabilityZone
  }
  if ($Encrypted) {
    $rProperties.Encrypted = $Encrypted
  }
  if ($Iops) {
    $rProperties.Iops = $Iops
  }
  if ($KmsKeyId) {
    $rProperties.KmsKeyId = $KmsKeyId
  }
  if ($Size) {
    $rProperties.Size = $Size
  }
  if ($SnapshotId) {
    $rProperties.SnapshotId = $SnapshotId
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  if ($VolumeType) {
    $rProperties.VolumeType = $VolumeType
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-Volume -Value Add-CfnEC2_VolumeResource

function Add-CfnEC2_VolumeAttachmentResource {
<#
.SYNOPSIS
Attaches a volume to an EC2 instance.
.PARAMETER Device
How the device is exposed to the instance (e.g., /dev/sdh, or xvdh).
.PARAMETER InstanceId
The ID of the instance to which the volume attaches. This value can be a reference to an AWS::EC2::Instance resource, or it can be the instance ID of an existing EC2 instance.
.PARAMETER VolumeId
The ID of the Amazon EBS volume. The volume and instance must be within the same Availability Zone. This value can be a reference to an AWS::EC2::Volume resource, or it can be the volume ID of an existing Amazon EBS volume.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::VolumeAttachment
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Device, # description required type

    [string]$InstanceId, # description required resource-ref-type type

    [string]$VolumeId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::VolumeAttachment" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Device) {
    $rProperties.Device = $Device
  }
  if ($InstanceId) {
    $rProperties.InstanceId = $InstanceId
  }
  if ($VolumeId) {
    $rProperties.VolumeId = $VolumeId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-VolumeAttachment -Value Add-CfnEC2_VolumeAttachmentResource

function Add-CfnEC2_VPCResource {
<#
.SYNOPSIS
Creates a Virtual Private Cloud (VPC) with the CIDR block that you specify.
.PARAMETER CidrBlock
The CIDR block you want the VPC to cover. For example: "10.0.0.0/16".
.PARAMETER EnableDnsHostnames
Specifies whether the instances launched in the VPC get DNS hostnames. If this attribute is true, instances in the VPC get DNS hostnames; otherwise, they do not. You can only set EnableDnsHostnames to true if you also set the EnableDnsSupport attribute to true. By default, the value is set to false.
.PARAMETER EnableDnsSupport
Specifies whether DNS resolution is supported for the VPC. If this attribute is true, the Amazon DNS server resolves DNS hostnames for your instances to their corresponding IP addresses; otherwise, it does not. By default the value is set to true.
.PARAMETER InstanceTenancy
The allowed tenancy of instances launched into the VPC. A value of "default" means instances can be launched with any tenancy; a value of "dedicated" means instances must be launched with tenancy as dedicated.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::VPC
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$CidrBlock, # description required type

    [bool]$EnableDnsHostnames, # description required type

    [bool]$EnableDnsSupport, # description required type

    [ValidateSet('default','dedicated')]
    [int]$InstanceTenancy, # allowed-values description required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::VPC" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($CidrBlock) {
    $rProperties.CidrBlock = $CidrBlock
  }
  if ($EnableDnsHostnames) {
    $rProperties.EnableDnsHostnames = $EnableDnsHostnames
  }
  if ($EnableDnsSupport) {
    $rProperties.EnableDnsSupport = $EnableDnsSupport
  }
  if ($InstanceTenancy) {
    $rProperties.InstanceTenancy = $InstanceTenancy
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-VPC -Value Add-CfnEC2_VPCResource

function Add-CfnEC2_VPCDHCPOptionsAssociationResource {
<#
.SYNOPSIS
Associates a set of DHCP options (that you've previously created) with the specified VPC.
.PARAMETER DhcpOptionsId
The ID of the DHCP options you want to associate with the VPC, or "default" if you want the VPC to use no DHCP options.
.PARAMETER VpcId
The ID of the VPC to associate with this DHCP options set.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::VPCDHCPOptionsAssociation
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$DhcpOptionsId, # description required resource-ref-type type

    [string]$VpcId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::VPCDHCPOptionsAssociation" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($DhcpOptionsId) {
    $rProperties.DhcpOptionsId = $DhcpOptionsId
  }
  if ($VpcId) {
    $rProperties.VpcId = $VpcId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-VPCDHCPOptionsAssociation -Value Add-CfnEC2_VPCDHCPOptionsAssociationResource

function Add-CfnEC2_VPCEndpointResource {
<#
.SYNOPSIS
Creates a VPC endpoint that you can use to establish a private connection between your VPC and another AWS service without requiring access over the Internet, a VPN connection, or AWS Direct Connect.
.PARAMETER PolicyDocument
A policy to attach to the endpoint that controls access to the service.
.PARAMETER RouteTableIds
One or more route table IDs that are used by the VPC to reach the endpoint.
.PARAMETER ServiceName
The AWS service to which you want to establish a connection. Specify the service name in the form of com.amazonaws.region.service.
.PARAMETER VpcId
The ID of the VPC in which the endpoint is used.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::VPCEndpoint
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [object]$PolicyDocument, # description required type

    [string[]]$RouteTableIds, #[array][string] array-type description required type

    [string]$ServiceName, # description required type

    [string]$VpcId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::VPCEndpoint" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($PolicyDocument) {
    $rProperties.PolicyDocument = $PolicyDocument
  }
  if ($RouteTableIds) {
    $rProperties.RouteTableIds = $RouteTableIds
  }
  if ($ServiceName) {
    $rProperties.ServiceName = $ServiceName
  }
  if ($VpcId) {
    $rProperties.VpcId = $VpcId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-VPCEndpoint -Value Add-CfnEC2_VPCEndpointResource

function Add-CfnEC2_VPCGatewayAttachmentResource {
<#
.SYNOPSIS
Attaches a gateway to a VPC.
.PARAMETER InternetGatewayId
The ID of the Internet gateway. Required: Conditional. You must specify either InternetGatewayId or VpnGatewayId, but not both.
.PARAMETER VpcId
The ID of the VPC to associate with this gateway.
.PARAMETER VpnGatewayId
The ID of the virtual private network (VPN) gateway to attach to the VPC. Required: Conditional. You must specify either InternetGatewayId or VpnGatewayId, but not both.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::VPCGatewayAttachment
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$InternetGatewayId, # description required resource-ref-type type

    [string]$VpcId, # description required resource-ref-type type

    [string]$VpnGatewayId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::VPCGatewayAttachment" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($InternetGatewayId) {
    $rProperties.InternetGatewayId = $InternetGatewayId
  }
  if ($VpcId) {
    $rProperties.VpcId = $VpcId
  }
  if ($VpnGatewayId) {
    $rProperties.VpnGatewayId = $VpnGatewayId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-VPCGatewayAttachment -Value Add-CfnEC2_VPCGatewayAttachmentResource

function Add-CfnEC2_VPCPeeringConnectionResource {
<#
.SYNOPSIS
A VPC peering connection enables a network connection between two virtual private clouds (VPCs) so that you can route traffic between them by means of a private IP addresses.
.PARAMETER PeerVpcId
The ID of the VPC with which you are creating the peering connection.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER VpcId
The ID of the VPC that is requesting a peering connection.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::VPCPeeringConnection
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$PeerVpcId, # description required resource-ref-type type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [string]$VpcId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::VPCPeeringConnection" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($PeerVpcId) {
    $rProperties.PeerVpcId = $PeerVpcId
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  if ($VpcId) {
    $rProperties.VpcId = $VpcId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-VPCPeeringConnection -Value Add-CfnEC2_VPCPeeringConnectionResource

function Add-CfnEC2_VPNConnectionResource {
<#
.SYNOPSIS
Creates a new VPN connection between an existing virtual private gateway and a VPN customer gateway.
.PARAMETER CustomerGatewayId
The ID of the customer gateway. This can either be an embedded JSON object or a reference to a Gateway ID.
.PARAMETER StaticRoutesOnly
Indicates whether the VPN connection requires static routes.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER Type
The type of VPN connection this virtual private gateway supports. Example: "ipsec.1"
.PARAMETER VpnGatewayId
The ID of the virtual private gateway. This can either be an embedded JSON object or a reference to a Gateway ID.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::VPNConnection
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$CustomerGatewayId, # description required resource-ref-type type

    [bool]$StaticRoutesOnly, # description required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [string]$Type, # description required type

    [string]$VpnGatewayId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::VPNConnection" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($CustomerGatewayId) {
    $rProperties.CustomerGatewayId = $CustomerGatewayId
  }
  if ($StaticRoutesOnly) {
    $rProperties.StaticRoutesOnly = $StaticRoutesOnly
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  if ($Type) {
    $rProperties.Type = $Type
  }
  if ($VpnGatewayId) {
    $rProperties.VpnGatewayId = $VpnGatewayId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-VPNConnection -Value Add-CfnEC2_VPNConnectionResource

function Add-CfnEC2_VPNConnectionRouteResource {
<#
.SYNOPSIS
A static route that is associated with a VPN connection between an existing virtual private gateway and a VPN customer gateway. The static route allows traffic to be routed from the virtual private gateway to the VPN customer gateway.
.PARAMETER DestinationCidrBlock
The CIDR block that is associated with the local subnet of the customer network.
.PARAMETER VpnConnectionId
The ID of the VPN connection.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::VPNConnectionRoute
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$DestinationCidrBlock, # description required type

    [string]$VpnConnectionId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::VPNConnectionRoute" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($DestinationCidrBlock) {
    $rProperties.DestinationCidrBlock = $DestinationCidrBlock
  }
  if ($VpnConnectionId) {
    $rProperties.VpnConnectionId = $VpnConnectionId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-VPNConnectionRoute -Value Add-CfnEC2_VPNConnectionRouteResource

function Add-CfnEC2_VPNGatewayResource {
<#
.SYNOPSIS
Creates a new virtual private gateway. A virtual private gateway is the VPC-side endpoint for your VPN connection.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER Type
The type of VPN connection this customer gateway supports. For example: ipsec.1
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::VPNGateway
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [ValidateSet('ipsec.1')]
    [string]$Type, # allowed-values description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::VPNGateway" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  if ($Type) {
    $rProperties.Type = $Type
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-VPNGateway -Value Add-CfnEC2_VPNGatewayResource

function Add-CfnEC2_VPNGatewayRoutePropagationResource {
<#
.SYNOPSIS
Enables a virtual private gateway (VGW) to propagate routes to the routing tables of a VPC.
.PARAMETER RouteTableIds
A list of routing table IDs that are associated with a VPC. The routing tables must be associated with the same VPC that the virtual private gateway is attached to.
.PARAMETER VpnGatewayId
The ID of the virtual private gateway that is attached to a VPC. The virtual private gateway must be attached to the same VPC that the routing tables are associated with.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EC2::VPNGatewayRoutePropagation
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary[]]$RouteTableIds, #[array][System.Collections.IDictionary] array-type description required resource-ref-type type

    [string]$VpnGatewayId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EC2::VPNGatewayRoutePropagation" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($RouteTableIds) {
    $rProperties.RouteTableIds = $RouteTableIds
  }
  if ($VpnGatewayId) {
    $rProperties.VpnGatewayId = $VpnGatewayId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EC2-VPNGatewayRoutePropagation -Value Add-CfnEC2_VPNGatewayRoutePropagationResource

function Add-CfnECR_RepositoryResource {
<#
.SYNOPSIS
The AWS::ECR::Repository resource creates an Amazon EC2 Container Registry (Amazon ECR) repository, where users can push and pull Docker images.
.PARAMETER RepositoryName
A name for the image repository.
.PARAMETER RepositoryPolicyText
A policy that controls who has access to the repository and which actions they can perform on it.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::ECR::Repository
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$RepositoryName, # description required type

    [object]$RepositoryPolicyText, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::ECR::Repository" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($RepositoryName) {
    $rProperties.RepositoryName = $RepositoryName
  }
  if ($RepositoryPolicyText) {
    $rProperties.RepositoryPolicyText = $RepositoryPolicyText
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-ECR-Repository -Value Add-CfnECR_RepositoryResource

function Add-CfnECS_ClusterResource {
<#
.SYNOPSIS
The AWS::ECS::Cluster resource creates an Amazon EC2 Container Service (Amazon ECS) cluster.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::ECS::Cluster
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::ECS::Cluster" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-ECS-Cluster -Value Add-CfnECS_ClusterResource

function Add-CfnECS_ServiceResource {
<#
.SYNOPSIS
The AWS::ECS::Service resource creates an Amazon EC2 Container Service (Amazon ECS) service that runs and maintains the desired number of tasks and associated load balancers.
.PARAMETER Cluster
The name or Amazon Resource Name (ARN) of the cluster that you want to run your service on. If you do not specify a cluster, Amazon ECS uses the default cluster.
.PARAMETER DesiredCount
The number of simultaneous tasks, which you specify by using the TaskDefinition property, that you want to run on the cluster.
.PARAMETER LoadBalancers
A list of load balancer objects to associate with the cluster.
.PARAMETER Role
The name or ARN of an AWS Identity and Access Management (IAM) role that allows your Amazon ECS container agent to make calls to your load balancer.
.PARAMETER TaskDefinition
The ARN of the task definition that you want to run on the cluster.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::ECS::Service
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Cluster, # description required resource-ref-type type

    [int]$DesiredCount, # description required type

    [System.Collections.IDictionary[]]$LoadBalancers, #[array][System.Collections.IDictionary] array-type description properties required type

    [string]$Role, # description required resource-ref-type type

    [string]$TaskDefinition, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::ECS::Service" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Cluster) {
    $rProperties.Cluster = $Cluster
  }
  if ($DesiredCount) {
    $rProperties.DesiredCount = $DesiredCount
  }
  if ($LoadBalancers) {
    $rProperties.LoadBalancers = $LoadBalancers
  }
  if ($Role) {
    $rProperties.Role = $Role
  }
  if ($TaskDefinition) {
    $rProperties.TaskDefinition = $TaskDefinition
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-ECS-Service -Value Add-CfnECS_ServiceResource

function Add-CfnECS_TaskDefinitionResource {
<#
.SYNOPSIS
The AWS::ECS::TaskDefinition resource describes the container and volume definitions of an Amazon EC2 Container Service (Amazon ECS) task.
.PARAMETER ContainerDefinitions
A list of container definitions in JSON format that describe the containers that make up your task.
.PARAMETER Volumes
A list of volume definitions in JSON format for volumes that you can use in your container definitions.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::ECS::TaskDefinition
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary[]]$ContainerDefinitions, #[array][System.Collections.IDictionary] array-type description properties required type

    [System.Collections.IDictionary[]]$Volumes, #[array][System.Collections.IDictionary] array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::ECS::TaskDefinition" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($ContainerDefinitions) {
    $rProperties.ContainerDefinitions = $ContainerDefinitions
  }
  if ($Volumes) {
    $rProperties.Volumes = $Volumes
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-ECS-TaskDefinition -Value Add-CfnECS_TaskDefinitionResource

function Add-CfnEFS_FileSystemResource {
<#
.SYNOPSIS
The AWS::EFS::FileSystem resource creates a new, empty file system in Amazon Elastic File System (Amazon EFS).
.PARAMETER FileSystemTags
The tags that you want to attach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EFS::FileSystem
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$FileSystemTags, # array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EFS::FileSystem" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($FileSystemTags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $FileSystemTags.Keys) {
      $t = @{ Key = $tk }
      $tv = $FileSystemTags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.FileSystemTags = $tagsList
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EFS-FileSystem -Value Add-CfnEFS_FileSystemResource

function Add-CfnEFS_MountTargetResource {
<#
.SYNOPSIS
The AWS::EFS::MountTarget resource creates a mount target for an Amazon Elastic File System (Amazon EFS) file system (AWS::EFS::FileSystem).
.PARAMETER FileSystemId
The ID of the file system for which you want to create the mount target.
.PARAMETER IpAddress
An IPv4 address that is within the address range of the subnet that is specified in the SubnetId property.
.PARAMETER SecurityGroups
A maximum of five VPC security group IDs that are in the same VPC as the subnet that is specified in the SubnetId property.
.PARAMETER SubnetId
The ID of the subnet in which you want to add the mount target.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EFS::MountTarget
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$FileSystemId, # description required resource-ref-type type

    [string]$IpAddress, # description required type

    [string[]]$SecurityGroups, #[array][string] array-type description required resource-ref-type type

    [string]$SubnetId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EFS::MountTarget" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($FileSystemId) {
    $rProperties.FileSystemId = $FileSystemId
  }
  if ($IpAddress) {
    $rProperties.IpAddress = $IpAddress
  }
  if ($SecurityGroups) {
    $rProperties.SecurityGroups = $SecurityGroups
  }
  if ($SubnetId) {
    $rProperties.SubnetId = $SubnetId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EFS-MountTarget -Value Add-CfnEFS_MountTargetResource

function Add-CfnElastiCache_CacheClusterResource {
<#
.SYNOPSIS
The AWS::ElastiCache::CacheCluster type creates an Amazon ElastiCache cache cluster.
.PARAMETER AutoMinorVersionUpgrade
Indicates that minor engine upgrades will be applied automatically to the cache cluster during the maintenance window.
.PARAMETER AZMode
For Memcached cache clusters, indicates whether the nodes are created in a single Availability Zone or across multiple Availability Zones in the cluster's region.
.PARAMETER CacheNodeType
The compute and memory capacity of nodes in a cache cluster.
.PARAMETER CacheParameterGroupName
The name of the cache parameter group associated with this cache cluster.
.PARAMETER CacheSecurityGroupNames
A list of cache security group names associated with this cache cluster.
.PARAMETER CacheSubnetGroupName
The cache subnet group that you associate with a cache cluster.
.PARAMETER ClusterName
A name for the cache cluster. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the cache cluster.
.PARAMETER Engine
The name of the cache engine to be used for this cache cluster.
.PARAMETER EngineVersion
The version of the cache engine to be used for this cluster.
.PARAMETER NotificationTopicArn
The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic to which notifications will be sent.
.PARAMETER NumCacheNodes
The number of cache nodes the cache cluster should have.
.PARAMETER Port
The port number on which each of the cache nodes will accept connections.
.PARAMETER PreferredAvailabilityZone
The EC2 Availability Zone that the cache cluster will be created in.
.PARAMETER PreferredMaintenanceWindow
The weekly time range (in UTC) during which system maintenance can occur. Example: sun:05:00-sun:09:00
.PARAMETER SnapshotArns
A single-element string list containing an Amazon Resource Name (ARN) that uniquely identifies a Redis RDB snapshot file stored in Amazon S3. The snapshot file will be used to populate the Redis cache in the new cache cluster. The Amazon S3 object name in the ARN cannot contain any commas.
.PARAMETER SnapshotName
The name of a snapshot from which to restore data into a new Redis cache cluster.
.PARAMETER VpcSecurityGroupIds
One or more VPC security groups associated with the cache cluster.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::ElastiCache::CacheCluster
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [bool]$AutoMinorVersionUpgrade, # description required type

    [string]$AZMode, # description required type

    [ValidateSet('*','cache.t1.micro','cache.m1.medium','cache.m1.large','cache.m1.xlarge','cache.m3.medium','cache.m3.large','cache.m3.xlarge','cache.m3.2xlarge','cache.m1.small','cache.m1.large','cache.m1.xlarge','cache.m2.xlarge','cache.m2.2xlarge','cache.m2.4xlarge','cache.c1.xlarge','cache.r3.large','cache.r3.xlarge','cache.r3.2xlarge','cache.r3.4xlarge','cache.r3.8xlarge')]
    [string]$CacheNodeType, # allowed-values description required type

    [string]$CacheParameterGroupName, # description required resource-ref-type type

    [string[]]$CacheSecurityGroupNames, #[array][string] array-type description required resource-ref-type type

    [string]$CacheSubnetGroupName, # description required resource-ref-type type

    [string]$ClusterName, # description required type

    [ValidateSet('memcached','redis')]
    [string]$Engine, # allowed-values description required type

    [string]$EngineVersion, # description required type

    [string]$NotificationTopicArn, # description required resource-ref-type type

    [string]$NumCacheNodes, # description required type

    [int]$Port, # description required type

    [ValidateSet('us-east-1a','us-east-1b','us-east-1c','us-east-1d','us-east-1e','us-west-1a','us-west-1b','us-west-1c','us-west-2a','us-west-2b','us-west-2c','eu-west-1a','eu-west-1b','eu-west-1c','ap-northeast-1a','ap-northeast-1b','ap-northeast-1c','ap-southeast-1a','ap-southeast-1b','ap-southeast-2a','ap-southeast-2b','sa-east-1a','sa-east-1b')]
    [string]$PreferredAvailabilityZone, # allowed-values description required type

    [string]$PreferredMaintenanceWindow, # description required type

    [string[]]$SnapshotArns, #[array][string] array-type description required type

    [string]$SnapshotName, # description required type

    [string[]]$VpcSecurityGroupIds, #[array][string] array-type description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::ElastiCache::CacheCluster" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AutoMinorVersionUpgrade) {
    $rProperties.AutoMinorVersionUpgrade = $AutoMinorVersionUpgrade
  }
  if ($AZMode) {
    $rProperties.AZMode = $AZMode
  }
  if ($CacheNodeType) {
    $rProperties.CacheNodeType = $CacheNodeType
  }
  if ($CacheParameterGroupName) {
    $rProperties.CacheParameterGroupName = $CacheParameterGroupName
  }
  if ($CacheSecurityGroupNames) {
    $rProperties.CacheSecurityGroupNames = $CacheSecurityGroupNames
  }
  if ($CacheSubnetGroupName) {
    $rProperties.CacheSubnetGroupName = $CacheSubnetGroupName
  }
  if ($ClusterName) {
    $rProperties.ClusterName = $ClusterName
  }
  if ($Engine) {
    $rProperties.Engine = $Engine
  }
  if ($EngineVersion) {
    $rProperties.EngineVersion = $EngineVersion
  }
  if ($NotificationTopicArn) {
    $rProperties.NotificationTopicArn = $NotificationTopicArn
  }
  if ($NumCacheNodes) {
    $rProperties.NumCacheNodes = $NumCacheNodes
  }
  if ($Port) {
    $rProperties.Port = $Port
  }
  if ($PreferredAvailabilityZone) {
    $rProperties.PreferredAvailabilityZone = $PreferredAvailabilityZone
  }
  if ($PreferredMaintenanceWindow) {
    $rProperties.PreferredMaintenanceWindow = $PreferredMaintenanceWindow
  }
  if ($SnapshotArns) {
    $rProperties.SnapshotArns = $SnapshotArns
  }
  if ($SnapshotName) {
    $rProperties.SnapshotName = $SnapshotName
  }
  if ($VpcSecurityGroupIds) {
    $rProperties.VpcSecurityGroupIds = $VpcSecurityGroupIds
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-ElastiCache-CacheCluster -Value Add-CfnElastiCache_CacheClusterResource

function Add-CfnElastiCache_ParameterGroupResource {
<#
.SYNOPSIS
The AWS::ElastiCache::ParameterGroup type creates a new cache parameter group. Cache parameter groups control the parameters for a cache cluster.
.PARAMETER CacheParameterGroupFamily
The name of the cache parameter group family that the cache parameter group can be used with.
.PARAMETER Description
The description for the Cache Parameter Group.
.PARAMETER Properties
A comma-delimited list of parameter name/value pairs.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::ElastiCache::ParameterGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$CacheParameterGroupFamily, # description required type

    [string]$Description, # description required type

    [string]$Properties, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::ElastiCache::ParameterGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($CacheParameterGroupFamily) {
    $rProperties.CacheParameterGroupFamily = $CacheParameterGroupFamily
  }
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($Properties) {
    $rProperties.Properties = $Properties
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-ElastiCache-ParameterGroup -Value Add-CfnElastiCache_ParameterGroupResource

function Add-CfnElastiCache_ReplicationGroupResource {
<#
.SYNOPSIS
The AWS::ElastiCache::ReplicationGroup resource creates an Amazon ElastiCache replication group.
.PARAMETER AutomaticFailoverEnabled
Indicates whether Multi-AZ is enabled.
.PARAMETER AutoMinorVersionUpgrade
Currently, this property isn't used by ElastiCache.
.PARAMETER CacheNodeType
The compute and memory capacity of nodes in the node group.
.PARAMETER CacheParameterGroupName
The name of the parameter group to associate with this replication group.
.PARAMETER CacheSecurityGroupNames
A list of cache security group names to associate with this replication group.
.PARAMETER CacheSubnetGroupName
The name of a cache subnet group to use for this replication group.
.PARAMETER Engine
The name of the cache engine to use for the cache clusters in this replication group.
.PARAMETER EngineVersion
The version number of the cache engine to use for the cache clusters in this replication group.
.PARAMETER NotificationTopicArn
The Amazon Resource Name (ARN) of the Amazon Simple Notification Service (SNS) topic to which notifications will be sent.
.PARAMETER NumCacheClusters
The number of cache clusters this replication group will initially have. If Multi-AZ is enabled, the value of this parameter must be at least 2.
.PARAMETER Port
The port number on which each member of the replication group accepts connections.
.PARAMETER PreferredCacheClusterAZs
A list of Availability Zones (AZs) in which the cache clusters in this replication group are created.
.PARAMETER PreferredMaintenanceWindow
The weekly time range during which system maintenance can occur. Use the following format to specify a time range: ddd:hh24:mi-ddd:hh24:mi (24H Clock UTC). For example, you can specify sun:22:00-sun:23:30 for Sunday from 10 PM to 11:30 PM.
.PARAMETER ReplicationGroupDescription
The description of the replication group.
.PARAMETER SecurityGroupIds
A list of Amazon Virtual Private Cloud (Amazon VPC) security groups to associate with this replication group. Use this property only when you are creating a replication group in a VPC. If you specify the CacheSecurityGroupNames property, do not specify this property; you can specify only one.
.PARAMETER SnapshotArns
A single-element string list that specifies an ARN of a Redis .rdb snapshot file that is stored in Amazon Simple Storage Service (Amazon S3). The snapshot file populates the node group. The Amazon S3 object name in the ARN cannot contain commas. For example, you can specify arn:aws:s3:::my_bucket/snapshot1.rdb.
.PARAMETER SnapshotRetentionLimit
The number of days that ElastiCache retains automatic snapshots before deleting them.
.PARAMETER SnapshotWindow
The time range (in UTC) when ElastiCache takes a daily snapshot of your node group. For example, you can specify 05:00-09:00.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::ElastiCache::ReplicationGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [bool]$AutomaticFailoverEnabled, # description required type

    [bool]$AutoMinorVersionUpgrade, # description required type

    [ValidateSet('*','cache.t2.micro','cache.t2.small','cache.t2.medium','cache.m3.medium','cache.m3.large','cache.m3.xlarge','cache.m3.2xlarge','cache.t1.micro','cache.m1.small','cache.m1.medium','cache.m1.large','cache.m1.xlarge','cache.c1.xlarge','cache.r3.large','cache.r3.xlarge','cache.r3.2xlarge','cache.r3.4xlarge','cache.r3.8xlarge','cache.m2.xlarge','cache.m2.2xlarge','cache.m2.4xlarge')]
    [string]$CacheNodeType, # allowed-values description required type

    [string]$CacheParameterGroupName, # description required resource-ref-type type

    [string[]]$CacheSecurityGroupNames, #[array][string] array-type description required resource-ref-type type

    [string]$CacheSubnetGroupName, # description required resource-ref-type type

    [ValidateSet('*','redis')]
    [string]$Engine, # allowed-values description required type

    [string]$EngineVersion, # description required type

    [string]$NotificationTopicArn, # description required resource-ref-type type

    [int]$NumCacheClusters, # description required type

    [int]$Port, # description required type

    [ValidateSet('us-east-1a','us-east-1b','us-east-1c','us-east-1d','us-east-1e','us-west-1a','us-west-1b','us-west-1c','us-west-2a','us-west-2b','us-west-2c','eu-west-1a','eu-west-1b','eu-west-1c','ap-northeast-1a','ap-northeast-1b','ap-northeast-1c','ap-southeast-1a','ap-southeast-1b','ap-southeast-2a','ap-southeast-2b','sa-east-1a','sa-east-1b')]
    [string[]]$PreferredCacheClusterAZs, #[array][string] allowed-values array-type description required type

    [string]$PreferredMaintenanceWindow, # description required type

    [string]$ReplicationGroupDescription, # description required type

    [string[]]$SecurityGroupIds, #[array][string] array-type description required resource-ref-type type

    [string[]]$SnapshotArns, #[array][string] array-type description required type

    [int]$SnapshotRetentionLimit, # description required type

    [string]$SnapshotWindow, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::ElastiCache::ReplicationGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AutomaticFailoverEnabled) {
    $rProperties.AutomaticFailoverEnabled = $AutomaticFailoverEnabled
  }
  if ($AutoMinorVersionUpgrade) {
    $rProperties.AutoMinorVersionUpgrade = $AutoMinorVersionUpgrade
  }
  if ($CacheNodeType) {
    $rProperties.CacheNodeType = $CacheNodeType
  }
  if ($CacheParameterGroupName) {
    $rProperties.CacheParameterGroupName = $CacheParameterGroupName
  }
  if ($CacheSecurityGroupNames) {
    $rProperties.CacheSecurityGroupNames = $CacheSecurityGroupNames
  }
  if ($CacheSubnetGroupName) {
    $rProperties.CacheSubnetGroupName = $CacheSubnetGroupName
  }
  if ($Engine) {
    $rProperties.Engine = $Engine
  }
  if ($EngineVersion) {
    $rProperties.EngineVersion = $EngineVersion
  }
  if ($NotificationTopicArn) {
    $rProperties.NotificationTopicArn = $NotificationTopicArn
  }
  if ($NumCacheClusters) {
    $rProperties.NumCacheClusters = $NumCacheClusters
  }
  if ($Port) {
    $rProperties.Port = $Port
  }
  if ($PreferredCacheClusterAZs) {
    $rProperties.PreferredCacheClusterAZs = $PreferredCacheClusterAZs
  }
  if ($PreferredMaintenanceWindow) {
    $rProperties.PreferredMaintenanceWindow = $PreferredMaintenanceWindow
  }
  if ($ReplicationGroupDescription) {
    $rProperties.ReplicationGroupDescription = $ReplicationGroupDescription
  }
  if ($SecurityGroupIds) {
    $rProperties.SecurityGroupIds = $SecurityGroupIds
  }
  if ($SnapshotArns) {
    $rProperties.SnapshotArns = $SnapshotArns
  }
  if ($SnapshotRetentionLimit) {
    $rProperties.SnapshotRetentionLimit = $SnapshotRetentionLimit
  }
  if ($SnapshotWindow) {
    $rProperties.SnapshotWindow = $SnapshotWindow
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-ElastiCache-ReplicationGroup -Value Add-CfnElastiCache_ReplicationGroupResource

function Add-CfnElastiCache_SecurityGroupResource {
<#
.SYNOPSIS
The AWS::ElastiCache::SecurityGroup type creates a cache security group.
.PARAMETER Description
The description property of the new cache security group.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::ElastiCache::SecurityGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Description, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::ElastiCache::SecurityGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Description) {
    $rProperties.Description = $Description
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-ElastiCache-SecurityGroup -Value Add-CfnElastiCache_SecurityGroupResource

function Add-CfnElastiCache_SecurityGroupIngressResource {
<#
.SYNOPSIS
The AWS::ElastiCache::SecurityGroupIngress type authorizes ingress to a cache security group from hosts in specified EC2 security groups.
.PARAMETER CacheSecurityGroupName
The name of the Cache Security Group to authorize.
.PARAMETER EC2SecurityGroupName
Name of the EC2 Security Group to include in the authorization.
.PARAMETER EC2SecurityGroupOwnerId
Specifies the AWS Account ID of the owner of the EC2 security group specified in the EC2SecurityGroupName property. The AWS Access Key ID is not an acceptable value.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::ElastiCache::SecurityGroupIngress
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$CacheSecurityGroupName, # description required resource-ref-type type

    [string]$EC2SecurityGroupName, # description required resource-ref-type type

    [string]$EC2SecurityGroupOwnerId, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::ElastiCache::SecurityGroupIngress" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($CacheSecurityGroupName) {
    $rProperties.CacheSecurityGroupName = $CacheSecurityGroupName
  }
  if ($EC2SecurityGroupName) {
    $rProperties.EC2SecurityGroupName = $EC2SecurityGroupName
  }
  if ($EC2SecurityGroupOwnerId) {
    $rProperties.EC2SecurityGroupOwnerId = $EC2SecurityGroupOwnerId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-ElastiCache-SecurityGroupIngress -Value Add-CfnElastiCache_SecurityGroupIngressResource

function Add-CfnElastiCache_SubnetGroupResource {
<#
.SYNOPSIS
Creates a cache subnet group.
.PARAMETER Description
The description for the cache subnet group.
.PARAMETER SubnetIds
The Amazon EC2 subnet IDs for the cache subnet group.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::ElastiCache::SubnetGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Description, # description required type

    [string]$SubnetIds, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::ElastiCache::SubnetGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($SubnetIds) {
    $rProperties.SubnetIds = $SubnetIds
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-ElastiCache-SubnetGroup -Value Add-CfnElastiCache_SubnetGroupResource

function Add-CfnElasticBeanstalk_ApplicationResource {
<#
.SYNOPSIS
Creates an application within AWS Elastic Beanstalk.
.PARAMETER ApplicationName
A name for the AWS Elastic Beanstalk application. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the application name.
.PARAMETER ApplicationVersions
Application versions associated with this application. An application version is a specific, labeled iteration of deployable code.
.PARAMETER ConfigurationTemplates
Configuration templates associated with this application. You can use templates to deploy different versions of an application using the configuration settings defined in the template.
.PARAMETER Description
Describes the application.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::ElasticBeanstalk::Application
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$ApplicationName, # description required type

    [System.Collections.IDictionary[]]$ApplicationVersions, #[array][System.Collections.IDictionary] array-type description properties required type

    [System.Collections.IDictionary[]]$ConfigurationTemplates, #[array][System.Collections.IDictionary] array-type description properties required type

    [string]$Description, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::ElasticBeanstalk::Application" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($ApplicationName) {
    $rProperties.ApplicationName = $ApplicationName
  }
  if ($ApplicationVersions) {
    $rProperties.ApplicationVersions = $ApplicationVersions
  }
  if ($ConfigurationTemplates) {
    $rProperties.ConfigurationTemplates = $ConfigurationTemplates
  }
  if ($Description) {
    $rProperties.Description = $Description
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-ElasticBeanstalk-Application -Value Add-CfnElasticBeanstalk_ApplicationResource

function Add-CfnElasticBeanstalk_ApplicationVersionResource {
<#
.SYNOPSIS
Creates an application version, an iteration of deployable code, for an Elastic Beanstalk application.
.PARAMETER ApplicationName
Name of the Elastic Beanstalk application that is associated with this application version.
.PARAMETER Description
A description of this application version.
.PARAMETER SourceBundle
The location where the source bundle is located for this version.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::ElasticBeanstalk::ApplicationVersion
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$ApplicationName, # description required resource-ref-type type

    [string]$Description, # description required type

    [System.Collections.IDictionary]$SourceBundle, # description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::ElasticBeanstalk::ApplicationVersion" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($ApplicationName) {
    $rProperties.ApplicationName = $ApplicationName
  }
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($SourceBundle) {
    $rProperties.SourceBundle = $SourceBundle
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-ElasticBeanstalk-ApplicationVersion -Value Add-CfnElasticBeanstalk_ApplicationVersionResource

function Add-CfnElasticBeanstalk_ConfigurationTemplateResource {
<#
.SYNOPSIS
Creates a configuration template for an Elastic Beanstalk application.
.PARAMETER ApplicationName
Name of the Elastic Beanstalk application that is associated with this configuration template.
.PARAMETER Description
An optional description for this configuration.
.PARAMETER EnvironmentId
An environment whose settings you want to use to create the configuration template.
.PARAMETER OptionSettings
An array of OptionSettings for this Elastic Beanstalk configuration.
.PARAMETER SolutionStackName
The name of an existing Elastic Beanstalk solution stack used by this configuration. A solution stack specifies the operating system, architecture, and application server for a configuration template. It also defines configuration options, their possible and default values. If SolutionStackName is not specified, the default Elastic Beanstalk solution stack will be used.
.PARAMETER SourceConfiguration
A configuration template that is associated with another Elastic Beanstalk application.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::ElasticBeanstalk::ConfigurationTemplate
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$ApplicationName, # description required resource-ref-type type

    [string]$Description, # description required type

    [string]$EnvironmentId, # description required type

    [System.Collections.IDictionary[]]$OptionSettings, #[array][System.Collections.IDictionary] array-type description properties required type

    [string]$SolutionStackName, # description required type

    [System.Collections.IDictionary]$SourceConfiguration, # description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::ElasticBeanstalk::ConfigurationTemplate" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($ApplicationName) {
    $rProperties.ApplicationName = $ApplicationName
  }
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($EnvironmentId) {
    $rProperties.EnvironmentId = $EnvironmentId
  }
  if ($OptionSettings) {
    $rProperties.OptionSettings = $OptionSettings
  }
  if ($SolutionStackName) {
    $rProperties.SolutionStackName = $SolutionStackName
  }
  if ($SourceConfiguration) {
    $rProperties.SourceConfiguration = $SourceConfiguration
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-ElasticBeanstalk-ConfigurationTemplate -Value Add-CfnElasticBeanstalk_ConfigurationTemplateResource

function Add-CfnElasticBeanstalk_EnvironmentResource {
<#
.SYNOPSIS
Creates an environment within AWS Elastic Beanstalk.
.PARAMETER ApplicationName
The name of the application associated with this environment.
.PARAMETER CNAMEPrefix
The URL to the CNAME for this environment.
.PARAMETER Description
Describes the environment.
.PARAMETER EnvironmentName
A name for the AWS Elastic Beanstalk environment. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the environment name.
.PARAMETER OptionSettings
The option settings to add.
.PARAMETER OptionsToRemove
The option settings to remove.
.PARAMETER SolutionStackName
Stack name associated with the environment.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER TemplateName
Name of the template to use with the environment.
.PARAMETER Tier
Specifies the tier to use in creating this environment. The environment tier that you choose determines whether AWS Elastic Beanstalk provisions resources to support a web application that handles HTTP(S) requests or a web application that handles background-processing tasks.
.PARAMETER VersionLabel
Version to associate with the environment
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::ElasticBeanstalk::Environment
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$ApplicationName, # description required resource-ref-type type

    [string]$CNAMEPrefix, # description required type

    [string]$Description, # description required type

    [string]$EnvironmentName, # description required type

    [System.Collections.IDictionary[]]$OptionSettings, #[array][System.Collections.IDictionary] array-type description properties required type

    [System.Collections.IDictionary[]]$OptionsToRemove, #[array][System.Collections.IDictionary] array-type description properties required type

    [string]$SolutionStackName, # description required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [string]$TemplateName, # description required resource-ref-type type

    [System.Collections.IDictionary]$Tier, # description properties required type

    [string]$VersionLabel, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::ElasticBeanstalk::Environment" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($ApplicationName) {
    $rProperties.ApplicationName = $ApplicationName
  }
  if ($CNAMEPrefix) {
    $rProperties.CNAMEPrefix = $CNAMEPrefix
  }
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($EnvironmentName) {
    $rProperties.EnvironmentName = $EnvironmentName
  }
  if ($OptionSettings) {
    $rProperties.OptionSettings = $OptionSettings
  }
  if ($OptionsToRemove) {
    $rProperties.OptionsToRemove = $OptionsToRemove
  }
  if ($SolutionStackName) {
    $rProperties.SolutionStackName = $SolutionStackName
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  if ($TemplateName) {
    $rProperties.TemplateName = $TemplateName
  }
  if ($Tier) {
    $rProperties.Tier = $Tier
  }
  if ($VersionLabel) {
    $rProperties.VersionLabel = $VersionLabel
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-ElasticBeanstalk-Environment -Value Add-CfnElasticBeanstalk_EnvironmentResource

function Add-CfnElasticLoadBalancing_LoadBalancerResource {
<#
.SYNOPSIS
The AWS::ElasticLoadBalancing::LoadBalancer type creates a LoadBalancer.
.PARAMETER AccessLoggingPolicy
Captures detailed information for all requests made to your load balancer, such as the time a request was received, client�s IP address, latencies, request path, and server responses.
.PARAMETER AppCookieStickinessPolicy
Generates one or more stickiness policies with sticky session lifetimes that follow that of an application-generated cookie. These policies can be associated only with HTTP/HTTPS listeners.
.PARAMETER AvailabilityZones
The Availability Zones in which to create the load balancer. You can specify either AvailabilityZones or Subnets, but not both.
.PARAMETER ConnectionDrainingPolicy
Whether deregistered or unhealthy instances can complete all in-flight requests.
.PARAMETER ConnectionSettings
Specifies how long front-end and back-end connections of your load balancer can remain idle.
.PARAMETER CrossZone
Specifies whether cross-zone load balancing is enabled for the load balancer. With cross-zone load balancing, your load balancer nodes route traffic to the back-end instances across all Availability Zones. By default the CrossZone property is false.
.PARAMETER HealthCheck
When specified, declares an application health check for the instances.
.PARAMETER Instances
Provides a list of EC2 instance IDs for the LoadBalancer.
.PARAMETER LBCookieStickinessPolicy
Generates a stickiness policy with sticky session lifetimes controlled by the lifetime of the browser (user-agent), or by a specified expiration period. This policy can be associated only with HTTP/HTTPS listeners.
.PARAMETER Listeners
One or more listeners for this load balancer. Each listener must be registered for a specific port, and you can not have more than one listener for a given port.
.PARAMETER LoadBalancerName
A name for the load balancer. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the load balancer. The name must be unique within your set of load balancers.
.PARAMETER Policies
A list of elastic load balancing policies to apply to this elastic load balancer.
.PARAMETER Scheme
For LoadBalancers attached to an Apazon VPC, this parameter can be used to specify the type of LoadBalancer to use. Specify "internal" to create an internal LoadBalancer with a DNS name that resolves to private IP addresses.
.PARAMETER SecurityGroups
Security groups assigned to your load balancer within your virtual private cloud (VPC).
.PARAMETER Subnets
A list of subnet IDs in your virtual private cloud (VPC) to attach to your load balancer. You can specify either AvailabilityZones or Subnets, but not both.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::ElasticLoadBalancing::LoadBalancer
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$AccessLoggingPolicy, # description properties required type

    [System.Collections.IDictionary[]]$AppCookieStickinessPolicy, #[array][System.Collections.IDictionary] array-type description properties required type

    [ValidateSet('us-east-1a','us-east-1b','us-east-1c','us-east-1d','us-east-1e','us-west-1a','us-west-1b','us-west-1c','us-west-2a','us-west-2b','us-west-2c','eu-west-1a','eu-west-1b','eu-west-1c','ap-northeast-1a','ap-northeast-1b','ap-northeast-1c','ap-southeast-1a','ap-southeast-1b','ap-southeast-2a','ap-southeast-2b','sa-east-1a','sa-east-1b')]
    [string[]]$AvailabilityZones, #[array][string] allowed-values array-type description required type

    [System.Collections.IDictionary]$ConnectionDrainingPolicy, # description properties required type

    [System.Collections.IDictionary]$ConnectionSettings, # description properties required type

    [bool]$CrossZone, # description required type

    [System.Collections.IDictionary]$HealthCheck, # description properties required type

    [string[]]$Instances, #[array][string] array-type description required resource-ref-type type

    [System.Collections.IDictionary[]]$LBCookieStickinessPolicy, #[array][System.Collections.IDictionary] array-type description properties required type

    [System.Collections.IDictionary[]]$Listeners, #[array][System.Collections.IDictionary] array-type description properties required type

    [string]$LoadBalancerName, # description required type

    [System.Collections.IDictionary[]]$Policies, #[array][System.Collections.IDictionary] array-type description properties required type

    [string]$Scheme, # description required type

    [string[]]$SecurityGroups, #[array][string] array-type description required resource-ref-type type

    [string[]]$Subnets, #[array][string] array-type description required resource-ref-type type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::ElasticLoadBalancing::LoadBalancer" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AccessLoggingPolicy) {
    $rProperties.AccessLoggingPolicy = $AccessLoggingPolicy
  }
  if ($AppCookieStickinessPolicy) {
    $rProperties.AppCookieStickinessPolicy = $AppCookieStickinessPolicy
  }
  if ($AvailabilityZones) {
    $rProperties.AvailabilityZones = $AvailabilityZones
  }
  if ($ConnectionDrainingPolicy) {
    $rProperties.ConnectionDrainingPolicy = $ConnectionDrainingPolicy
  }
  if ($ConnectionSettings) {
    $rProperties.ConnectionSettings = $ConnectionSettings
  }
  if ($CrossZone) {
    $rProperties.CrossZone = $CrossZone
  }
  if ($HealthCheck) {
    $rProperties.HealthCheck = $HealthCheck
  }
  if ($Instances) {
    $rProperties.Instances = $Instances
  }
  if ($LBCookieStickinessPolicy) {
    $rProperties.LBCookieStickinessPolicy = $LBCookieStickinessPolicy
  }
  if ($Listeners) {
    $rProperties.Listeners = $Listeners
  }
  if ($LoadBalancerName) {
    $rProperties.LoadBalancerName = $LoadBalancerName
  }
  if ($Policies) {
    $rProperties.Policies = $Policies
  }
  if ($Scheme) {
    $rProperties.Scheme = $Scheme
  }
  if ($SecurityGroups) {
    $rProperties.SecurityGroups = $SecurityGroups
  }
  if ($Subnets) {
    $rProperties.Subnets = $Subnets
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-ElasticLoadBalancing-LoadBalancer -Value Add-CfnElasticLoadBalancing_LoadBalancerResource

function Add-CfnElasticsearch_DomainResource {
<#
.SYNOPSIS
The AWS::Elasticsearch::Domain resource creates an Amazon Elasticsearch Service (Amazon ES) domain that encapsulates the Amazon ES engine instances.
.PARAMETER AccessPolicies
An AWS Identity and Access Management (IAM) policy document that specifies who can access the Amazon ES domain and their permissions.
.PARAMETER AdvancedOptions
Additional options to specify for the Amazon ES domain.
.PARAMETER DomainName
A name for the Amazon ES domain.
.PARAMETER EBSOptions
The configurations of Amazon Elastic Block Store (Amazon EBS) volumes that are attached to data nodes in the Amazon ES domain.
.PARAMETER ElasticsearchClusterConfig
The cluster configuration for the Amazon ES domain.
.PARAMETER SnapshotOptions
The hour in UTC during which the service takes an automated daily snapshot of the indices in the Amazon ES domain.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Elasticsearch::Domain
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [object]$AccessPolicies, # description required type

    [object]$AdvancedOptions, # description required type

    [string]$DomainName, # description required type

    [System.Collections.IDictionary]$EBSOptions, # description Properties required type

    [System.Collections.IDictionary]$ElasticsearchClusterConfig, # description Properties required type

    [System.Collections.IDictionary]$SnapshotOptions, # description Properties required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Elasticsearch::Domain" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AccessPolicies) {
    $rProperties.AccessPolicies = $AccessPolicies
  }
  if ($AdvancedOptions) {
    $rProperties.AdvancedOptions = $AdvancedOptions
  }
  if ($DomainName) {
    $rProperties.DomainName = $DomainName
  }
  if ($EBSOptions) {
    $rProperties.EBSOptions = $EBSOptions
  }
  if ($ElasticsearchClusterConfig) {
    $rProperties.ElasticsearchClusterConfig = $ElasticsearchClusterConfig
  }
  if ($SnapshotOptions) {
    $rProperties.SnapshotOptions = $SnapshotOptions
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Elasticsearch-Domain -Value Add-CfnElasticsearch_DomainResource

function Add-CfnEMR_ClusterResource {
<#
.SYNOPSIS
The AWS::EMR::Cluster resource creates an Amazon Elastic MapReduce (Amazon EMR) cluster.
.PARAMETER AdditionalInfo
Additional features that you want to select.
.PARAMETER Applications
The software applications to deploy on the cluster, and the arguments that Amazon EMR passes to those applications.
.PARAMETER BootstrapActions
A list of bootstrap actions that Amazon EMR runs before starting applications on the cluster.
.PARAMETER Configurations
The software configuration of the Amazon EMR cluster.
.PARAMETER Instances
Configures the EC2 instances that will run jobs in the Amazon EMR cluster.
.PARAMETER JobFlowRole
An AWS Identity and Access Management (IAM) role for an Amazon EMR cluster.
.PARAMETER LogUri
An S3 bucket location to which Amazon EMR writes logs files from a job flow.
.PARAMETER Name
A name for the Amazon EMR cluster.
.PARAMETER ReleaseLabel
The Amazon EMR software release label. A release is a set of software applications and components that you can install and configure on an Amazon EMR cluster.
.PARAMETER ServiceRole
The IAM role that Amazon EMR assumes to access AWS resources on your behalf.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER VisibleToAllUsers
Indicates whether the instances in the cluster are visible to all IAM users in the AWS account.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EMR::Cluster
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [object]$AdditionalInfo, # description required type

    [System.Collections.IDictionary[]]$Applications, #[array][System.Collections.IDictionary] array-type description properties required type

    [System.Collections.IDictionary[]]$BootstrapActions, #[array][System.Collections.IDictionary] array-type description properties required type

    [object[]]$Configurations, #[array][object] array-type description required type

    [System.Collections.IDictionary]$Instances, # description properties required type

    [string]$JobFlowRole, # description required resource-ref-type type

    [string]$LogUri, # description required resource-ref-type type

    [string]$Name, # description required type

    [string]$ReleaseLabel, # description required type

    [string]$ServiceRole, # description required resource-ref-type type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [bool]$VisibleToAllUsers, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EMR::Cluster" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AdditionalInfo) {
    $rProperties.AdditionalInfo = $AdditionalInfo
  }
  if ($Applications) {
    $rProperties.Applications = $Applications
  }
  if ($BootstrapActions) {
    $rProperties.BootstrapActions = $BootstrapActions
  }
  if ($Configurations) {
    $rProperties.Configurations = $Configurations
  }
  if ($Instances) {
    $rProperties.Instances = $Instances
  }
  if ($JobFlowRole) {
    $rProperties.JobFlowRole = $JobFlowRole
  }
  if ($LogUri) {
    $rProperties.LogUri = $LogUri
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  if ($ReleaseLabel) {
    $rProperties.ReleaseLabel = $ReleaseLabel
  }
  if ($ServiceRole) {
    $rProperties.ServiceRole = $ServiceRole
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  if ($VisibleToAllUsers) {
    $rProperties.VisibleToAllUsers = $VisibleToAllUsers
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EMR-Cluster -Value Add-CfnEMR_ClusterResource

function Add-CfnEMR_InstanceGroupConfigResource {
<#
.SYNOPSIS
The AWS::EMR::InstanceGroupConfig resource configures a task instance group for an Amazon Elastic MapReduce (Amazon EMR) cluster.
.PARAMETER BidPrice
When launching instances as Spot Instances, the bid price in USD for each EC2 instance in the instance group.
.PARAMETER Configurations
A list of configurations to apply to this instance group.
.PARAMETER InstanceCount
The number of instances to launch in the instance group.
.PARAMETER InstanceType
The EC2 instance type for all instances in the instance group.
.PARAMETER Market
When launching instances as Spot Instances, the bid price in USD for each EC2 instance in the instance group.
.PARAMETER Name
A name for the instance group.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EMR::InstanceGroupConfig
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$BidPrice, # description required type

    [object[]]$Configurations, #[array][object] array-type description required type

    [int]$InstanceCount, # description required type

    [ValidateSet('*','t1.micro','m1.small','m1.medium','m1.large','m1.xlarge','m2.xlarge','m2.2xlarge','m2.4xlarge','m3.medium','m3.large','m3.xlarge','m3.2xlarge','c1.medium','c1.xlarge','cr1.8xlarge','c3.large','c3.xlarge','c3.2xlarge','c3.4xlarge','c3.8xlarge','cc1.4xlarge','cc2.8xlarge','cg1.4xlarge','g2.2xlarge','g2.2xlarge','hi1.4xlarge','hs1.8xlarge','i2.xlarge','i2.2xlarge','i2.4xlarge','i2.8xlarge','r3.large','r3.xlarge','r3.2xlarge','r3.4xlarge','r3.8xlarge')]
    [string]$InstanceType, # allowed-values description required type

    [ValidateSet('ON_DEMAND','SPOT')]
    [string]$Market, # allowed-values description required type

    [string]$Name, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EMR::InstanceGroupConfig" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($BidPrice) {
    $rProperties.BidPrice = $BidPrice
  }
  if ($Configurations) {
    $rProperties.Configurations = $Configurations
  }
  if ($InstanceCount) {
    $rProperties.InstanceCount = $InstanceCount
  }
  if ($InstanceType) {
    $rProperties.InstanceType = $InstanceType
  }
  if ($Market) {
    $rProperties.Market = $Market
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EMR-InstanceGroupConfig -Value Add-CfnEMR_InstanceGroupConfigResource

function Add-CfnEMR_StepResource {
<#
.SYNOPSIS
The AWS::EMR::Step resource creates a unit of work (a job flow step) that you submit to an Amazon Elastic MapReduce (Amazon EMR) cluster.
.PARAMETER ActionOnFailure
The action to take if the job flow step fails.
.PARAMETER HadoopJarStep
The JAR file that includes the main function that Amazon EMR executes.
.PARAMETER JobFlowId
The ID of a cluster in which you want to run this job flow step.
.PARAMETER Name
A name for the job flow step.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::EMR::Step
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [ValidateSet('*','CONTINUE','CONTINUE_AND_WAIT')]
    [string]$ActionOnFailure, # allowed-values description required type

    [System.Collections.IDictionary]$HadoopJarStep, # description properties required type

    [string]$JobFlowId, # description required resource-ref-type type

    [string]$Name, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::EMR::Step" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($ActionOnFailure) {
    $rProperties.ActionOnFailure = $ActionOnFailure
  }
  if ($HadoopJarStep) {
    $rProperties.HadoopJarStep = $HadoopJarStep
  }
  if ($JobFlowId) {
    $rProperties.JobFlowId = $JobFlowId
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-EMR-Step -Value Add-CfnEMR_StepResource

function Add-CfnIAM_AccessKeyResource {
<#
.SYNOPSIS
The AWS::IAM::AccessKey resource type generates a secret access key and assigns it to an IAM user or AWS account.
.PARAMETER Serial
This value is specific to AWS CloudFormation and can only be incremented. Incrementing this value notifies AWS CloudFormation that you want to rotate your access key. When you update your stack, AWS CloudFormation will replace the existing access key with a new key.
.PARAMETER Status
The status of the access key.
.PARAMETER UserName
The name of the user that the new key will belong to.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::IAM::AccessKey
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Serial, # description required type

    [ValidateSet('Active','Inactive')]
    [string]$Status, # allowed-values description required type

    [string]$UserName, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::IAM::AccessKey" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Serial) {
    $rProperties.Serial = $Serial
  }
  if ($Status) {
    $rProperties.Status = $Status
  }
  if ($UserName) {
    $rProperties.UserName = $UserName
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-IAM-AccessKey -Value Add-CfnIAM_AccessKeyResource

function Add-CfnIAM_GroupResource {
<#
.SYNOPSIS
The AWS::IAM::Group type creates an Identity and Access Management (IAM) group.
.PARAMETER ManagedPolicyArns
One or more managed policy ARNs to attach to this group.
.PARAMETER Path
The path for the group. For more information about paths, see Identifiers for IAM Entities in Using AWS Identity and Access Management.
.PARAMETER Policies
Applies specified policies to the role.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::IAM::Group
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string[]]$ManagedPolicyArns, #[array][string] array-type description required resource-ref-type type

    [string]$Path, # description required type

    [object[]]$Policies, #[array][object] array-type description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::IAM::Group" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($ManagedPolicyArns) {
    $rProperties.ManagedPolicyArns = $ManagedPolicyArns
  }
  if ($Path) {
    $rProperties.Path = $Path
  }
  if ($Policies) {
    $rProperties.Policies = $Policies
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-IAM-Group -Value Add-CfnIAM_GroupResource

function Add-CfnIAM_InstanceProfileResource {
<#
.SYNOPSIS
Creates an AWS Identity and Access Management (IAM) Instance Profile that can be used with IAM Roles for EC2 Instances.
.PARAMETER Path
The path associated with this IAM instance profile. For more information about paths, see Identifiers for IAM Entities in Using AWS Identity and Access Management.
.PARAMETER Roles
The roles associated with this IAM instance profile.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::IAM::InstanceProfile
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Path, # description required type

    [string[]]$Roles, #[array][string] array-type description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::IAM::InstanceProfile" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Path) {
    $rProperties.Path = $Path
  }
  if ($Roles) {
    $rProperties.Roles = $Roles
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-IAM-InstanceProfile -Value Add-CfnIAM_InstanceProfileResource

function Add-CfnIAM_ManagedPolicyResource {
<#
.SYNOPSIS
AWS::IAM::ManagedPolicy creates an AWS Identity and Access Management (IAM) managed policy for your AWS account that you can use to apply permissions to IAM users, groups, and roles.
.PARAMETER Description
A description of the policy. For example, you can describe the permissions that are defined in the policy.
.PARAMETER Groups
The names of groups to attach to this policy.
.PARAMETER Path
The path for the policy. By default, the path is /.
.PARAMETER PolicyDocument
A policy document containing permissions to add to the specified users or groups.
.PARAMETER Roles
The names of roles to attach to this policy.
.PARAMETER Users
The names of users to attach to this policy.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::IAM::ManagedPolicy
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Description, # description required type

    [string[]]$Groups, #[array][string] array-type description required resource-ref-type type

    [string]$Path, # description required type

    [object]$PolicyDocument, # description required type

    [string[]]$Roles, #[array][string] array-type description required resource-ref-type type

    [string[]]$Users, #[array][string] array-type description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::IAM::ManagedPolicy" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($Groups) {
    $rProperties.Groups = $Groups
  }
  if ($Path) {
    $rProperties.Path = $Path
  }
  if ($PolicyDocument) {
    $rProperties.PolicyDocument = $PolicyDocument
  }
  if ($Roles) {
    $rProperties.Roles = $Roles
  }
  if ($Users) {
    $rProperties.Users = $Users
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-IAM-ManagedPolicy -Value Add-CfnIAM_ManagedPolicyResource

function Add-CfnIAM_PolicyResource {
<#
.SYNOPSIS
The AWS::IAM::Policy type applies an Identity and Access Management (IAM) policy to users or groups.
.PARAMETER Groups
The names of groups to which you want to add the policy.
.PARAMETER PolicyDocument
A policy document containing permissions to add to the specified users or groups.
.PARAMETER PolicyName
The name of the policy.
.PARAMETER Roles
The names of roles to which you want to add the policy.
.PARAMETER Users
The names of users for whom you want to add the policy.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::IAM::Policy
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string[]]$Groups, #[array][string] array-type description required resource-ref-type type

    [object]$PolicyDocument, # description required type

    [string]$PolicyName, # description required type

    [string[]]$Roles, #[array][string] array-type description required resource-ref-type type

    [string[]]$Users, #[array][string] array-type description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::IAM::Policy" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Groups) {
    $rProperties.Groups = $Groups
  }
  if ($PolicyDocument) {
    $rProperties.PolicyDocument = $PolicyDocument
  }
  if ($PolicyName) {
    $rProperties.PolicyName = $PolicyName
  }
  if ($Roles) {
    $rProperties.Roles = $Roles
  }
  if ($Users) {
    $rProperties.Users = $Users
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-IAM-Policy -Value Add-CfnIAM_PolicyResource

function Add-CfnIAM_RoleResource {
<#
.SYNOPSIS
Creates an AWS Identity and Access Management (IAM) Role for EC2 Instances. An IAM Role can be used to enable applications running on an Amazon EC2 instance to securely access your AWS resources.
.PARAMETER AssumeRolePolicyDocument
The IAM Assume Role Policy Document associated with this role.
.PARAMETER ManagedPolicyArns
One or more managed policy ARNs to attach to this role.
.PARAMETER Path
The path for the role. For more information about paths, see Identifiers for IAM Entities in Using AWS Identity and Access Management.
.PARAMETER Policies
Applies specified policies to the role.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::IAM::Role
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [object]$AssumeRolePolicyDocument, # description required type

    [string[]]$ManagedPolicyArns, #[array][string] array-type description required resource-ref-type type

    [string]$Path, # description required type

    [object[]]$Policies, #[array][object] array-type description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::IAM::Role" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AssumeRolePolicyDocument) {
    $rProperties.AssumeRolePolicyDocument = $AssumeRolePolicyDocument
  }
  if ($ManagedPolicyArns) {
    $rProperties.ManagedPolicyArns = $ManagedPolicyArns
  }
  if ($Path) {
    $rProperties.Path = $Path
  }
  if ($Policies) {
    $rProperties.Policies = $Policies
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-IAM-Role -Value Add-CfnIAM_RoleResource

function Add-CfnIAM_UserResource {
<#
.SYNOPSIS
The AWS::IAM::User type creates a user.
.PARAMETER Groups
The path for the user name. For more information about paths, see Identifiers for IAM Entities in Using AWS Identity and Access Management.
.PARAMETER LoginProfile
Creates a login profile for the user so the user can access AWS services such as the AWS Management Console.
.PARAMETER ManagedPolicyArns
One or more managed policy ARNs to attach to this user.
.PARAMETER Path
The path for the user name. For more information about paths, see Identifiers for IAM Entities in Using AWS Identity and Access Management.
.PARAMETER Policies
Applies specified policies to the user.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::IAM::User
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string[]]$Groups, #[array][string] array-type description required resource-ref-type type

    [System.Collections.IDictionary]$LoginProfile, # description properties required type

    [string[]]$ManagedPolicyArns, #[array][string] array-type description required resource-ref-type type

    [string]$Path, # description required type

    [object[]]$Policies, #[array][object] array-type description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::IAM::User" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Groups) {
    $rProperties.Groups = $Groups
  }
  if ($LoginProfile) {
    $rProperties.LoginProfile = $LoginProfile
  }
  if ($ManagedPolicyArns) {
    $rProperties.ManagedPolicyArns = $ManagedPolicyArns
  }
  if ($Path) {
    $rProperties.Path = $Path
  }
  if ($Policies) {
    $rProperties.Policies = $Policies
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-IAM-User -Value Add-CfnIAM_UserResource

function Add-CfnIAM_UserToGroupAdditionResource {
<#
.SYNOPSIS
The AWS::IAM::UserToGroupAddition type adds Identity and Access Management (IAM) users to a group.
.PARAMETER GroupName
List of groups
.PARAMETER Users
List of users
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::IAM::UserToGroupAddition
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$GroupName, # description required resource-ref-type type

    [string[]]$Users, #[array][string] array-type description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::IAM::UserToGroupAddition" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($GroupName) {
    $rProperties.GroupName = $GroupName
  }
  if ($Users) {
    $rProperties.Users = $Users
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-IAM-UserToGroupAddition -Value Add-CfnIAM_UserToGroupAdditionResource

function Add-CfnKinesis_StreamResource {
<#
.SYNOPSIS
Creates an Amazon Kinesis stream that captures and transports data records that are emitted from data sources.
.PARAMETER ShardCount
The number of shards that the stream uses. For greater provisioned throughput, increase the number of shards.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Kinesis::Stream
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [int]$ShardCount, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Kinesis::Stream" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($ShardCount) {
    $rProperties.ShardCount = $ShardCount
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Kinesis-Stream -Value Add-CfnKinesis_StreamResource

function Add-CfnKMS_KeyResource {
<#
.SYNOPSIS
The AWS::KMS::Key resource creates a customer master key (CMK) in AWS Key Management Service (AWS KMS).
.PARAMETER Description
A description of the key. Use a description that helps your users decide whether the key is appropriate for a particular task.
.PARAMETER Enabled
Indicates whether the key is available for use. AWS CloudFormation sets this value to true by default.
.PARAMETER EnableKeyRotation
Indicates whether AWS KMS rotates the key. AWS CloudFormation sets this value to false by default.
.PARAMETER KeyPolicy
An AWS Identity and Access Management (IAM) policy to attach to the key.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::KMS::Key
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Description, # description required type

    [bool]$Enabled, # description required type

    [bool]$EnableKeyRotation, # description required type

    [object]$KeyPolicy, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::KMS::Key" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($Enabled) {
    $rProperties.Enabled = $Enabled
  }
  if ($EnableKeyRotation) {
    $rProperties.EnableKeyRotation = $EnableKeyRotation
  }
  if ($KeyPolicy) {
    $rProperties.KeyPolicy = $KeyPolicy
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-KMS-Key -Value Add-CfnKMS_KeyResource

function Add-CfnLambda_EventSourceMappingResource {
<#
.SYNOPSIS
The AWS::Lambda::EventSourceMapping resource specifies a stream as an event source for an AWS Lambda (Lambda) function.
.PARAMETER BatchSize
The largest number of records that Lambda retrieves from your event source when invoking your function.
.PARAMETER Enabled
Indicates whether Lambda begins polling the event source.
.PARAMETER EventSourceArn
The Amazon Resource Name (ARN) of the Amazon Kinesis or DynamoDB stream that is the source of events.
.PARAMETER FunctionName
The name or ARN of a Lambda function to invoke when Lambda detects an event on the stream.
.PARAMETER StartingPosition
The position in the stream where Lambda starts reading.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Lambda::EventSourceMapping
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [int]$BatchSize, # description required type

    [bool]$Enabled, # description required type

    [string]$EventSourceArn, # description required resource-ref-type type

    [string]$FunctionName, # description required resource-ref-type type

    [string]$StartingPosition, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Lambda::EventSourceMapping" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($BatchSize) {
    $rProperties.BatchSize = $BatchSize
  }
  if ($Enabled) {
    $rProperties.Enabled = $Enabled
  }
  if ($EventSourceArn) {
    $rProperties.EventSourceArn = $EventSourceArn
  }
  if ($FunctionName) {
    $rProperties.FunctionName = $FunctionName
  }
  if ($StartingPosition) {
    $rProperties.StartingPosition = $StartingPosition
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Lambda-EventSourceMapping -Value Add-CfnLambda_EventSourceMappingResource

function Add-CfnLambda_FunctionResource {
<#
.SYNOPSIS
The AWS::Lambda::Function resource creates an AWS Lambda (Lambda) function that can run code in response to events.
.PARAMETER Code
The source code of your Lambda function.
.PARAMETER Description
A description of the function.
.PARAMETER Handler
The name of the function within your code that Lambda calls to start running the code.
.PARAMETER MemorySize
The amount of memory, in MB, that is allocated to your Lambda function. Lambda uses this value to infer the amount of CPU and memory that is allocated to your function.
.PARAMETER Role
The Amazon Resource Name (ARN) of the AWS Identity and Access Management (IAM) role that Lambda assumes when it runs your code to access AWS.
.PARAMETER Runtime
The runtime environment for the Lambda function that you are uploading.
.PARAMETER Timeout
The function execution time (in seconds) after which Lambda terminates the function. By default, Timeout is set to 3 seconds.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Lambda::Function
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$Code, # description properties required type

    [string]$Description, # description required type

    [string]$Handler, # description required type

    [int]$MemorySize, # description required type

    [string]$Role, # description required resource-ref-type type

    [ValidateSet('*','nodejs','java8','python2.7')]
    [string]$Runtime, # allowed-values description required type

    [int]$Timeout, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Lambda::Function" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Code) {
    $rProperties.Code = $Code
  }
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($Handler) {
    $rProperties.Handler = $Handler
  }
  if ($MemorySize) {
    $rProperties.MemorySize = $MemorySize
  }
  if ($Role) {
    $rProperties.Role = $Role
  }
  if ($Runtime) {
    $rProperties.Runtime = $Runtime
  }
  if ($Timeout) {
    $rProperties.Timeout = $Timeout
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Lambda-Function -Value Add-CfnLambda_FunctionResource

function Add-CfnLambda_PermissionResource {
<#
.SYNOPSIS
The AWS::Lambda::Permission resource associates a policy statement with a specific AWS Lambda (Lambda) function's access policy.
.PARAMETER Action
The Lambda actions that you want to allow in this statement.
.PARAMETER FunctionName
The name (physical ID) or Amazon Resource Name (ARN) of the Lambda function that you want to associate with this statement. Lambda adds this statement to the function's access policy.
.PARAMETER Principal
The entity for which you are granting permission to invoke the Lambda function.
.PARAMETER SourceAccount
The AWS account ID (without hyphens) of the source owner.
.PARAMETER SourceArn
The ARN of a resource that is invoking your function.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Lambda::Permission
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Action, # description required type

    [string]$FunctionName, # description required resource-ref-type type

    [string]$Principal, # description required type

    [string]$SourceAccount, # description required type

    [string]$SourceArn, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Lambda::Permission" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Action) {
    $rProperties.Action = $Action
  }
  if ($FunctionName) {
    $rProperties.FunctionName = $FunctionName
  }
  if ($Principal) {
    $rProperties.Principal = $Principal
  }
  if ($SourceAccount) {
    $rProperties.SourceAccount = $SourceAccount
  }
  if ($SourceArn) {
    $rProperties.SourceArn = $SourceArn
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Lambda-Permission -Value Add-CfnLambda_PermissionResource

function Add-CfnLogs_DestinationResource {
<#
.SYNOPSIS
The AWS::Logs::Destination resource creates an Amazon CloudWatch Logs (CloudWatch Logs) destination.
.PARAMETER DestinationName
The name of the CloudWatch Logs destination.
.PARAMETER DestinationPolicy
An AWS Identity and Access Management (IAM) policy that specifies who can write to your destination.
.PARAMETER RoleArn
The Amazon Resource Name (ARN) of an IAM role that permits CloudWatch Logs to send data to the specified AWS resource (TargetArn).
.PARAMETER TargetArn
The ARN of the AWS resource that receives log events. Currently, you can specify only an Amazon Kinesis stream.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Logs::Destination
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$DestinationName, # description required type

    [string]$DestinationPolicy, # description required type

    [string]$RoleArn, # description required resource-ref-type type

    [string]$TargetArn, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Logs::Destination" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($DestinationName) {
    $rProperties.DestinationName = $DestinationName
  }
  if ($DestinationPolicy) {
    $rProperties.DestinationPolicy = $DestinationPolicy
  }
  if ($RoleArn) {
    $rProperties.RoleArn = $RoleArn
  }
  if ($TargetArn) {
    $rProperties.TargetArn = $TargetArn
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Logs-Destination -Value Add-CfnLogs_DestinationResource

function Add-CfnLogs_LogGroupResource {
<#
.SYNOPSIS
The AWS::Logs::LogGroup resource creates an Amazon CloudWatch Logs log group that defines common properties for log streams, such as their retention and access control rules. Each log stream must belong to one log group.
.PARAMETER RetentionInDays
The number of days log events are kept in CloudWatch Logs. When a log event expires, CloudWatch Logs automatically deletes it.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Logs::LogGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [int]$RetentionInDays, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Logs::LogGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($RetentionInDays) {
    $rProperties.RetentionInDays = $RetentionInDays
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Logs-LogGroup -Value Add-CfnLogs_LogGroupResource

function Add-CfnLogs_LogStreamResource {
<#
.SYNOPSIS
The AWS::Logs::LogStream resource creates an Amazon CloudWatch Logs log stream in a log group.
.PARAMETER LogGroupName
The name of the log group where the log stream is created.
.PARAMETER LogStreamName
The name of the log stream to create. The name must be unique within the log group.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Logs::LogStream
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$LogGroupName, # description required resource-ref-type type

    [string]$LogStreamName, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Logs::LogStream" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($LogGroupName) {
    $rProperties.LogGroupName = $LogGroupName
  }
  if ($LogStreamName) {
    $rProperties.LogStreamName = $LogStreamName
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Logs-LogStream -Value Add-CfnLogs_LogStreamResource

function Add-CfnLogs_MetricFilterResource {
<#
.SYNOPSIS
The AWS::Logs::MetricFilter resource creates a metric filter that describes how Amazon CloudWatch Logs extracts information from logs that you specify and transforms it into Amazon CloudWatch metrics.
.PARAMETER FilterPattern
Describes the pattern that CloudWatch Logs follows to interpret each entry in a log.
.PARAMETER LogGroupName
The name of an existing log group that you want to associate with this metric filter.
.PARAMETER MetricTransformations
Describes how to transform data from a log into a CloudWatch metric.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Logs::MetricFilter
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string[]]$FilterPattern, #[array][string] array-type description required type

    [string]$LogGroupName, # description required resource-ref-type type

    [System.Collections.IDictionary[]]$MetricTransformations, #[array][System.Collections.IDictionary] array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Logs::MetricFilter" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($FilterPattern) {
    $rProperties.FilterPattern = $FilterPattern
  }
  if ($LogGroupName) {
    $rProperties.LogGroupName = $LogGroupName
  }
  if ($MetricTransformations) {
    $rProperties.MetricTransformations = $MetricTransformations
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Logs-MetricFilter -Value Add-CfnLogs_MetricFilterResource

function Add-CfnLogs_SubscriptionFilterResource {
<#
.SYNOPSIS
The AWS::Logs::SubscriptionFilter resource creates an Amazon CloudWatch Logs (CloudWatch Logs) subscription filter that defines which log events are delivered to your Amazon Kinesis stream and where to send them.
.PARAMETER DestinationArn
The Amazon Resource Name (ARN) of the Amazon Kinesis stream that you want to use as the subscription feed destination.
.PARAMETER FilterPattern
The filtering expressions that restrict what gets delivered to the destination Amazon Kinesis stream.
.PARAMETER LogGroupName
The log group to associate with the subscription filter.
.PARAMETER RoleArn
An IAM role that grants CloudWatch Logs permission to put data into the specified Amazon Kinesis stream.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Logs::SubscriptionFilter
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$DestinationArn, # description required resource-ref-type type

    [string]$FilterPattern, # description required type

    [string]$LogGroupName, # description required resource-ref-type type

    [string]$RoleArn, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Logs::SubscriptionFilter" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($DestinationArn) {
    $rProperties.DestinationArn = $DestinationArn
  }
  if ($FilterPattern) {
    $rProperties.FilterPattern = $FilterPattern
  }
  if ($LogGroupName) {
    $rProperties.LogGroupName = $LogGroupName
  }
  if ($RoleArn) {
    $rProperties.RoleArn = $RoleArn
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Logs-SubscriptionFilter -Value Add-CfnLogs_SubscriptionFilterResource

function Add-CfnOpsWorks_AppResource {
<#
.SYNOPSIS
Defines an AWS OpsWorks app for an AWS OpsWorks stack. The app represents code that you want to run on an application server.
.PARAMETER AppSource
Contains the information required to retrieve an app from a repository.
.PARAMETER Attributes
One or more user-defined key-value pairs to be added to the stack attributes bag.
.PARAMETER Description
A description of the app.
.PARAMETER Domains
The app virtual host settings, with multiple domains separated by commas. For example, 'www.example.com, example.com'.
.PARAMETER EnableSsl
Whether to enable SSL for this app.
.PARAMETER Environment
Contains the information required to retrieve an app from a repository.
.PARAMETER Name
The AWS OpsWorks app name.
.PARAMETER Shortname
The app short name, which is used internally by AWS OpsWorks and by Chef recipes.
.PARAMETER SslConfiguration
The SSL configuration
.PARAMETER StackId
The AWS OpsWorks stack ID that this app will be associated with.
.PARAMETER Type
The app type. Each supported type is associated with a particular layer.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::OpsWorks::App
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$AppSource, # description properties required type

    [object]$Attributes, # description required type

    [string]$Description, # description required type

    [string[]]$Domains, #[array][string] array-type description required type

    [bool]$EnableSsl, # description required type

    [System.Collections.IDictionary]$Environment, # description properties required type

    [string]$Name, # description required type

    [string]$Shortname, # description required type

    [System.Collections.IDictionary]$SslConfiguration, # description properties required type

    [string]$StackId, # description required resource-ref-type type

    [string]$Type, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::OpsWorks::App" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AppSource) {
    $rProperties.AppSource = $AppSource
  }
  if ($Attributes) {
    $rProperties.Attributes = $Attributes
  }
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($Domains) {
    $rProperties.Domains = $Domains
  }
  if ($EnableSsl) {
    $rProperties.EnableSsl = $EnableSsl
  }
  if ($Environment) {
    $rProperties.Environment = $Environment
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  if ($Shortname) {
    $rProperties.Shortname = $Shortname
  }
  if ($SslConfiguration) {
    $rProperties.SslConfiguration = $SslConfiguration
  }
  if ($StackId) {
    $rProperties.StackId = $StackId
  }
  if ($Type) {
    $rProperties.Type = $Type
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-OpsWorks-App -Value Add-CfnOpsWorks_AppResource

function Add-CfnOpsWorks_ElasticLoadBalancerAttachmentResource {
<#
.SYNOPSIS
Attaches an Elastic Load Balancing load balancer to an AWS OpsWorks layer that you specify.
.PARAMETER ElasticLoadBalancerName
Elastic Load Balancing load balancer name.
.PARAMETER LayerId
The AWS OpsWorks layer ID that the Elastic Load Balancing load balancer will be attached to.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::OpsWorks::ElasticLoadBalancerAttachment
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$ElasticLoadBalancerName, # description required resource-ref-type type

    [string]$LayerId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::OpsWorks::ElasticLoadBalancerAttachment" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($ElasticLoadBalancerName) {
    $rProperties.ElasticLoadBalancerName = $ElasticLoadBalancerName
  }
  if ($LayerId) {
    $rProperties.LayerId = $LayerId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-OpsWorks-ElasticLoadBalancerAttachment -Value Add-CfnOpsWorks_ElasticLoadBalancerAttachmentResource

function Add-CfnOpsWorks_InstanceResource {
<#
.SYNOPSIS
Creates an instance for an AWS OpsWorks stack. These instances represent the Amazon EC2 instances that, for example, handle the work of serving applications and balancing traffic.
.PARAMETER AmiId
The ID of the custom AMI to be used to create the instance. The AMI should be based on one of the standard AWS OpsWorks APIs.
.PARAMETER Architecture
The instance architecture.
.PARAMETER AvailabilityZone
The instance Availability Zone.
.PARAMETER EbsOptimized
Whether the instance is optimized for Amazon Elastic Block Store (Amazon EBS) I/O.
.PARAMETER InstallUpdatesOnBoot
Whether to install operating system and package updates when the instance boots.
.PARAMETER InstanceType
The instance type, which must be supported by AWS OpsWorks.
.PARAMETER LayerIds
The IDs of the AWS OpsWorks layers that will be associated with this instance.
.PARAMETER Os
The instance operating system.
.PARAMETER RootDeviceType
The instance root device type.
.PARAMETER SshKeyName
The instance SSH key name.
.PARAMETER StackId
The ID of the AWS OpsWorks stack that this instance will be associated with.
.PARAMETER SubnetId
The ID of the instance's subnet. If the stack is running in a VPC, you can use this parameter to override the stack's default subnet ID value and direct AWS OpsWorks to launch the instance in a different subnet.
.PARAMETER TimeBasedAutoScaling
The time-based scaling configuration for the instance.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::OpsWorks::Instance
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$AmiId, # description required type

    [string]$Architecture, # description required type

    [string]$AvailabilityZone, # description required type

    [bool]$EbsOptimized, # description required type

    [bool]$InstallUpdatesOnBoot, # description required type

    [ValidateSet('*','t1.micro','m1.small','m1.medium','m1.large','m1.xlarge','m2.xlarge','m2.2xlarge','m2.4xlarge','m3.medium','m3.large','m3.xlarge','m3.2xlarge','c1.medium','c1.xlarge','cr1.8xlarge','c3.large','c3.xlarge','c3.2xlarge','c3.4xlarge','c3.8xlarge','cc1.4xlarge','cc2.8xlarge','cg1.4xlarge','g2.2xlarge','g2.2xlarge','hi1.4xlarge','hs1.8xlarge','i2.xlarge','i2.2xlarge','i2.4xlarge','i2.8xlarge','r3.large','r3.xlarge','r3.2xlarge','r3.4xlarge','r3.8xlarge')]
    [string]$InstanceType, # allowed-values description required type

    [string[]]$LayerIds, #[array][string] array-type description required resource-ref-type type

    [string]$Os, # description required type

    [string]$RootDeviceType, # description required type

    [string]$SshKeyName, # description required type

    [string]$StackId, # description required resource-ref-type type

    [string]$SubnetId, # description required resource-ref-type type

    [System.Collections.IDictionary]$TimeBasedAutoScaling, # description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::OpsWorks::Instance" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AmiId) {
    $rProperties.AmiId = $AmiId
  }
  if ($Architecture) {
    $rProperties.Architecture = $Architecture
  }
  if ($AvailabilityZone) {
    $rProperties.AvailabilityZone = $AvailabilityZone
  }
  if ($EbsOptimized) {
    $rProperties.EbsOptimized = $EbsOptimized
  }
  if ($InstallUpdatesOnBoot) {
    $rProperties.InstallUpdatesOnBoot = $InstallUpdatesOnBoot
  }
  if ($InstanceType) {
    $rProperties.InstanceType = $InstanceType
  }
  if ($LayerIds) {
    $rProperties.LayerIds = $LayerIds
  }
  if ($Os) {
    $rProperties.Os = $Os
  }
  if ($RootDeviceType) {
    $rProperties.RootDeviceType = $RootDeviceType
  }
  if ($SshKeyName) {
    $rProperties.SshKeyName = $SshKeyName
  }
  if ($StackId) {
    $rProperties.StackId = $StackId
  }
  if ($SubnetId) {
    $rProperties.SubnetId = $SubnetId
  }
  if ($TimeBasedAutoScaling) {
    $rProperties.TimeBasedAutoScaling = $TimeBasedAutoScaling
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-OpsWorks-Instance -Value Add-CfnOpsWorks_InstanceResource

function Add-CfnOpsWorks_LayerResource {
<#
.SYNOPSIS
Creates an AWS OpsWorks layer. A layer defines, for example, which packages and applications are installed and how they are configured.
.PARAMETER Attributes
One or more user-defined key-value pairs to be added to the stack attributes bag.
.PARAMETER AutoAssignElasticIps
Whether to automatically assign an Elastic IP address to Amazon EC2 instances in this layer.
.PARAMETER AutoAssignPublicIps
For AWS OpsWorks stacks that are running in a VPC, whether to automatically assign a public IP address to Amazon EC2 instances in this layer.
.PARAMETER CustomInstanceProfileArn
The Amazon Resource Name (ARN) of an IAM instance profile that is to be used for the Amazon EC2 instances in this layer.
.PARAMETER CustomRecipes
Custom event recipes for this layer.
.PARAMETER CustomSecurityGroupIds
Custom security group IDs for this layer.
.PARAMETER EnableAutoHealing
Whether to automatically heal Amazon EC2 instances that have become disconnected or timed out.
.PARAMETER InstallUpdatesOnBoot
Whether to install operating system and package updates when the instance boots.
.PARAMETER LifecycleEventConfiguration
The lifecycle events for the AWS OpsWorks layer.
.PARAMETER LoadBasedAutoScaling
The load-based scaling configuration for the AWS OpsWorks layer.
.PARAMETER Name
The AWS OpsWorks layer name.
.PARAMETER Packages
The packages for this layer.
.PARAMETER Shortname
The layer short name, which is used internally by AWS OpsWorks and by Chef recipes. The short name is also used as the name for the directory where your app files are installed.
.PARAMETER StackId
The ID of the AWS OpsWorks stack that this layer will be associated with.
.PARAMETER Type
The layer type. A stack cannot have more than one layer of the same type.
.PARAMETER VolumeConfigurations
Describes the Amazon EBS volumes for this layer.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::OpsWorks::Layer
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [object]$Attributes, # description required type

    [bool]$AutoAssignElasticIps, # description required type

    [bool]$AutoAssignPublicIps, # description required type

    [string]$CustomInstanceProfileArn, # description required resource-ref-type type

    [System.Collections.IDictionary]$CustomRecipes, # description properties required type

    [string[]]$CustomSecurityGroupIds, #[array][string] array-type description required resource-ref-type type

    [bool]$EnableAutoHealing, # description required type

    [bool]$InstallUpdatesOnBoot, # description required type

    [System.Collections.IDictionary]$LifecycleEventConfiguration, # description properties required type

    [System.Collections.IDictionary]$LoadBasedAutoScaling, # description properties required type

    [string]$Name, # description required type

    [string[]]$Packages, #[array][string] array-type description required type

    [string]$Shortname, # description required type

    [string]$StackId, # description required resource-ref-type type

    [string]$Type, # description required type

    [System.Collections.IDictionary]$VolumeConfigurations, # description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::OpsWorks::Layer" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Attributes) {
    $rProperties.Attributes = $Attributes
  }
  if ($AutoAssignElasticIps) {
    $rProperties.AutoAssignElasticIps = $AutoAssignElasticIps
  }
  if ($AutoAssignPublicIps) {
    $rProperties.AutoAssignPublicIps = $AutoAssignPublicIps
  }
  if ($CustomInstanceProfileArn) {
    $rProperties.CustomInstanceProfileArn = $CustomInstanceProfileArn
  }
  if ($CustomRecipes) {
    $rProperties.CustomRecipes = $CustomRecipes
  }
  if ($CustomSecurityGroupIds) {
    $rProperties.CustomSecurityGroupIds = $CustomSecurityGroupIds
  }
  if ($EnableAutoHealing) {
    $rProperties.EnableAutoHealing = $EnableAutoHealing
  }
  if ($InstallUpdatesOnBoot) {
    $rProperties.InstallUpdatesOnBoot = $InstallUpdatesOnBoot
  }
  if ($LifecycleEventConfiguration) {
    $rProperties.LifecycleEventConfiguration = $LifecycleEventConfiguration
  }
  if ($LoadBasedAutoScaling) {
    $rProperties.LoadBasedAutoScaling = $LoadBasedAutoScaling
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  if ($Packages) {
    $rProperties.Packages = $Packages
  }
  if ($Shortname) {
    $rProperties.Shortname = $Shortname
  }
  if ($StackId) {
    $rProperties.StackId = $StackId
  }
  if ($Type) {
    $rProperties.Type = $Type
  }
  if ($VolumeConfigurations) {
    $rProperties.VolumeConfigurations = $VolumeConfigurations
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-OpsWorks-Layer -Value Add-CfnOpsWorks_LayerResource

function Add-CfnOpsWorks_StackResource {
<#
.SYNOPSIS
Creates an AWS OpsWorks stack. An AWS OpsWorks stack represents a set of instances that you want to manage collectively, typically because they have a common purpose such as serving PHP applications.
.PARAMETER AgentVersion
The AWS OpsWorks agent version that you want to use. The agent communicates with the service and handles tasks such as initiating Chef runs in response to lifecycle events.
.PARAMETER Attributes
One or more user-defined key-value pairs to be added to the stack attributes bag.
.PARAMETER ChefConfiguration
Describes the Chef configuration.
.PARAMETER ConfigurationManager
The configuration manager. When you create a stack, you use the configuration manager to specify the Chef version.
.PARAMETER CustomCookbooksSource
Contains the information required to retrieve a cookbook from a repository.
.PARAMETER CustomJson
A string that contains user-defined custom JSON. The custom JSON is used to override the corresponding default stack configuration JSON values.
.PARAMETER DefaultAvailabilityZone
The stack's default Availability Zone, which must be in the specified region.
.PARAMETER DefaultInstanceProfileArn
The Amazon Resource Name (ARN) of an IAM instance profile that is the default profile for all of the stack's Amazon EC2 instances.
.PARAMETER DefaultOs
The stack's default operating system.
.PARAMETER DefaultRootDeviceType
The default root device type. This value is used by default for all instances in the stack, but you can override it when you create an instance.
.PARAMETER DefaultSshKeyName
A default SSH key for the stack instances. You can override this value when you create or update an instance.
.PARAMETER DefaultSubnetId
The stack's default subnet ID. All instances are launched into this subnet unless you specify another subnet ID when you create the instance.
.PARAMETER HostnameTheme
The stack's host name theme, with spaces replaced by underscores. The theme is used to generate host names for the stack's instances.
.PARAMETER Name
The name of the AWS OpsWorks stack.
.PARAMETER ServiceRoleArn
The AWS Identity and Access Management (IAM) role that AWS OpsWorks uses to work with AWS resources on your behalf. You must specify an Amazon Resource Name (ARN) for an existing IAM role.
.PARAMETER UseCustomCookbooks
Whether the stack uses custom cookbooks.
.PARAMETER UseOpsworksSecurityGroups
Whether to associate the AWS OpsWorks built-in security groups with the stack's layers.
.PARAMETER VpcId
The ID of the VPC that the stack is to be launched into, which must be in the specified region. All instances are launched into this VPC.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::OpsWorks::Stack
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$AgentVersion, # description required type

    [object]$Attributes, # description required type

    [System.Collections.IDictionary]$ChefConfiguration, # description properties required type

    [System.Collections.IDictionary]$ConfigurationManager, # description properties required type

    [System.Collections.IDictionary]$CustomCookbooksSource, # description properties required type

    [object]$CustomJson, # description required type

    [string]$DefaultAvailabilityZone, # description required type

    [string]$DefaultInstanceProfileArn, # description required resource-ref-type type

    [string]$DefaultOs, # description required type

    [string]$DefaultRootDeviceType, # description required type

    [string]$DefaultSshKeyName, # description required type

    [string]$DefaultSubnetId, # description required resource-ref-type type

    [string]$HostnameTheme, # description required type

    [string]$Name, # description required type

    [string]$ServiceRoleArn, # description required resource-ref-type type

    [bool]$UseCustomCookbooks, # description required type

    [bool]$UseOpsworksSecurityGroups, # description required type

    [string]$VpcId, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::OpsWorks::Stack" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AgentVersion) {
    $rProperties.AgentVersion = $AgentVersion
  }
  if ($Attributes) {
    $rProperties.Attributes = $Attributes
  }
  if ($ChefConfiguration) {
    $rProperties.ChefConfiguration = $ChefConfiguration
  }
  if ($ConfigurationManager) {
    $rProperties.ConfigurationManager = $ConfigurationManager
  }
  if ($CustomCookbooksSource) {
    $rProperties.CustomCookbooksSource = $CustomCookbooksSource
  }
  if ($CustomJson) {
    $rProperties.CustomJson = $CustomJson
  }
  if ($DefaultAvailabilityZone) {
    $rProperties.DefaultAvailabilityZone = $DefaultAvailabilityZone
  }
  if ($DefaultInstanceProfileArn) {
    $rProperties.DefaultInstanceProfileArn = $DefaultInstanceProfileArn
  }
  if ($DefaultOs) {
    $rProperties.DefaultOs = $DefaultOs
  }
  if ($DefaultRootDeviceType) {
    $rProperties.DefaultRootDeviceType = $DefaultRootDeviceType
  }
  if ($DefaultSshKeyName) {
    $rProperties.DefaultSshKeyName = $DefaultSshKeyName
  }
  if ($DefaultSubnetId) {
    $rProperties.DefaultSubnetId = $DefaultSubnetId
  }
  if ($HostnameTheme) {
    $rProperties.HostnameTheme = $HostnameTheme
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  if ($ServiceRoleArn) {
    $rProperties.ServiceRoleArn = $ServiceRoleArn
  }
  if ($UseCustomCookbooks) {
    $rProperties.UseCustomCookbooks = $UseCustomCookbooks
  }
  if ($UseOpsworksSecurityGroups) {
    $rProperties.UseOpsworksSecurityGroups = $UseOpsworksSecurityGroups
  }
  if ($VpcId) {
    $rProperties.VpcId = $VpcId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-OpsWorks-Stack -Value Add-CfnOpsWorks_StackResource

function Add-CfnRDS_DBClusterResource {
<#
.SYNOPSIS
The AWS::RDS::DBCluster resource creates a cluster, such as an Aurora for Amazon RDS (Amazon Aurora) DB cluster. Amazon Aurora is a fully managed, MySQL-compatible, relational database engine.
.PARAMETER AvailabilityZones
A list of Availability Zones (AZs) in which DB instances in the cluster can be created.
.PARAMETER BackupRetentionPeriod
The number of days for which automatic backups are retained.
.PARAMETER DatabaseName
The name of your database.
.PARAMETER DBClusterParameterGroupName
The name of the DB cluster parameter group to associate with this DB cluster.
.PARAMETER DBSubnetGroupName
A DB subnet group that you want to associate with this DB cluster.
.PARAMETER Engine
The name of the database engine that you want to use for this DB cluster.
.PARAMETER EngineVersion
The version number of the database engine to use.
.PARAMETER KmsKeyId
The Amazon Resource Name (ARN) of the AWS Key Management Service master key that is used to encrypt the database instances in the DB cluster.
.PARAMETER MasterUsername
The name of master user for the client DB instance.
.PARAMETER MasterUserPassword
The name of master user for the client DB instance.
.PARAMETER Port
The port number on which the database accepts connections.
.PARAMETER PreferredBackupWindow
The daily time range during which automated backups are created if automated backups are enabled, using the BackupRetentionPeriod parameter.
.PARAMETER PreferredMaintenanceWindow
The weekly time range during which system maintenance can occur, in Universal Coordinated Time (UTC).
.PARAMETER SnapshotIdentifier
The identifier for the DB cluster snapshot from which you want to restore.
.PARAMETER StorageEncrypted
Indicates whether the DB instances in the cluster are encrypted.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER VpcSecurityGroupIds
A list of EC2 VPC security groups to associate with this DB instance.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::RDS::DBCluster
#>

  [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPassWordParams', 'MasterUsername')]
  [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPassWordParams', 'MasterUserPassword')]
  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$AvailabilityZones, # description required type

    [int]$BackupRetentionPeriod, # description required type

    [string]$DatabaseName, # description required type

    [string]$DBClusterParameterGroupName, # description required resource-ref-type type

    [string]$DBSubnetGroupName, # description required resource-ref-type type

    [ValidateSet('MySQL','mariadb','oracle-se1','oracle-se','oracle-ee','sqlserver-ee','sqlserver-se','sqlserver-ex','sqlserver-web','postgres','aurora','*')]
    [string]$Engine, # allowed-values description required type

    [string]$EngineVersion, # description required type

    [string]$KmsKeyId, # description required resource-ref-type type

    [string]$MasterUsername, # description required type

    [string]$MasterUserPassword, # description required type

    [int]$Port, # description required type

    [string]$PreferredBackupWindow, # description required type

    [string]$PreferredMaintenanceWindow, # description required type

    [string]$SnapshotIdentifier, # description required type

    [bool]$StorageEncrypted, # description required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [string[]]$VpcSecurityGroupIds, #[array][string] array-type description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::RDS::DBCluster" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AvailabilityZones) {
    $rProperties.AvailabilityZones = $AvailabilityZones
  }
  if ($BackupRetentionPeriod) {
    $rProperties.BackupRetentionPeriod = $BackupRetentionPeriod
  }
  if ($DatabaseName) {
    $rProperties.DatabaseName = $DatabaseName
  }
  if ($DBClusterParameterGroupName) {
    $rProperties.DBClusterParameterGroupName = $DBClusterParameterGroupName
  }
  if ($DBSubnetGroupName) {
    $rProperties.DBSubnetGroupName = $DBSubnetGroupName
  }
  if ($Engine) {
    $rProperties.Engine = $Engine
  }
  if ($EngineVersion) {
    $rProperties.EngineVersion = $EngineVersion
  }
  if ($KmsKeyId) {
    $rProperties.KmsKeyId = $KmsKeyId
  }
  if ($MasterUsername) {
    $rProperties.MasterUsername = $MasterUsername
  }
  if ($MasterUserPassword) {
    $rProperties.MasterUserPassword = $MasterUserPassword
  }
  if ($Port) {
    $rProperties.Port = $Port
  }
  if ($PreferredBackupWindow) {
    $rProperties.PreferredBackupWindow = $PreferredBackupWindow
  }
  if ($PreferredMaintenanceWindow) {
    $rProperties.PreferredMaintenanceWindow = $PreferredMaintenanceWindow
  }
  if ($SnapshotIdentifier) {
    $rProperties.SnapshotIdentifier = $SnapshotIdentifier
  }
  if ($StorageEncrypted) {
    $rProperties.StorageEncrypted = $StorageEncrypted
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  if ($VpcSecurityGroupIds) {
    $rProperties.VpcSecurityGroupIds = $VpcSecurityGroupIds
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-RDS-DBCluster -Value Add-CfnRDS_DBClusterResource

function Add-CfnRDS_DBClusterParameterGroupResource {
<#
.SYNOPSIS
The AWS::RDS::DBClusterParameterGroup resource creates a new Amazon Relational Database Service (Amazon RDS) database (DB) cluster parameter group.
.PARAMETER Description
A friendly description for this DB cluster parameter group.
.PARAMETER Family
The database family of this DB cluster parameter group.
.PARAMETER Parameters
The parameters to set for this DB cluster parameter group.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::RDS::DBClusterParameterGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Description, # description required type

    [string]$Family, # description required type

    [object]$Parameters, # description required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::RDS::DBClusterParameterGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($Family) {
    $rProperties.Family = $Family
  }
  if ($Parameters) {
    $rProperties.Parameters = $Parameters
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-RDS-DBClusterParameterGroup -Value Add-CfnRDS_DBClusterParameterGroupResource

function Add-CfnRDS_DBInstanceResource {
<#
.SYNOPSIS
The AWS::RDS::DBInstance type creates an Amazon RDS database instance.
.PARAMETER AllocatedStorage
The allocated storage size specified in gigabytes (GB). If any value is used in the Iops parameter, AllocatedStorage must be at least 100 GB, which corresponds to the minimum Iops value of 1000. If Iops is increased (in 1000 IOPS increments), then AllocatedStorage must also be increased (in 100 GB increments) correspondingly.
.PARAMETER AllowMajorVersionUpgrade
Indicates whether major version upgrades are allowed. Changing this parameter does not result in an outage, and the change is applied asynchronously as soon as possible.
.PARAMETER AutoMinorVersionUpgrade
Indicates that minor engine upgrades will be applied automatically to the DB instance during the maintenance window. The default value is true.
.PARAMETER AvailabilityZone
The name of the Availability Zone where the DB instance is. You cannot set the AvailabilityZone parameter if the MultiAZ parameter is set to true.
.PARAMETER BackupRetentionPeriod
The number of days for which automatic DB snapshots are retained.
.PARAMETER CharacterSetName
For supported engines, specifies the character set to associate with the database instance.
.PARAMETER DBClusterIdentifier
The identifier of an existing DB cluster that this instance will be associated with.
.PARAMETER DBInstanceClass
The name of the compute and memory capacity class of the DB instance.
.PARAMETER DBInstanceIdentifier
A name for the DB instance. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the DB instance.
.PARAMETER DBName
The name of the initial database of this instance that was provided at create time, if one was specified when the DB instance was created. This same name is returned for the life of the DB instance.
.PARAMETER DBParameterGroupName
The name of an existing DB parameter group or a reference to an AWS::RDS::DBParameterGroup resource created in the template.
.PARAMETER DBSecurityGroups
A list containing the DB security groups to assign to the Amazon RDS instance. The list can contain both the name of existing DB security groups or references to AWS::RDS::DBSecurityGroup resources created in the template.
.PARAMETER DBSnapshotIdentifier
The identifier for the DB snapshot to restore from.
.PARAMETER DBSubnetGroupName
A DB Subnet Group to associate with this DB instance.
.PARAMETER Engine
The name of the database engine to be used for this DB instance.
.PARAMETER EngineVersion
The version number of the database engine to use.
.PARAMETER Iops
The number of I/O operations per second (IOPS) that the database should provision. This can be any value from 1000�10,000, in 1000 IOPS increments.
.PARAMETER KmsKeyId
The Amazon Resource Name (ARN) of the AWS Key Management Service master key that is used to encrypt the database instance.
.PARAMETER LicenseModel
The license model information for this DB instance.
.PARAMETER MasterUsername
The master username for the DB instance.
.PARAMETER MasterUserPassword
The master password for the DB instance.
.PARAMETER MultiAZ
Specifies if the DB instance is a multiple availability-zone deployment. You cannot set the AvailabilityZone parameter if the MultiAZ parameter is set to true.
.PARAMETER OptionGroupName
An option group that this database instance is associated with.
.PARAMETER Port
The port for the instance.
.PARAMETER PreferredBackupWindow
The daily time range during which automated backups are created if automated backups are enabled, as determined by the BackupRetentionPeriod.
.PARAMETER PreferredMaintenanceWindow
The weekly time range (in UTC) during which system maintenance can occur.
.PARAMETER PubliclyAccessible
Indicates whether the database instance is an Internet-facing instance. If you specify true, an instance is created with a publicly resolvable DNS name, which resolves to a public IP address. If you specify false, an internal instance is created with a DNS name that resolves to a private IP address.
.PARAMETER SourceDBInstanceIdentifier
If you want to create a read replica DB instance, specify the ID of the source DB instance.
.PARAMETER StorageEncrypted
Indicates whether the database instance is encrypted.
.PARAMETER StorageType
The storage type associated with this database instance.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER VPCSecurityGroups
A list of the VPC security groups to assign to the Amazon RDS instance.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::RDS::DBInstance
#>

  [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPassWordParams', 'MasterUsername')]
  [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPassWordParams', 'MasterUserPassword')]
  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$AllocatedStorage, # description required type

    [bool]$AllowMajorVersionUpgrade, # description required type

    [bool]$AutoMinorVersionUpgrade, # description required type

    [ValidateSet('us-east-1a','us-east-1b','us-east-1c','us-east-1d','us-east-1e','us-west-1a','us-west-1b','us-west-1c','us-west-2a','us-west-2b','us-west-2c','eu-west-1a','eu-west-1b','eu-west-1c','ap-northeast-1a','ap-northeast-1b','ap-northeast-1c','ap-southeast-1a','ap-southeast-1b','ap-southeast-2a','ap-southeast-2b','sa-east-1a','sa-east-1b')]
    [string]$AvailabilityZone, # allowed-values description required type

    [string]$BackupRetentionPeriod, # description required type

    [string]$CharacterSetName, # description required type

    [string]$DBClusterIdentifier, # description required resource-ref-type type

    [ValidateSet('*','db.t1.micro','db.m1.small','db.m1.medium','db.m1.large','db.m1.xlarge','db.m2.xlarge','db.m2.2xlarge','db.m2.4xlarge','db.m3.medium','db.m3.large','db.m3.xlarge','db.m3.2xlarge','db.m4.large','db.m4.xlarge','db.m4.2xlarge','db.m4.4xlarge','db.m4.10xlarge','db.r3.large','db.r3.xlarge','db.r3.2xlarge','db.r3.4xlarge','db.r3.8xlarge','db.t2.micro','db.t2.small','db.t2.medium','db.t2.large')]
    [string]$DBInstanceClass, # allowed-values description required type

    [string]$DBInstanceIdentifier, # description required type

    [string]$DBName, # description required type

    [string]$DBParameterGroupName, # description required resource-ref-type type

    [string[]]$DBSecurityGroups, #[array][string] array-type description required resource-ref-type type

    [string]$DBSnapshotIdentifier, # description required type

    [string]$DBSubnetGroupName, # description required resource-ref-type type

    [ValidateSet('*','MySQL','mariadb','oracle-se1','oracle-se','oracle-ee','sqlserver-ee','sqlserver-se','sqlserver-ex','sqlserver-web','postgres','aurora')]
    [string]$Engine, # allowed-values description required type

    [string]$EngineVersion, # description required type

    [string]$Iops, # description required type

    [string]$KmsKeyId, # description required type

    [string]$LicenseModel, # description required type

    [string]$MasterUsername, # description required type

    [string]$MasterUserPassword, # description required type

    [bool]$MultiAZ, # description required type

    [string]$OptionGroupName, # description required resource-ref-type type

    [string]$Port, # description required type

    [string]$PreferredBackupWindow, # description required type

    [string]$PreferredMaintenanceWindow, # description required type

    [bool]$PubliclyAccessible, # description required type

    [string]$SourceDBInstanceIdentifier, # description required resource-ref-type type

    [bool]$StorageEncrypted, # description required type

    [ValidateSet('standard','gp2','io1','*')]
    [string]$StorageType, # allowed-values description required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [string[]]$VPCSecurityGroups, #[array][string] array-type description required resource-ref-type type

    [ValidateSet('Delete','Retain','Snapshot')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::RDS::DBInstance" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AllocatedStorage) {
    $rProperties.AllocatedStorage = $AllocatedStorage
  }
  if ($AllowMajorVersionUpgrade) {
    $rProperties.AllowMajorVersionUpgrade = $AllowMajorVersionUpgrade
  }
  if ($AutoMinorVersionUpgrade) {
    $rProperties.AutoMinorVersionUpgrade = $AutoMinorVersionUpgrade
  }
  if ($AvailabilityZone) {
    $rProperties.AvailabilityZone = $AvailabilityZone
  }
  if ($BackupRetentionPeriod) {
    $rProperties.BackupRetentionPeriod = $BackupRetentionPeriod
  }
  if ($CharacterSetName) {
    $rProperties.CharacterSetName = $CharacterSetName
  }
  if ($DBClusterIdentifier) {
    $rProperties.DBClusterIdentifier = $DBClusterIdentifier
  }
  if ($DBInstanceClass) {
    $rProperties.DBInstanceClass = $DBInstanceClass
  }
  if ($DBInstanceIdentifier) {
    $rProperties.DBInstanceIdentifier = $DBInstanceIdentifier
  }
  if ($DBName) {
    $rProperties.DBName = $DBName
  }
  if ($DBParameterGroupName) {
    $rProperties.DBParameterGroupName = $DBParameterGroupName
  }
  if ($DBSecurityGroups) {
    $rProperties.DBSecurityGroups = $DBSecurityGroups
  }
  if ($DBSnapshotIdentifier) {
    $rProperties.DBSnapshotIdentifier = $DBSnapshotIdentifier
  }
  if ($DBSubnetGroupName) {
    $rProperties.DBSubnetGroupName = $DBSubnetGroupName
  }
  if ($Engine) {
    $rProperties.Engine = $Engine
  }
  if ($EngineVersion) {
    $rProperties.EngineVersion = $EngineVersion
  }
  if ($Iops) {
    $rProperties.Iops = $Iops
  }
  if ($KmsKeyId) {
    $rProperties.KmsKeyId = $KmsKeyId
  }
  if ($LicenseModel) {
    $rProperties.LicenseModel = $LicenseModel
  }
  if ($MasterUsername) {
    $rProperties.MasterUsername = $MasterUsername
  }
  if ($MasterUserPassword) {
    $rProperties.MasterUserPassword = $MasterUserPassword
  }
  if ($MultiAZ) {
    $rProperties.MultiAZ = $MultiAZ
  }
  if ($OptionGroupName) {
    $rProperties.OptionGroupName = $OptionGroupName
  }
  if ($Port) {
    $rProperties.Port = $Port
  }
  if ($PreferredBackupWindow) {
    $rProperties.PreferredBackupWindow = $PreferredBackupWindow
  }
  if ($PreferredMaintenanceWindow) {
    $rProperties.PreferredMaintenanceWindow = $PreferredMaintenanceWindow
  }
  if ($PubliclyAccessible) {
    $rProperties.PubliclyAccessible = $PubliclyAccessible
  }
  if ($SourceDBInstanceIdentifier) {
    $rProperties.SourceDBInstanceIdentifier = $SourceDBInstanceIdentifier
  }
  if ($StorageEncrypted) {
    $rProperties.StorageEncrypted = $StorageEncrypted
  }
  if ($StorageType) {
    $rProperties.StorageType = $StorageType
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  if ($VPCSecurityGroups) {
    $rProperties.VPCSecurityGroups = $VPCSecurityGroups
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-RDS-DBInstance -Value Add-CfnRDS_DBInstanceResource

function Add-CfnRDS_DBParameterGroupResource {
<#
.SYNOPSIS
Creates a custom parameter group for an RDS database family.
.PARAMETER Description
A friendly description of the RDS parameter group. For example, "My Parameter Group".
.PARAMETER Family
The database family of this RDS parameter group. For example, "MySQL5.1".
.PARAMETER Parameters
The parameters to set for this RDS parameter group.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::RDS::DBParameterGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Description, # description required type

    [string]$Family, # description required type

    [object]$Parameters, # description required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::RDS::DBParameterGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($Family) {
    $rProperties.Family = $Family
  }
  if ($Parameters) {
    $rProperties.Parameters = $Parameters
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-RDS-DBParameterGroup -Value Add-CfnRDS_DBParameterGroupResource

function Add-CfnRDS_DBSecurityGroupResource {
<#
.SYNOPSIS
The AWS::RDS::DBSecurityGroup type is used to create or update an Amazon RDS DB Security Group.
.PARAMETER DBSecurityGroupIngress
Network ingress authorization for an Amazon EC2 security group or an IP address range.
.PARAMETER EC2VpcId
The Id of VPC. Indicates which VPC this DB Security Group should belong to. Required: Conditional. Must be specified to create a DB Security Group for a VPC; may not be specified otherwise.
.PARAMETER GroupDescription
Description of the security group.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::RDS::DBSecurityGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary[]]$DBSecurityGroupIngress, #[array][System.Collections.IDictionary] array-type description properties required type

    [string]$EC2VpcId, # description required resource-ref-type type

    [string]$GroupDescription, # description required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::RDS::DBSecurityGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($DBSecurityGroupIngress) {
    $rProperties.DBSecurityGroupIngress = $DBSecurityGroupIngress
  }
  if ($EC2VpcId) {
    $rProperties.EC2VpcId = $EC2VpcId
  }
  if ($GroupDescription) {
    $rProperties.GroupDescription = $GroupDescription
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-RDS-DBSecurityGroup -Value Add-CfnRDS_DBSecurityGroupResource

function Add-CfnRDS_DBSecurityGroupIngressResource {
<#
.SYNOPSIS
The AWS::RDS::DBSecurityGroupIngress type enables ingress to a DBSecurityGroup using one of two forms of authorization.
.PARAMETER CIDRIP
The IP range to authorize.
.PARAMETER DBSecurityGroupName
The name (ARN) of the AWS::RDS::DBSecurityGroup to which this ingress will be added.
.PARAMETER EC2SecurityGroupId
Id of the VPC or EC2 Security Group to authorize.
.PARAMETER EC2SecurityGroupName
Name of the EC2 Security Group to authorize.
.PARAMETER EC2SecurityGroupOwnerId
AWS Account Number of the owner of the EC2 Security Group specified in the EC2SecurityGroupName parameter. The AWS Access Key ID is not an acceptable value.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::RDS::DBSecurityGroupIngress
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$CIDRIP, # description required type

    [string]$DBSecurityGroupName, # description required resource-ref-type type

    [string]$EC2SecurityGroupId, # description required resource-ref-type type

    [string]$EC2SecurityGroupName, # description required resource-ref-type type

    [string]$EC2SecurityGroupOwnerId, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::RDS::DBSecurityGroupIngress" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($CIDRIP) {
    $rProperties.CIDRIP = $CIDRIP
  }
  if ($DBSecurityGroupName) {
    $rProperties.DBSecurityGroupName = $DBSecurityGroupName
  }
  if ($EC2SecurityGroupId) {
    $rProperties.EC2SecurityGroupId = $EC2SecurityGroupId
  }
  if ($EC2SecurityGroupName) {
    $rProperties.EC2SecurityGroupName = $EC2SecurityGroupName
  }
  if ($EC2SecurityGroupOwnerId) {
    $rProperties.EC2SecurityGroupOwnerId = $EC2SecurityGroupOwnerId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-RDS-DBSecurityGroupIngress -Value Add-CfnRDS_DBSecurityGroupIngressResource

function Add-CfnRDS_DBSubnetGroupResource {
<#
.SYNOPSIS
The AWS::RDS::DBSubnetGroup type creates DB subnet group. DB subnet groups must contain at least one subnet in each AZ in the region.
.PARAMETER DBSubnetGroupDescription
The description for the DB Subnet Group.
.PARAMETER SubnetIds
The EC2 Subnet IDs for the DB Subnet Group.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::RDS::DBSubnetGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$DBSubnetGroupDescription, # description required type

    [string[]]$SubnetIds, #[array][string] array-type description required resource-ref-type type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::RDS::DBSubnetGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($DBSubnetGroupDescription) {
    $rProperties.DBSubnetGroupDescription = $DBSubnetGroupDescription
  }
  if ($SubnetIds) {
    $rProperties.SubnetIds = $SubnetIds
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-RDS-DBSubnetGroup -Value Add-CfnRDS_DBSubnetGroupResource

function Add-CfnRDS_EventSubscriptionResource {
<#
.SYNOPSIS
Use the AWS::RDS::EventSubscription resource to get notifications for Amazon Relational Database Service events through the Amazon Simple Notification Service.
.PARAMETER Enabled
Indicates whether to activate the subscription. If you don't specify this property, AWS CloudFormation activates the subscription.
.PARAMETER EventCategories
A list of event categories that you want to subscribe to for a given source type. If you don't specify this property, you are notified about all event categories.
.PARAMETER SnsTopicArn
The Amazon Resource Name (ARN) of an Amazon SNS topic that you want to send event notifications to.
.PARAMETER SourceIds
A list of identifiers for which Amazon RDS provides notification events.
.PARAMETER SourceType
The type of source for which Amazon RDS provides notification events.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::RDS::EventSubscription
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [bool]$Enabled, # description required type

    [string[]]$EventCategories, #[array][string] array-type description required type

    [string]$SnsTopicArn, # description required resource-ref-type type

    [string[]]$SourceIds, #[array][string] array-type description required resource-ref-type type

    [ValidateSet('db-instance','*')]
    [string]$SourceType, # allowed-values description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::RDS::EventSubscription" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Enabled) {
    $rProperties.Enabled = $Enabled
  }
  if ($EventCategories) {
    $rProperties.EventCategories = $EventCategories
  }
  if ($SnsTopicArn) {
    $rProperties.SnsTopicArn = $SnsTopicArn
  }
  if ($SourceIds) {
    $rProperties.SourceIds = $SourceIds
  }
  if ($SourceType) {
    $rProperties.SourceType = $SourceType
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-RDS-EventSubscription -Value Add-CfnRDS_EventSubscriptionResource

function Add-CfnRDS_OptionGroupResource {
<#
.SYNOPSIS
Use the AWS::RDS::OptionGroup resource to create an option group that can make managing data and databases easier.
.PARAMETER EngineName
The name of the database engine that this option group is associated with.
.PARAMETER MajorEngineVersion
The major version number of the database engine that this option group is associated with.
.PARAMETER OptionConfigurations
The configurations for this option group.
.PARAMETER OptionGroupDescription
A description of the option group.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::RDS::OptionGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [ValidateSet('MySQL','mariadb','oracle-se1','oracle-se','oracle-ee','sqlserver-ee','sqlserver-se','sqlserver-ex','sqlserver-web','postgres','aurora','*')]
    [string]$EngineName, # allowed-values description required type

    [string]$MajorEngineVersion, # description required type

    [System.Collections.IDictionary]$OptionConfigurations, # description properties required type

    [string]$OptionGroupDescription, # description required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::RDS::OptionGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($EngineName) {
    $rProperties.EngineName = $EngineName
  }
  if ($MajorEngineVersion) {
    $rProperties.MajorEngineVersion = $MajorEngineVersion
  }
  if ($OptionConfigurations) {
    $rProperties.OptionConfigurations = $OptionConfigurations
  }
  if ($OptionGroupDescription) {
    $rProperties.OptionGroupDescription = $OptionGroupDescription
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-RDS-OptionGroup -Value Add-CfnRDS_OptionGroupResource

function Add-CfnRedshift_ClusterResource {
<#
.SYNOPSIS
Creates an Amazon Redshift cluster. A cluster is a fully managed data warehouse that consists of set of compute nodes.
.PARAMETER AllowVersionUpgrade
When a new version of the Amazon Redshift is released, indicates whether upgrades can be applied to the engine that is running on the cluster. The upgrades are applied during the maintenance window.
.PARAMETER AutomatedSnapshotRetentionPeriod
The number of days that automated snapshots are retained. If you set the value to 0, automated snapshots are disabled.
.PARAMETER AvailabilityZone
The Amazon EC2 Availability Zone in which you want to provision your Amazon Redshift cluster. For example, if you have several Amazon EC2 instances running in a specific Availability Zone, you might want the cluster to be provisioned in the same zone in order to decrease network latency.
.PARAMETER ClusterParameterGroupName
The name of the parameter group that you want to associate with this cluster.
.PARAMETER ClusterSecurityGroups
A list of security groups that you want to associate with this cluster.
.PARAMETER ClusterSubnetGroupName
The name of a cluster subnet group that you want to associate with this cluster.
.PARAMETER ClusterType
The type of cluster. You can specify single-node or multi-node.
.PARAMETER ClusterVersion
The Amazon Redshift engine version that you want to deploy on the cluster.
.PARAMETER DBName
The name of the first database that is created when the cluster is created.
.PARAMETER ElasticIp
The Elastic IP (EIP) address for the cluster.
.PARAMETER Encrypted
Indicates whether the data in the cluster is encrypted at rest.
.PARAMETER HsmClientCertificateIdentifier
Specifies the name of the HSM client certificate that the Amazon Redshift cluster uses to retrieve the data encryption keys stored in an HSM.
.PARAMETER HsmConfigurationIdentifier
Specifies the name of the HSM configuration that contains the information that the Amazon Redshift cluster can use to retrieve and store keys in an HSM.
.PARAMETER KmsKeyId
The AWS Key Management Service (AWS KMS) key ID that you want to use to encrypt data in the cluster.
.PARAMETER MasterUsername
The user name that is associated with the master user account for this cluster.
.PARAMETER MasterUserPassword
The password associated with the master user account for this cluster.
.PARAMETER NodeType
The node type that is provisioned for this cluster.
.PARAMETER NumberOfNodes
The number of compute nodes in the cluster. If you specify multi-node for the ClusterType parameter, you must specify a number greater than 1.
.PARAMETER OwnerAccount
When you restore from a snapshot from another AWS account, the 12-digit AWS account ID that contains that snapshot.
.PARAMETER Port
The port number on which the cluster accepts incoming connections.
.PARAMETER PreferredMaintenanceWindow
The weekly time range (in UTC) during which automated cluster maintenance can occur. The format of the time range is ddd:hh24:mi-ddd:hh24:mi.
.PARAMETER PubliclyAccessible
Indicates whether the cluster can be accessed from a public network.
.PARAMETER SnapshotClusterIdentifier
The cluster identifier for which you want a snapshot.
.PARAMETER SnapshotIdentifier
A unique identifier for the snapshot that you are requesting. This identifier must be unique for all snapshots within the AWS account.
.PARAMETER VpcSecurityGroupIds
A list of VPC security groups that are associated with this cluster.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Redshift::Cluster
#>

  [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPassWordParams', 'MasterUsername')]
  [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingUserNameAndPassWordParams', 'MasterUserPassword')]
  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [bool]$AllowVersionUpgrade, # description required type

    [int]$AutomatedSnapshotRetentionPeriod, # description required type

    [string]$AvailabilityZone, # description required type

    [string]$ClusterParameterGroupName, # description required resource-ref-type type

    [string]$ClusterSecurityGroups, # description required resource-ref-type type

    [string]$ClusterSubnetGroupName, # description required resource-ref-type type

    [ValidateSet('single-node','multi-node')]
    [string]$ClusterType, # allowed-values description required type

    [string]$ClusterVersion, # description required type

    [string]$DBName, # description required type

    [string]$ElasticIp, # description required type

    [bool]$Encrypted, # description required type

    [string]$HsmClientCertificateIdentifier, # description required type

    [string]$HsmConfigurationIdentifier, # description required type

    [string]$KmsKeyId, # description required resource-ref-type type

    [string]$MasterUsername, # description required type

    [string]$MasterUserPassword, # description required type

    [ValidateSet('dw.hs1.xlarge','dw.hs1.8xlarge','*')]
    [string]$NodeType, # allowed-values description required type

    [int]$NumberOfNodes, # description required type

    [string]$OwnerAccount, # description required type

    [int]$Port, # description required type

    [string]$PreferredMaintenanceWindow, # description required type

    [bool]$PubliclyAccessible, # description required type

    [string]$SnapshotClusterIdentifier, # description required type

    [string]$SnapshotIdentifier, # description required type

    [string]$VpcSecurityGroupIds, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Redshift::Cluster" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AllowVersionUpgrade) {
    $rProperties.AllowVersionUpgrade = $AllowVersionUpgrade
  }
  if ($AutomatedSnapshotRetentionPeriod) {
    $rProperties.AutomatedSnapshotRetentionPeriod = $AutomatedSnapshotRetentionPeriod
  }
  if ($AvailabilityZone) {
    $rProperties.AvailabilityZone = $AvailabilityZone
  }
  if ($ClusterParameterGroupName) {
    $rProperties.ClusterParameterGroupName = $ClusterParameterGroupName
  }
  if ($ClusterSecurityGroups) {
    $rProperties.ClusterSecurityGroups = $ClusterSecurityGroups
  }
  if ($ClusterSubnetGroupName) {
    $rProperties.ClusterSubnetGroupName = $ClusterSubnetGroupName
  }
  if ($ClusterType) {
    $rProperties.ClusterType = $ClusterType
  }
  if ($ClusterVersion) {
    $rProperties.ClusterVersion = $ClusterVersion
  }
  if ($DBName) {
    $rProperties.DBName = $DBName
  }
  if ($ElasticIp) {
    $rProperties.ElasticIp = $ElasticIp
  }
  if ($Encrypted) {
    $rProperties.Encrypted = $Encrypted
  }
  if ($HsmClientCertificateIdentifier) {
    $rProperties.HsmClientCertificateIdentifier = $HsmClientCertificateIdentifier
  }
  if ($HsmConfigurationIdentifier) {
    $rProperties.HsmConfigurationIdentifier = $HsmConfigurationIdentifier
  }
  if ($KmsKeyId) {
    $rProperties.KmsKeyId = $KmsKeyId
  }
  if ($MasterUsername) {
    $rProperties.MasterUsername = $MasterUsername
  }
  if ($MasterUserPassword) {
    $rProperties.MasterUserPassword = $MasterUserPassword
  }
  if ($NodeType) {
    $rProperties.NodeType = $NodeType
  }
  if ($NumberOfNodes) {
    $rProperties.NumberOfNodes = $NumberOfNodes
  }
  if ($OwnerAccount) {
    $rProperties.OwnerAccount = $OwnerAccount
  }
  if ($Port) {
    $rProperties.Port = $Port
  }
  if ($PreferredMaintenanceWindow) {
    $rProperties.PreferredMaintenanceWindow = $PreferredMaintenanceWindow
  }
  if ($PubliclyAccessible) {
    $rProperties.PubliclyAccessible = $PubliclyAccessible
  }
  if ($SnapshotClusterIdentifier) {
    $rProperties.SnapshotClusterIdentifier = $SnapshotClusterIdentifier
  }
  if ($SnapshotIdentifier) {
    $rProperties.SnapshotIdentifier = $SnapshotIdentifier
  }
  if ($VpcSecurityGroupIds) {
    $rProperties.VpcSecurityGroupIds = $VpcSecurityGroupIds
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Redshift-Cluster -Value Add-CfnRedshift_ClusterResource

function Add-CfnRedshift_ClusterParameterGroupResource {
<#
.SYNOPSIS
Creates an Amazon Redshift parameter group that you can associate with an Amazon Redshift cluster. The parameters in the group apply to all the databases that you create in the cluster.
.PARAMETER Description
A description of the parameter group.
.PARAMETER ParameterGroupFamily
The Amazon Redshift engine version that applies to this cluster parameter group. The cluster engine version determines the set of parameters that you can specify in the Parameters property.
.PARAMETER Parameters
A description of the parameter group.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Redshift::ClusterParameterGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Description, # description required type

    [string]$ParameterGroupFamily, # description required type

    [System.Collections.IDictionary[]]$Parameters, #[array][System.Collections.IDictionary] array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Redshift::ClusterParameterGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($ParameterGroupFamily) {
    $rProperties.ParameterGroupFamily = $ParameterGroupFamily
  }
  if ($Parameters) {
    $rProperties.Parameters = $Parameters
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Redshift-ClusterParameterGroup -Value Add-CfnRedshift_ClusterParameterGroupResource

function Add-CfnRedshift_ClusterSecurityGroupResource {
<#
.SYNOPSIS
Creates an Amazon Redshift security group. You use security groups to control access to Amazon Redshift clusters that are not in a VPC.
.PARAMETER Description
A description of the security group.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Redshift::ClusterSecurityGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Description, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Redshift::ClusterSecurityGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Description) {
    $rProperties.Description = $Description
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Redshift-ClusterSecurityGroup -Value Add-CfnRedshift_ClusterSecurityGroupResource

function Add-CfnRedshift_ClusterSecurityGroupIngressResource {
<#
.SYNOPSIS
Specifies inbound (ingress) rules for an Amazon Redshift security group.
.PARAMETER CIDRIP
The IP address range that has inbound access to the Amazon Redshift security group.
.PARAMETER ClusterSecurityGroupName
The name of the Amazon Redshift security group that will be associated with the ingress rule.
.PARAMETER EC2SecurityGroupName
The Amazon EC2 security group that will be added the Amazon Redshift security group.
.PARAMETER EC2SecurityGroupOwnerId
The 12-digit AWS account number of the owner of the Amazon EC2 security group that is specified by the EC2SecurityGroupName parameter.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Redshift::ClusterSecurityGroupIngress
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$CIDRIP, # description required type

    [string]$ClusterSecurityGroupName, # description required resource-ref-type type

    [string]$EC2SecurityGroupName, # description required resource-ref-type type

    [string]$EC2SecurityGroupOwnerId, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Redshift::ClusterSecurityGroupIngress" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($CIDRIP) {
    $rProperties.CIDRIP = $CIDRIP
  }
  if ($ClusterSecurityGroupName) {
    $rProperties.ClusterSecurityGroupName = $ClusterSecurityGroupName
  }
  if ($EC2SecurityGroupName) {
    $rProperties.EC2SecurityGroupName = $EC2SecurityGroupName
  }
  if ($EC2SecurityGroupOwnerId) {
    $rProperties.EC2SecurityGroupOwnerId = $EC2SecurityGroupOwnerId
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Redshift-ClusterSecurityGroupIngress -Value Add-CfnRedshift_ClusterSecurityGroupIngressResource

function Add-CfnRedshift_ClusterSubnetGroupResource {
<#
.SYNOPSIS
Creates an Amazon Redshift subnet group. You must provide a list of one or more subnets in your existing Amazon VPC when creating an Amazon Redshift subnet group.
.PARAMETER Description
A description of the security group.
.PARAMETER SubnetIds
A list of VPC subnet IDs. You can modify a maximum of 20 subnets.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Redshift::ClusterSubnetGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Description, # description required type

    [string[]]$SubnetIds, #[array][string] array-type description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Redshift::ClusterSubnetGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Description) {
    $rProperties.Description = $Description
  }
  if ($SubnetIds) {
    $rProperties.SubnetIds = $SubnetIds
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Redshift-ClusterSubnetGroup -Value Add-CfnRedshift_ClusterSubnetGroupResource

function Add-CfnRoute53_HealthCheckResource {
<#
.SYNOPSIS
You can use the AWS::Route53::HealthCheck resource to check the health of your resources before Amazon Route 53 responds to a DNS query.
.PARAMETER HealthCheckConfig
An Amazon Route 53 health check.
.PARAMETER HealthCheckTags
The tags that you want to attach.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Route53::HealthCheck
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$HealthCheckConfig, # description properties required type

    [System.Collections.IDictionary]$HealthCheckTags, # array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Route53::HealthCheck" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($HealthCheckConfig) {
    $rProperties.HealthCheckConfig = $HealthCheckConfig
  }
  if ($HealthCheckTags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $HealthCheckTags.Keys) {
      $t = @{ Key = $tk }
      $tv = $HealthCheckTags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.HealthCheckTags = $tagsList
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Route53-HealthCheck -Value Add-CfnRoute53_HealthCheckResource

function Add-CfnRoute53_HostedZoneResource {
<#
.SYNOPSIS
The AWS::Route53::HostedZone resource creates a hosted zone, which can contain a collection of record sets for a domain.
.PARAMETER HostedZoneConfig
A complex type that contains an optional comment about your hosted zone.
.PARAMETER HostedZoneTags
The tags that you want to attach.
.PARAMETER Name
The name of the domain. For resource record types that include a domain name, specify a fully qualified domain name.
.PARAMETER VPCs
One or more VPCs that you want to associate with this hosted zone. When you specify this property, AWS CloudFormation creates a private hosted zone.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Route53::HostedZone
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$HostedZoneConfig, # description properties required type

    [System.Collections.IDictionary]$HostedZoneTags, # array-type description properties required type

    [string]$Name, # description required type

    [System.Collections.IDictionary[]]$VPCs, #[array][System.Collections.IDictionary] array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Route53::HostedZone" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($HostedZoneConfig) {
    $rProperties.HostedZoneConfig = $HostedZoneConfig
  }
  if ($HostedZoneTags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $HostedZoneTags.Keys) {
      $t = @{ Key = $tk }
      $tv = $HostedZoneTags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.HostedZoneTags = $tagsList
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  if ($VPCs) {
    $rProperties.VPCs = $VPCs
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Route53-HostedZone -Value Add-CfnRoute53_HostedZoneResource

function Add-CfnRoute53_RecordSetResource {
<#
.SYNOPSIS
The AWS::Route53::RecordSet type can be used as a standalone resource or as an embedded property in the AWS::Route53::RecordSetGroup type.
.PARAMETER AliasTarget
Alias resource record sets only: Information about the domain to which you are redirecting traffic. Required: Conditional. Required if you are creating an alias resource record set.
.PARAMETER Comment
Any comments you want to include about the hosted zone.
.PARAMETER Failover
Designates the record set as a PRIMARY or SECONDARY failover record set.
.PARAMETER GeoLocation
Describes how Amazon Route 53 responds to DNS queries based on the geographic origin of the query.
.PARAMETER HostedZoneId
The ID of the hosted zone. Required: Conditional. You must specify either the HostedZoneName or HostedZoneId, but you cannot specify both.
.PARAMETER HostedZoneName
The name of the domain for the hosted zone where you want to add the record set. Required: Conditional. You must specify either the HostedZoneName or HostedZoneId, but you cannot specify both.
.PARAMETER Name
The name of the domain. This must be a fully-specified domain, ending with a period as the last label indication. If you omit the final period, Amazon Route 53 assumes the domain is relative to the root.
.PARAMETER Region
Latency resource record sets only: The Amazon EC2 region where the resource that is specified in this resource record set resides. The resource typically is an AWS resource, for example, Amazon EC2 instance or an Elastic Load Balancing load balancer, and is referred to by an IP address or a DNS domain name, depending on the record type.
.PARAMETER ResourceRecords
List of resource records to add. Each record should be in the format appropriate for the record type specified by the Type property. Required: Conditional. Required if TTL is specified.
.PARAMETER SetIdentifier
A unique identifier that differentiates among multiple resource record sets that have the same combination of DNS name and type. Required: Conditional. Required if you are creating a weighted resource record set.
.PARAMETER TTL
The resource record cache time to live (TTL), in seconds. If TTL is specified, ResourceRecords is also required.
.PARAMETER Type
The type of records to add.
.PARAMETER Weight
Weighted resource record sets only: Among resource record sets that have the same combination of DNS name and type, a value that determines what portion of traffic for the current resource record set is routed to the associated location. Required: Conditional. Required if you are creating a weighted resource record set.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Route53::RecordSet
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$AliasTarget, # description properties required type

    [string]$Comment, # description required type

    [ValidateSet('PRIMARY','SECONDARY')]
    [string]$Failover, # allowed-values description required type

    [System.Collections.IDictionary]$GeoLocation, # description properties required type

    [string]$HostedZoneId, # description required type

    [string]$HostedZoneName, # description required type

    [string]$Name, # description required type

    [string]$Region, # description required type

    [string[]]$ResourceRecords, #[array][string] array-type description required resource-ref-type type

    [string]$SetIdentifier, # description required type

    [string]$TTL, # description required type

    [ValidateSet('A','AAAA','CNAME','MX','NS','PTR','SOA','SPF','SRV','TXT')]
    [string]$Type, # allowed-values description required type

    [int]$Weight, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Route53::RecordSet" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AliasTarget) {
    $rProperties.AliasTarget = $AliasTarget
  }
  if ($Comment) {
    $rProperties.Comment = $Comment
  }
  if ($Failover) {
    $rProperties.Failover = $Failover
  }
  if ($GeoLocation) {
    $rProperties.GeoLocation = $GeoLocation
  }
  if ($HostedZoneId) {
    $rProperties.HostedZoneId = $HostedZoneId
  }
  if ($HostedZoneName) {
    $rProperties.HostedZoneName = $HostedZoneName
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  if ($Region) {
    $rProperties.Region = $Region
  }
  if ($ResourceRecords) {
    $rProperties.ResourceRecords = $ResourceRecords
  }
  if ($SetIdentifier) {
    $rProperties.SetIdentifier = $SetIdentifier
  }
  if ($TTL) {
    $rProperties.TTL = $TTL
  }
  if ($Type) {
    $rProperties.Type = $Type
  }
  if ($Weight) {
    $rProperties.Weight = $Weight
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Route53-RecordSet -Value Add-CfnRoute53_RecordSetResource

function Add-CfnRoute53_RecordSetGroupResource {
<#
.SYNOPSIS
Creates or updates a new Amazon Route 53RecordSetGroup.
.PARAMETER Comment
Any comments you want to include about the hosted zone.
.PARAMETER HostedZoneId
The ID of the hosted zone. Required: Conditional: You must specify either the HostedZoneName or HostedZoneId, but you cannot specify both.
.PARAMETER HostedZoneName
The name of the domain for the hosted zone where you want to add the record set. Required: Conditional. You must specify either the HostedZoneName or HostedZoneId, but you cannot specify both.
.PARAMETER RecordSets
List of resource record sets to add.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::Route53::RecordSetGroup
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Comment, # description required type

    [string]$HostedZoneId, # description required type

    [string]$HostedZoneName, # description required type

    [System.Collections.IDictionary[]]$RecordSets, #[array][System.Collections.IDictionary] array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::Route53::RecordSetGroup" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Comment) {
    $rProperties.Comment = $Comment
  }
  if ($HostedZoneId) {
    $rProperties.HostedZoneId = $HostedZoneId
  }
  if ($HostedZoneName) {
    $rProperties.HostedZoneName = $HostedZoneName
  }
  if ($RecordSets) {
    $rProperties.RecordSets = $RecordSets
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-Route53-RecordSetGroup -Value Add-CfnRoute53_RecordSetGroupResource

function Add-CfnS3_BucketResource {
<#
.SYNOPSIS
The AWS::S3::Bucket type creates an Amazon S3 bucket.
.PARAMETER AccessControl
A canned ACL that grants predefined permissions on the bucket. Default is Private.
.PARAMETER BucketName
A name for the bucket. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the bucket name.
.PARAMETER CorsConfiguration
Rules that define cross-origin resource sharing of objects in this bucket.
.PARAMETER LifecycleConfiguration
Rules that define how Amazon S3 manages objects during their lifetime.
.PARAMETER LoggingConfiguration
Settings that defines where logs are stored.
.PARAMETER NotificationConfiguration
Configuration that defines which Amazon SNS topic to send messages to and what events to report.
.PARAMETER ReplicationConfiguration
Configuration for replicating objects in an S3 bucket. To enable replication, you must also enable versioning by using the VersioningConfiguration property.
.PARAMETER Tags
The tags that you want to attach.
.PARAMETER VersioningConfiguration
Enables multiple variants of all objects in this bucket. You might enable versioning to prevent objects from being deleted or overwritten by mistake or to archive objects so that you can retrieve previous versions of them.
.PARAMETER WebsiteConfiguration
Information used to configure the bucket as a static website.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::S3::Bucket
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [ValidateSet('*','Private','PublicRead','PublicReadWrite','AuthenticatedRead','LogDeliveryWrite','BucketOwnerRead','BucketOwnerFullControl')]
    [string]$AccessControl, # allowed-values description required type

    [string]$BucketName, # description required type

    [System.Collections.IDictionary]$CorsConfiguration, # description properties required type

    [System.Collections.IDictionary]$LifecycleConfiguration, # description properties required type

    [System.Collections.IDictionary]$LoggingConfiguration, # description properties required type

    [System.Collections.IDictionary]$NotificationConfiguration, # description properties required type

    [System.Collections.IDictionary]$ReplicationConfiguration, # description properties required type

    [System.Collections.IDictionary]$Tags, # array-type description properties required type

    [System.Collections.IDictionary]$VersioningConfiguration, # description properties required type

    [System.Collections.IDictionary]$WebsiteConfiguration, # description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::S3::Bucket" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($AccessControl) {
    $rProperties.AccessControl = $AccessControl
  }
  if ($BucketName) {
    $rProperties.BucketName = $BucketName
  }
  if ($CorsConfiguration) {
    $rProperties.CorsConfiguration = $CorsConfiguration
  }
  if ($LifecycleConfiguration) {
    $rProperties.LifecycleConfiguration = $LifecycleConfiguration
  }
  if ($LoggingConfiguration) {
    $rProperties.LoggingConfiguration = $LoggingConfiguration
  }
  if ($NotificationConfiguration) {
    $rProperties.NotificationConfiguration = $NotificationConfiguration
  }
  if ($ReplicationConfiguration) {
    $rProperties.ReplicationConfiguration = $ReplicationConfiguration
  }
  if ($Tags) {
    $tagsList = New-Object System.Collections.ArrayList
    foreach ($tk in $Tags.Keys) {
      $t = @{ Key = $tk }
      $tv = $Tags[$tk]
      $t.Value = $tv
      $tagsList += $t
    }
    $rProperties.Tags = $tagsList
  }
  if ($VersioningConfiguration) {
    $rProperties.VersioningConfiguration = $VersioningConfiguration
  }
  if ($WebsiteConfiguration) {
    $rProperties.WebsiteConfiguration = $WebsiteConfiguration
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-S3-Bucket -Value Add-CfnS3_BucketResource

function Add-CfnS3_BucketPolicyResource {
<#
.SYNOPSIS
The AWS::S3::BucketPolicy type applies a policy to an Amazon S3 bucket.
.PARAMETER Bucket
Name of the bucket to which you want to add the policy.
.PARAMETER PolicyDocument
A policy document containing permissions to add to the specified SNS topics.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::S3::BucketPolicy
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Bucket, # description required resource-ref-type type

    [object]$PolicyDocument, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::S3::BucketPolicy" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Bucket) {
    $rProperties.Bucket = $Bucket
  }
  if ($PolicyDocument) {
    $rProperties.PolicyDocument = $PolicyDocument
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-S3-BucketPolicy -Value Add-CfnS3_BucketPolicyResource

function Add-CfnSDB_DomainResource {
<#
.SYNOPSIS
The AWS::SDB::Domain creates a Amazon SimpleDB Domain.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::SDB::Domain
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::SDB::Domain" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-SDB-Domain -Value Add-CfnSDB_DomainResource

function Add-CfnSNS_TopicResource {
<#
.SYNOPSIS
The AWS::SNS::Topic type creates an Amazon SNS topic.
.PARAMETER DisplayName
The human-readable name used in the "From" field for notifications to email and email-json endpoints
.PARAMETER Subscription
Array of SNS Subscription type.
.PARAMETER TopicName
A name for the topic. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the topic name.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::SNS::Topic
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$DisplayName, # description required type

    [System.Collections.IDictionary[]]$Subscription, #[array][System.Collections.IDictionary] array-type description properties required type

    [string]$TopicName, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::SNS::Topic" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($DisplayName) {
    $rProperties.DisplayName = $DisplayName
  }
  if ($Subscription) {
    $rProperties.Subscription = $Subscription
  }
  if ($TopicName) {
    $rProperties.TopicName = $TopicName
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-SNS-Topic -Value Add-CfnSNS_TopicResource

function Add-CfnSNS_TopicPolicyResource {
<#
.SYNOPSIS
The AWS::SNS::TopicPolicy type applies a policy to SNS topics.
.PARAMETER PolicyDocument
A policy document containing permissions to add to the specified SNS topics.
.PARAMETER Topics
The Amazon Resource Names (ARN) of the topics to which you want to add the policy.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::SNS::TopicPolicy
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [object]$PolicyDocument, # description required type

    [string[]]$Topics, #[array][string] array-type description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::SNS::TopicPolicy" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($PolicyDocument) {
    $rProperties.PolicyDocument = $PolicyDocument
  }
  if ($Topics) {
    $rProperties.Topics = $Topics
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-SNS-TopicPolicy -Value Add-CfnSNS_TopicPolicyResource

function Add-CfnSQS_QueueResource {
<#
.SYNOPSIS
The AWS::SQS::Queue type creates an Amazon SQS queue.
.PARAMETER DelaySeconds
The time in seconds that the delivery of all messages in the queue will be delayed. You can specify an integer value of 0 to 900 (15 minutes). The default value is 0.
.PARAMETER MaximumMessageSize
The limit of how many bytes a message can contain before Amazon SQS rejects it.
.PARAMETER MessageRetentionPeriod
The number of seconds Amazon SQS retains a message.
.PARAMETER QueueName
A name for the queue. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the queue name.
.PARAMETER ReceiveMessageWaitTimeSeconds
Specifies the duration, in seconds, that the ReceiveMessage action call waits until a message is in the queue to include in the response, as opposed to returning an empty response if a message is not yet available to return.
.PARAMETER RedrivePolicy
Specifies an existing dead letter queue to receive messages after the source queue (this queue) fails to process a message a specified number of times.
.PARAMETER VisibilityTimeout
The length of time during which the queue will be unavailable once a message is delivered from the queue. This blocks other components from receiving the same message and gives the initial component time to process and delete the message from the queue. Values must be from 0 to 43200 seconds (12 hours). If no value is specified, the default value of 30 seconds will be used.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::SQS::Queue
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [int]$DelaySeconds, # description required type

    [int]$MaximumMessageSize, # description required type

    [int]$MessageRetentionPeriod, # description required type

    [string]$QueueName, # description required type

    [int]$ReceiveMessageWaitTimeSeconds, # description required type

    [System.Collections.IDictionary]$RedrivePolicy, # description properties required type

    [int]$VisibilityTimeout, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::SQS::Queue" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($DelaySeconds) {
    $rProperties.DelaySeconds = $DelaySeconds
  }
  if ($MaximumMessageSize) {
    $rProperties.MaximumMessageSize = $MaximumMessageSize
  }
  if ($MessageRetentionPeriod) {
    $rProperties.MessageRetentionPeriod = $MessageRetentionPeriod
  }
  if ($QueueName) {
    $rProperties.QueueName = $QueueName
  }
  if ($ReceiveMessageWaitTimeSeconds) {
    $rProperties.ReceiveMessageWaitTimeSeconds = $ReceiveMessageWaitTimeSeconds
  }
  if ($RedrivePolicy) {
    $rProperties.RedrivePolicy = $RedrivePolicy
  }
  if ($VisibilityTimeout) {
    $rProperties.VisibilityTimeout = $VisibilityTimeout
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-SQS-Queue -Value Add-CfnSQS_QueueResource

function Add-CfnSQS_QueuePolicyResource {
<#
.SYNOPSIS
The AWS::SQS::QueuePolicy type applies a policy to SQS queues.
.PARAMETER PolicyDocument
A policy document containing permissions to add to the specified SQS queues.
.PARAMETER Queues
The URLs of the queues to which you want to add the policy.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::SQS::QueuePolicy
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [object]$PolicyDocument, # description required type

    [string[]]$Queues, #[array][string] array-type description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::SQS::QueuePolicy" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($PolicyDocument) {
    $rProperties.PolicyDocument = $PolicyDocument
  }
  if ($Queues) {
    $rProperties.Queues = $Queues
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-SQS-QueuePolicy -Value Add-CfnSQS_QueuePolicyResource

function Add-CfnSSM_DocumentResource {
<#
.SYNOPSIS
The AWS::SSM::Document resource creates an Amazon EC2 Simple Systems Manager (SSM) document that describes an instance configuration, which you can use to set up and run commands on your instances.
.PARAMETER Content
A JSON object that describes an instance configuration.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::SSM::Document
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [object]$Content, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::SSM::Document" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Content) {
    $rProperties.Content = $Content
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-SSM-Document -Value Add-CfnSSM_DocumentResource

function Add-CfnWAF_ByteMatchSetResource {
<#
.SYNOPSIS
The AWS::WAF::ByteMatchSet resource creates an AWS WAF ByteMatchSet that identifies a part of a web request that you want to inspect.
.PARAMETER ByteMatchTuples
Settings for the ByteMatchSet, such as the bytes (typically a string that corresponds with ASCII characters) that you want AWS WAF to search for in web requests.
.PARAMETER Name
A friendly name or description of the ByteMatchSet.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::WAF::ByteMatchSet
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$ByteMatchTuples, # description properties required type

    [string]$Name, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::WAF::ByteMatchSet" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($ByteMatchTuples) {
    $rProperties.ByteMatchTuples = $ByteMatchTuples
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-WAF-ByteMatchSet -Value Add-CfnWAF_ByteMatchSetResource

function Add-CfnWAF_IPSetResource {
<#
.SYNOPSIS
The AWS::WAF::IPSet resource creates an AWS WAF IPSet that specifies which web requests to permit or block based on the IP addresses from which the requests originate.
.PARAMETER IPSetDescriptors
The IP address type and IP address range (in CIDR notation) from which web requests originate.
.PARAMETER Name
A friendly name or description of the IPSet.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::WAF::IPSet
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$IPSetDescriptors, # description properties required type

    [string]$Name, # description required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::WAF::IPSet" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($IPSetDescriptors) {
    $rProperties.IPSetDescriptors = $IPSetDescriptors
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-WAF-IPSet -Value Add-CfnWAF_IPSetResource

function Add-CfnWAF_RuleResource {
<#
.SYNOPSIS
The AWS::WAF::Rule resource creates an AWS WAF rule that specifies a combination of IPSet, ByteMatchSet, and SqlInjectionMatchSet objects that identify the web requests to allow, block, or count.
.PARAMETER MetricName
A friendly name or description for the metrics of this rule.
.PARAMETER Name
A friendly name or description of the rule.
.PARAMETER Predicates
The ByteMatchSet, IPSet, or SqlInjectionMatchSet objects to include in a rule.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::WAF::Rule
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$MetricName, # description required type

    [string]$Name, # description required type

    [System.Collections.IDictionary[]]$Predicates, #[array][System.Collections.IDictionary] array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::WAF::Rule" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($MetricName) {
    $rProperties.MetricName = $MetricName
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  if ($Predicates) {
    $rProperties.Predicates = $Predicates
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-WAF-Rule -Value Add-CfnWAF_RuleResource

function Add-CfnWAF_SqlInjectionMatchSetResource {
<#
.SYNOPSIS
The AWS::WAF::IPSet resource creates an AWS WAF SqlInjectionMatchSet, which you use to allow, block, or count requests that contain malicious SQL code in a specific part of web requests.
.PARAMETER Name
A friendly name or description of the SqlInjectionMatchSet.
.PARAMETER SqlInjectionMatchTuples
The parts of web requests that you want AWS WAF to inspect for malicious SQL code and, if you want AWS WAF to inspect a header, the name of the header.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::WAF::SqlInjectionMatchSet
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$Name, # description required type

    [System.Collections.IDictionary]$SqlInjectionMatchTuples, # description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::WAF::SqlInjectionMatchSet" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($Name) {
    $rProperties.Name = $Name
  }
  if ($SqlInjectionMatchTuples) {
    $rProperties.SqlInjectionMatchTuples = $SqlInjectionMatchTuples
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-WAF-SqlInjectionMatchSet -Value Add-CfnWAF_SqlInjectionMatchSetResource

function Add-CfnWAF_WebACLResource {
<#
.SYNOPSIS
The AWS::WAF::WebACL resource creates an AWS WAF web access control group (ACL) containing the rules that identify the Amazon CloudFront (CloudFront) web requests that you want to allow, block, or count.
.PARAMETER DefaultAction
The action that you want AWS WAF to take when a request doesn't match the criteria in any of the rules that are associated with the web ACL.
.PARAMETER MetricName
A friendly name or description for the Amazon CloudWatch metric of this web ACL.
.PARAMETER Name
A friendly name or description of the web ACL.
.PARAMETER Rules
The rules to associate with the web ACL and the settings for each rule.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::WAF::WebACL
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [System.Collections.IDictionary]$DefaultAction, # description properties required type

    [string]$MetricName, # description required type

    [string]$Name, # description required type

    [System.Collections.IDictionary[]]$Rules, #[array][System.Collections.IDictionary] array-type description properties required type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::WAF::WebACL" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($DefaultAction) {
    $rProperties.DefaultAction = $DefaultAction
  }
  if ($MetricName) {
    $rProperties.MetricName = $MetricName
  }
  if ($Name) {
    $rProperties.Name = $Name
  }
  if ($Rules) {
    $rProperties.Rules = $Rules
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-WAF-WebACL -Value Add-CfnWAF_WebACLResource

function Add-CfnWorkSpaces_WorkspaceResource {
<#
.SYNOPSIS
The AWS::WorkSpaces::Workspace resource creates an Amazon WorkSpaces workspace, which is a cloud-based desktop experience for end users.
.PARAMETER BundleId
The identifier of the bundle from which you want to create the workspace.
.PARAMETER DirectoryId
The identifier of the AWS Directory Service directory in which you want to create the workspace.
.PARAMETER RootVolumeEncryptionEnabled
Indicates whether Amazon WorkSpaces encrypts data stored on the root volume (C: drive).
.PARAMETER UserName
The name of the user to which the workspace is assigned.
.PARAMETER UserVolumeEncryptionEnabled
Indicates whether Amazon WorkSpaces encrypts data stored on the user volume (D: drive).
.PARAMETER VolumeEncryptionKey
The AWS Key Management Service (AWS KMS) key ID that Amazon WorkSpaces uses to encrypt data stored on your workspace.
.PARAMETER DeletionPolicy
With the DeletionPolicy attribute you can preserve or (in some cases) backup a resource when its stack is deleted. You specify a DeletionPolicy attribute for each resource that you want to control. If a resource has no DeletionPolicy attribute, AWS CloudFormation deletes the resource by default.
 
To keep a resource when its stack is deleted, specify Retain for that resource. You can use retain for any resource. For example, you can retain a nested stack, S3 bucket, or EC2 instance so that you can continue to use or modify those resources after you delete their stacks.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-deletionpolicy.html
.PARAMETER Metadata
The Metadata attribute enables you to associate structured data with a resource. By adding a Metadata attribute to a resource, you can add data in JSON format to the resource declaration. In addition, you can use intrinsic functions (such as GetAtt and Ref), parameters, and pseudo parameters within the Metadata attribute to add those interpreted values.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-metadata.html
.PARAMETER DependsOn
With the DependsOn attribute you can specify that the creation of a specific resource follows another. When you add a DependsOn attribute to a resource, that resource is created only after the creation of the resource specified in the DependsOn attribute. You can use the DependsOn attribute with any resource.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html
.PARAMETER PropertiesBlock
Allows you to declare a block of one or more Property statements.
 
A Properties block allows you to side-step the rigid, type-enforced literal properties of a typed resource, and specify Property assignments that may include CloudFormation function calls or references, or computed values.
 
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html
.LINK
http://docs.aws.amazon.com/search/doc-search.html?searchPath=documentation&searchQuery=AWS::WorkSpaces::Workspace
#>


  param(
    [Parameter(Mandatory,Position=0)]
    [string]$ResourceName,

    [string]$BundleId, # description required type

    [string]$DirectoryId, # description required resource-ref-type type

    [bool]$RootVolumeEncryptionEnabled, # description required type

    [string]$UserName, # description required type

    [bool]$UserVolumeEncryptionEnabled, # description required type

    [string]$VolumeEncryptionKey, # description required resource-ref-type type

    [ValidateSet('Delete','Retain')]
    [string]$DeletionPolicy,
    [hashtable]$Metadata,
    [array]$DependsOn,
    [Parameter(Position=1)]
    [scriptblock]$PropertiesBlock
,

    [object]$Condition
  )

  $tResources = [System.Collections.IDictionary](Get-Variable -Name "tResources" -ValueOnly)
  if (-not $tResources) {
    throw "Template Resrouces collection is not in scope"
  }

  if ($tResources.Contains($ResourceName)) {
    throw "Duplicate Resource name [$ResourceName]"
  }

  $r = [ordered]@{ Type = "AWS::WorkSpaces::Workspace" }
  $rProperties = [ordered]@{}

    ## Resource Properties
  if ($BundleId) {
    $rProperties.BundleId = $BundleId
  }
  if ($DirectoryId) {
    $rProperties.DirectoryId = $DirectoryId
  }
  if ($RootVolumeEncryptionEnabled) {
    $rProperties.RootVolumeEncryptionEnabled = $RootVolumeEncryptionEnabled
  }
  if ($UserName) {
    $rProperties.UserName = $UserName
  }
  if ($UserVolumeEncryptionEnabled) {
    $rProperties.UserVolumeEncryptionEnabled = $UserVolumeEncryptionEnabled
  }
  if ($VolumeEncryptionKey) {
    $rProperties.VolumeEncryptionKey = $VolumeEncryptionKey
  }
  ## Resource Attributes
  if ($DeletionPolicy) {
    $r.DeletionPolicy = $DeletionPolicy
  }
  if ($Metadata) {
    $r.Metadata = $Metadata
  }
  if ($DependsOn) {
    $r.DependsOn = $DependsOn
  }
  if ($PropertiesBlock) {
    & $PropertiesBlock
  }


  if ($Condition) {
    $r.Condition = $Condition
  }

  if ($rProperties -and $rProperties.Count) {
    $r.Properties = $rProperties
  }

  $tResources.Add($ResourceName, $r)
}
Set-Alias -Name Res-WorkSpaces-Workspace -Value Add-CfnWorkSpaces_WorkspaceResource