VaporShell.OpsWorks.psm1

# PSM1 Contents
function Format-Json {
    [CmdletBinding()]
    Param (
        [Parameter(Mandatory = $true, Position = 0, ValueFromPipeline = $true)]
        [String]
        $Json
    )
    Begin {
        $cleaner = {
            param([String]$Line)
            Process{
                [Regex]::Replace(
                    $Line,
                    "\\u(?<Value>[a-zA-Z0-9]{4})",
                    {
                        param($m)([char]([int]::Parse(
                            $m.Groups['Value'].Value,
                            [System.Globalization.NumberStyles]::HexNumber
                        ))).ToString()
                    }
                )
            }
        }
    }
    Process {
        if ($PSVersionTable.PSVersion.Major -lt 6) {
            try {
                $indent = 0;
                $res = $Json -split '\n' | ForEach-Object {
                    if ($_ -match '[\}\]]') {
                        # This line contains ] or }, decrement the indentation level
                        $indent--
                    }
                    $line = (' ' * $indent * 2) + $_.TrimStart().Replace(': ', ': ')
                    if ($_ -match '[\{\[]') {
                        # This line contains [ or {, increment the indentation level
                        $indent++
                    }
                    $cleaner.Invoke($line)
                }
                $res -join "`n"
            }
            catch {
                ($Json -split '\n' | ForEach-Object {$cleaner.Invoke($_)}) -join "`n"
            }
        }
        else {
            ($Json -split '\n' | ForEach-Object {$cleaner.Invoke($_)}) -join "`n"
        }
    }
}

function Get-TrueCount {
    Param
    (
        [parameter(Mandatory = $false,Position = 0,ValueFromPipeline = $true)]
        $Array
    )
    Process {
        if ($array) {
            if ($array.Count) {
                $count = $array.Count
            }
            else {
                $count = 1
            }
        }
        else {
            $count = 0
        }
    }
    End {
        return $count
    }
}

function New-VSError {
    <#
    .SYNOPSIS
    Error generator function to use in tandem with $PSCmdlet.ThrowTerminatingError()
    
    .PARAMETER Result
    Allows input of an error from AWS SDK, resulting in the Exception message being parsed out.
    
    .PARAMETER String
    Used to create basic String message errors in the same wrapper
    #>

    [cmdletbinding(DefaultParameterSetName="Result")]
    param(
        [parameter(Position=0,ParameterSetName="Result")]
        $Result,
        [parameter(Position=0,ParameterSetName="String")]
        $String
    )
    switch ($PSCmdlet.ParameterSetName) {
        Result { $Exception = "$($result.Exception.InnerException.Message)" }
        String { $Exception = "$String" }
    }
    $e = New-Object "System.Exception" $Exception
    $errorRecord = New-Object 'System.Management.Automation.ErrorRecord' $e, $null, ([System.Management.Automation.ErrorCategory]::InvalidOperation), $null
    return $errorRecord
}

function ResolveS3Endpoint {
    <#
    .SYNOPSIS
    Resolves the S3 endpoint most appropriate for each region.
    #>

    Param
    (
      [parameter(Mandatory=$true,Position=0)]
      [ValidateSet("eu-west-2","ap-south-1","us-east-2","sa-east-1","us-west-1","us-west-2","eu-west-1","ap-southeast-2","ca-central-1","ap-northeast-2","us-east-1","eu-central-1","ap-southeast-1","ap-northeast-1")]
      [String]
      $Region
    )
    $endpointMap = @{
        "us-east-2" = "s3.us-east-2.amazonaws.com"
        "us-east-1" = "s3.amazonaws.com"
        "us-west-1" = "s3-us-west-1.amazonaws.com"
        "us-west-2" = "s3-us-west-2.amazonaws.com"
        "ca-central-1" = "s3.ca-central-1.amazonaws.com"
        "ap-south-1" = "s3.ap-south-1.amazonaws.com"
        "ap-northeast-2" = "s3.ap-northeast-2.amazonaws.com"
        "ap-southeast-1" = "s3-ap-southeast-1.amazonaws.com"
        "ap-southeast-2" = "s3-ap-southeast-2.amazonaws.com"
        "ap-northeast-1" = "s3-ap-northeast-1.amazonaws.com"
        "eu-central-1" = "s3.eu-central-1.amazonaws.com"
        "eu-west-1" = "s3-eu-west-1.amazonaws.com"
        "eu-west-2" = "s3.eu-west-2.amazonaws.com"
        "sa-east-1" = "s3-sa-east-1.amazonaws.com"
    }
    return $endpointMap[$Region]
}

function Add-VSOpsWorksAppDataSource {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::App.DataSource resource property to the template. Describes an app's data source.

    .DESCRIPTION
        Adds an AWS::OpsWorks::App.DataSource resource property to the template.
Describes an app's data source.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-app-datasource.html

    .PARAMETER Arn
        The data source's ARN.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-app-datasource.html#cfn-opsworks-app-datasource-arn
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER DatabaseName
        The database name.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-app-datasource.html#cfn-opsworks-app-datasource-databasename
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Type
        The data source's type, AutoSelectOpsworksMysqlInstance, OpsworksMysqlInstance, RdsDbInstance, or None.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-app-datasource.html#cfn-opsworks-app-datasource-type
        PrimitiveType: String
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksAppDataSource])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $false)]
        [object]
        $Arn,
        [parameter(Mandatory = $false)]
        [object]
        $DatabaseName,
        [parameter(Mandatory = $false)]
        [object]
        $Type
    )
    Process {
        $obj = [OpsWorksAppDataSource]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksAppDataSource'

function Add-VSOpsWorksAppEnvironmentVariable {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::App.EnvironmentVariable resource property to the template. Represents an app's environment variable.

    .DESCRIPTION
        Adds an AWS::OpsWorks::App.EnvironmentVariable resource property to the template.
Represents an app's environment variable.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-app-environment.html

    .PARAMETER Key
        Required The environment variable's name, which can consist of up to 64 characters and must be specified. The name can contain upper- and lowercase letters, numbers, and underscores _, but it must start with a letter or underscore.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-app-environment.html#cfn-opsworks-app-environment-key
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Secure
        Optional Whether the variable's value will be returned by the DescribeApps: https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeApps action. To conceal an environment variable's value, set Secure to true. DescribeApps then returns *****FILTERED***** instead of the actual value. The default value for Secure is false.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-app-environment.html#cfn-opsworks-app-environment-secure
        PrimitiveType: Boolean
        UpdateType: Mutable

    .PARAMETER Value
        Optional The environment variable's value, which can be left empty. If you specify a value, it can contain up to 256 characters, which must all be printable.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-app-environment.html#value
        PrimitiveType: String
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksAppEnvironmentVariable])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $true)]
        [object]
        $Key,
        [parameter(Mandatory = $false)]
        [object]
        $Secure,
        [parameter(Mandatory = $true)]
        [object]
        $Value
    )
    Process {
        $obj = [OpsWorksAppEnvironmentVariable]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksAppEnvironmentVariable'

function Add-VSOpsWorksAppSource {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::App.Source resource property to the template. Contains the information required to retrieve an app or cookbook from a repository. For more information, see Creating Apps: https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html or Custom Recipes and Cookbooks: https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html.

    .DESCRIPTION
        Adds an AWS::OpsWorks::App.Source resource property to the template.
Contains the information required to retrieve an app or cookbook from a repository. For more information, see Creating Apps: https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html or Custom Recipes and Cookbooks: https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-source.html

    .PARAMETER Password
        When included in a request, the parameter depends on the repository type.
+ For Amazon S3 bundles, set Password to the appropriate IAM secret access key.
+ For HTTP bundles and Subversion repositories, set Password to the password.
For more information on how to safely handle IAM credentials, see https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html: https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html.
In responses, AWS OpsWorks Stacks returns *****FILTERED***** instead of the actual value.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-source.html#cfn-opsworks-custcookbooksource-pw
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Revision
        The application's version. AWS OpsWorks Stacks enables you to easily deploy new versions of an application. One of the simplest approaches is to have branches or revisions in your repository that represent different versions that can potentially be deployed.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-source.html#cfn-opsworks-custcookbooksource-revision
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER SshKey
        The repository's SSH key. For more information, see Using Git Repository SSH Keys: https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-deploykeys.html in the *AWS OpsWorks User Guide*. To pass in an SSH key as a parameter, see the following example:
"Parameters" : { "GitSSHKey" : { "Description" : "Change SSH key newlines to commas.", "Type" : "CommaDelimitedList", "NoEcho" : "true" }, ... "CustomCookbooksSource": { "Revision" : { "Ref": "GitRevision"}, "SshKey" : { "Fn::Join" : "n", { "Ref": "GitSSHKey"} ] }, "Type": "git", "Url": { "Ref": "GitURL"} } ...

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-source.html#cfn-opsworks-custcookbooksource-sshkey
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Type
        The repository type.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-source.html#cfn-opsworks-custcookbooksource-type
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Url
        The source URL. The following is an example of an Amazon S3 source URL: https://s3.amazonaws.com/opsworks-demo-bucket/opsworks_cookbook_demo.tar.gz.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-source.html#cfn-opsworks-custcookbooksource-url
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Username
        This parameter depends on the repository type.
+ For Amazon S3 bundles, set Username to the appropriate IAM access key ID.
+ For HTTP bundles, Git repositories, and Subversion repositories, set Username to the user name.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-source.html#cfn-opsworks-custcookbooksource-username
        PrimitiveType: String
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksAppSource])]
    [cmdletbinding()]
    [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingPlainTextForPassword","Password")]
    [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingUserNameAndPasswordParams","Password")]
    Param(
        [parameter(Mandatory = $false)]
        [object]
        $Password,
        [parameter(Mandatory = $false)]
        [object]
        $Revision,
        [parameter(Mandatory = $false)]
        [object]
        $SshKey,
        [parameter(Mandatory = $false)]
        [object]
        $Type,
        [parameter(Mandatory = $false)]
        [object]
        $Url,
        [parameter(Mandatory = $false)]
        [object]
        $Username
    )
    Process {
        $obj = [OpsWorksAppSource]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksAppSource'

function Add-VSOpsWorksAppSslConfiguration {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::App.SslConfiguration resource property to the template. Describes an app's SSL configuration.

    .DESCRIPTION
        Adds an AWS::OpsWorks::App.SslConfiguration resource property to the template.
Describes an app's SSL configuration.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-app-sslconfiguration.html

    .PARAMETER Certificate
        The contents of the certificate's domain.crt file.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-app-sslconfiguration.html#cfn-opsworks-app-sslconfig-certificate
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Chain
        Optional. Can be used to specify an intermediate certificate authority key or client authentication.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-app-sslconfiguration.html#cfn-opsworks-app-sslconfig-chain
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER PrivateKey
        The private key; the contents of the certificate's domain.kex file.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-app-sslconfiguration.html#cfn-opsworks-app-sslconfig-privatekey
        PrimitiveType: String
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksAppSslConfiguration])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $false)]
        [object]
        $Certificate,
        [parameter(Mandatory = $false)]
        [object]
        $Chain,
        [parameter(Mandatory = $false)]
        [object]
        $PrivateKey
    )
    Process {
        $obj = [OpsWorksAppSslConfiguration]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksAppSslConfiguration'

function Add-VSOpsWorksInstanceBlockDeviceMapping {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Instance.BlockDeviceMapping resource property to the template. Describes a block device mapping. This data type maps directly to the Amazon EC2 BlockDeviceMapping: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html data type.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Instance.BlockDeviceMapping resource property to the template.
Describes a block device mapping. This data type maps directly to the Amazon EC2 BlockDeviceMapping: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html data type.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-blockdevicemapping.html

    .PARAMETER DeviceName
        The device name that is exposed to the instance, such as /dev/sdh. For the root device, you can use the explicit device name or you can set this parameter to ROOT_DEVICE and AWS OpsWorks Stacks will provide the correct device name.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-blockdevicemapping.html#cfn-opsworks-instance-blockdevicemapping-devicename
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Ebs
        An EBSBlockDevice that defines how to configure an Amazon EBS volume when the instance is launched. You can specify either the VirtualName or Ebs, but not both.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-blockdevicemapping.html#cfn-opsworks-instance-blockdevicemapping-ebs
        Type: EbsBlockDevice
        UpdateType: Mutable

    .PARAMETER NoDevice
        Suppresses the specified device included in the AMI's block device mapping.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-blockdevicemapping.html#cfn-opsworks-instance-blockdevicemapping-nodevice
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER VirtualName
        The virtual device name. For more information, see BlockDeviceMapping: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html. You can specify either the VirtualName or Ebs, but not both.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-blockdevicemapping.html#cfn-opsworks-instance-blockdevicemapping-virtualname
        PrimitiveType: String
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksInstanceBlockDeviceMapping])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $false)]
        [object]
        $DeviceName,
        [parameter(Mandatory = $false)]
        $Ebs,
        [parameter(Mandatory = $false)]
        [object]
        $NoDevice,
        [parameter(Mandatory = $false)]
        [object]
        $VirtualName
    )
    Process {
        $obj = [OpsWorksInstanceBlockDeviceMapping]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksInstanceBlockDeviceMapping'

function Add-VSOpsWorksInstanceEbsBlockDevice {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Instance.EbsBlockDevice resource property to the template. Describes an Amazon EBS volume. This data type maps directly to the Amazon EC2 EbsBlockDevice: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html data type.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Instance.EbsBlockDevice resource property to the template.
Describes an Amazon EBS volume. This data type maps directly to the Amazon EC2 EbsBlockDevice: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html data type.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-ebsblockdevice.html

    .PARAMETER DeleteOnTermination
        Whether the volume is deleted on instance termination.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-ebsblockdevice.html#cfn-opsworks-instance-ebsblockdevice-deleteontermination
        PrimitiveType: Boolean
        UpdateType: Mutable

    .PARAMETER Iops
        The number of I/O operations per second IOPS that the volume supports. For more information, see EbsBlockDevice: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-ebsblockdevice.html#cfn-opsworks-instance-ebsblockdevice-iops
        PrimitiveType: Integer
        UpdateType: Mutable

    .PARAMETER SnapshotId
        The snapshot ID.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-ebsblockdevice.html#cfn-opsworks-instance-ebsblockdevice-snapshotid
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER VolumeSize
        The volume size, in GiB. For more information, see EbsBlockDevice: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_EbsBlockDevice.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-ebsblockdevice.html#cfn-opsworks-instance-ebsblockdevice-volumesize
        PrimitiveType: Integer
        UpdateType: Mutable

    .PARAMETER VolumeType
        The volume type. gp2 for General Purpose SSD volumes, io1 for Provisioned IOPS SSD volumes, st1 for Throughput Optimized hard disk drives HDD, sc1 for Cold HDD,and standard for Magnetic volumes.
If you specify the io1 volume type, you must also specify a value for the Iops attribute. The maximum ratio of provisioned IOPS to requested volume size in GiB is 50:1. AWS uses the default volume size in GiB specified in the AMI attributes to set IOPS to 50 x volume size.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-ebsblockdevice.html#cfn-opsworks-instance-ebsblockdevice-volumetype
        PrimitiveType: String
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksInstanceEbsBlockDevice])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $false)]
        [object]
        $DeleteOnTermination,
        [parameter(Mandatory = $false)]
        [object]
        $Iops,
        [parameter(Mandatory = $false)]
        [object]
        $SnapshotId,
        [parameter(Mandatory = $false)]
        [object]
        $VolumeSize,
        [parameter(Mandatory = $false)]
        [object]
        $VolumeType
    )
    Process {
        $obj = [OpsWorksInstanceEbsBlockDevice]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksInstanceEbsBlockDevice'

function Add-VSOpsWorksInstanceTimeBasedAutoScaling {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Instance.TimeBasedAutoScaling resource property to the template. Describes an instance's time-based auto scaling configuration.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Instance.TimeBasedAutoScaling resource property to the template.
Describes an instance's time-based auto scaling configuration.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-timebasedautoscaling.html

    .PARAMETER Friday
        The schedule for Friday.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-timebasedautoscaling.html#cfn-opsworks-instance-timebasedautoscaling-friday
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: Map
        UpdateType: Mutable

    .PARAMETER Monday
        The schedule for Monday.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-timebasedautoscaling.html#cfn-opsworks-instance-timebasedautoscaling-monday
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: Map
        UpdateType: Mutable

    .PARAMETER Saturday
        The schedule for Saturday.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-timebasedautoscaling.html#cfn-opsworks-instance-timebasedautoscaling-saturday
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: Map
        UpdateType: Mutable

    .PARAMETER Sunday
        The schedule for Sunday.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-timebasedautoscaling.html#cfn-opsworks-instance-timebasedautoscaling-sunday
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: Map
        UpdateType: Mutable

    .PARAMETER Thursday
        The schedule for Thursday.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-timebasedautoscaling.html#cfn-opsworks-instance-timebasedautoscaling-thursday
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: Map
        UpdateType: Mutable

    .PARAMETER Tuesday
        The schedule for Tuesday.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-timebasedautoscaling.html#cfn-opsworks-instance-timebasedautoscaling-tuesday
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: Map
        UpdateType: Mutable

    .PARAMETER Wednesday
        The schedule for Wednesday.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-instance-timebasedautoscaling.html#cfn-opsworks-instance-timebasedautoscaling-wednesday
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: Map
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksInstanceTimeBasedAutoScaling])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $false)]
        [IDictionary]
        $Friday,
        [parameter(Mandatory = $false)]
        [IDictionary]
        $Monday,
        [parameter(Mandatory = $false)]
        [IDictionary]
        $Saturday,
        [parameter(Mandatory = $false)]
        [IDictionary]
        $Sunday,
        [parameter(Mandatory = $false)]
        [IDictionary]
        $Thursday,
        [parameter(Mandatory = $false)]
        [IDictionary]
        $Tuesday,
        [parameter(Mandatory = $false)]
        [IDictionary]
        $Wednesday
    )
    Process {
        $obj = [OpsWorksInstanceTimeBasedAutoScaling]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksInstanceTimeBasedAutoScaling'

function Add-VSOpsWorksLayerAutoScalingThresholds {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Layer.AutoScalingThresholds resource property to the template. Describes a load-based auto scaling upscaling or downscaling threshold configuration, which specifies when AWS OpsWorks Stacks starts or stops load-based instances.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Layer.AutoScalingThresholds resource property to the template.
Describes a load-based auto scaling upscaling or downscaling threshold configuration, which specifies when AWS OpsWorks Stacks starts or stops load-based instances.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-loadbasedautoscaling-autoscalingthresholds.html

    .PARAMETER CpuThreshold
        The CPU utilization threshold, as a percent of the available CPU. A value of -1 disables the threshold.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-loadbasedautoscaling-autoscalingthresholds.html#cfn-opsworks-layer-loadbasedautoscaling-autoscalingthresholds-cputhreshold
        PrimitiveType: Double
        UpdateType: Mutable

    .PARAMETER IgnoreMetricsTime
        The amount of time in minutes after a scaling event occurs that AWS OpsWorks Stacks should ignore metrics and suppress additional scaling events. For example, AWS OpsWorks Stacks adds new instances following an upscaling event but the instances won't start reducing the load until they have been booted and configured. There is no point in raising additional scaling events during that operation, which typically takes several minutes. IgnoreMetricsTime allows you to direct AWS OpsWorks Stacks to suppress scaling events long enough to get the new instances online.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-loadbasedautoscaling-autoscalingthresholds.html#cfn-opsworks-layer-loadbasedautoscaling-autoscalingthresholds-ignoremetricstime
        PrimitiveType: Integer
        UpdateType: Mutable

    .PARAMETER InstanceCount
        The number of instances to add or remove when the load exceeds a threshold.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-loadbasedautoscaling-autoscalingthresholds.html#cfn-opsworks-layer-loadbasedautoscaling-autoscalingthresholds-instancecount
        PrimitiveType: Integer
        UpdateType: Mutable

    .PARAMETER LoadThreshold
        The load threshold. A value of -1 disables the threshold. For more information about how load is computed, see Load computing: http://en.wikipedia.org/wiki/Load_%28computing%29.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-loadbasedautoscaling-autoscalingthresholds.html#cfn-opsworks-layer-loadbasedautoscaling-autoscalingthresholds-loadthreshold
        PrimitiveType: Double
        UpdateType: Mutable

    .PARAMETER MemoryThreshold
        The memory utilization threshold, as a percent of the available memory. A value of -1 disables the threshold.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-loadbasedautoscaling-autoscalingthresholds.html#cfn-opsworks-layer-loadbasedautoscaling-autoscalingthresholds-memorythreshold
        PrimitiveType: Double
        UpdateType: Mutable

    .PARAMETER ThresholdsWaitTime
        The amount of time, in minutes, that the load must exceed a threshold before more instances are added or removed.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-loadbasedautoscaling-autoscalingthresholds.html#cfn-opsworks-layer-loadbasedautoscaling-autoscalingthresholds-thresholdwaittime
        PrimitiveType: Integer
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksLayerAutoScalingThresholds])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $false)]
        [object]
        $CpuThreshold,
        [parameter(Mandatory = $false)]
        [object]
        $IgnoreMetricsTime,
        [parameter(Mandatory = $false)]
        [object]
        $InstanceCount,
        [parameter(Mandatory = $false)]
        [object]
        $LoadThreshold,
        [parameter(Mandatory = $false)]
        [object]
        $MemoryThreshold,
        [parameter(Mandatory = $false)]
        [object]
        $ThresholdsWaitTime
    )
    Process {
        $obj = [OpsWorksLayerAutoScalingThresholds]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksLayerAutoScalingThresholds'

function Add-VSOpsWorksLayerLifecycleEventConfiguration {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Layer.LifecycleEventConfiguration resource property to the template. Specifies the lifecycle event configuration

    .DESCRIPTION
        Adds an AWS::OpsWorks::Layer.LifecycleEventConfiguration resource property to the template.
Specifies the lifecycle event configuration

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-lifecycleeventconfiguration.html

    .PARAMETER ShutdownEventConfiguration
        The Shutdown event configuration.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-lifecycleeventconfiguration.html#cfn-opsworks-layer-lifecycleconfiguration-shutdowneventconfiguration
        Type: ShutdownEventConfiguration
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksLayerLifecycleEventConfiguration])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $false)]
        $ShutdownEventConfiguration
    )
    Process {
        $obj = [OpsWorksLayerLifecycleEventConfiguration]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksLayerLifecycleEventConfiguration'

function Add-VSOpsWorksLayerLoadBasedAutoScaling {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Layer.LoadBasedAutoScaling resource property to the template. Describes a layer's load-based auto scaling configuration.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Layer.LoadBasedAutoScaling resource property to the template.
Describes a layer's load-based auto scaling configuration.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-loadbasedautoscaling.html

    .PARAMETER DownScaling
        An AutoScalingThresholds object that describes the downscaling configuration, which defines how and when AWS OpsWorks Stacks reduces the number of instances.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-loadbasedautoscaling.html#cfn-opsworks-layer-loadbasedautoscaling-downscaling
        Type: AutoScalingThresholds
        UpdateType: Mutable

    .PARAMETER Enable
        Whether load-based auto scaling is enabled for the layer.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-loadbasedautoscaling.html#cfn-opsworks-layer-loadbasedautoscaling-enable
        PrimitiveType: Boolean
        UpdateType: Mutable

    .PARAMETER UpScaling
        An AutoScalingThresholds object that describes the upscaling configuration, which defines how and when AWS OpsWorks Stacks increases the number of instances.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-loadbasedautoscaling.html#cfn-opsworks-layer-loadbasedautoscaling-upscaling
        Type: AutoScalingThresholds
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksLayerLoadBasedAutoScaling])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $false)]
        $DownScaling,
        [parameter(Mandatory = $false)]
        [object]
        $Enable,
        [parameter(Mandatory = $false)]
        $UpScaling
    )
    Process {
        $obj = [OpsWorksLayerLoadBasedAutoScaling]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksLayerLoadBasedAutoScaling'

function Add-VSOpsWorksLayerRecipes {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Layer.Recipes resource property to the template. AWS OpsWorks Stacks supports five lifecycle events: **setup**, **configuration**, **deploy**, **undeploy**, and **shutdown**. For each layer, AWS OpsWorks Stacks runs a set of standard recipes for each event. In addition, you can provide custom recipes for any or all layers and events. AWS OpsWorks Stacks runs custom event recipes after the standard recipes. LayerCustomRecipes specifies the custom recipes for a particular layer to be run in response to each of the five events.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Layer.Recipes resource property to the template.
AWS OpsWorks Stacks supports five lifecycle events: **setup**, **configuration**, **deploy**, **undeploy**, and **shutdown**. For each layer, AWS OpsWorks Stacks runs a set of standard recipes for each event. In addition, you can provide custom recipes for any or all layers and events. AWS OpsWorks Stacks runs custom event recipes after the standard recipes. LayerCustomRecipes specifies the custom recipes for a particular layer to be run in response to each of the five events.

To specify a recipe, use the cookbook's directory name in the repository followed by two colons and the recipe name, which is the recipe's file name without the .rb extension. For example: phpapp2::dbsetup specifies the dbsetup.rb recipe in the repository's phpapp2 folder.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-recipes.html

    .PARAMETER Configure
        An array of custom recipe names to be run following a configure event.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-recipes.html#cfn-opsworks-layer-customrecipes-configure
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: List
        UpdateType: Mutable

    .PARAMETER Deploy
        An array of custom recipe names to be run following a deploy event.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-recipes.html#cfn-opsworks-layer-customrecipes-deploy
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: List
        UpdateType: Mutable

    .PARAMETER Setup
        An array of custom recipe names to be run following a setup event.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-recipes.html#cfn-opsworks-layer-customrecipes-setup
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: List
        UpdateType: Mutable

    .PARAMETER Shutdown
        An array of custom recipe names to be run following a shutdown event.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-recipes.html#cfn-opsworks-layer-customrecipes-shutdown
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: List
        UpdateType: Mutable

    .PARAMETER Undeploy
        An array of custom recipe names to be run following a undeploy event.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-recipes.html#cfn-opsworks-layer-customrecipes-undeploy
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: List
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksLayerRecipes])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $false)]
        $Configure,
        [parameter(Mandatory = $false)]
        $Deploy,
        [parameter(Mandatory = $false)]
        $Setup,
        [parameter(Mandatory = $false)]
        $Shutdown,
        [parameter(Mandatory = $false)]
        $Undeploy
    )
    Process {
        $obj = [OpsWorksLayerRecipes]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksLayerRecipes'

function Add-VSOpsWorksLayerShutdownEventConfiguration {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Layer.ShutdownEventConfiguration resource property to the template. The Shutdown event configuration.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Layer.ShutdownEventConfiguration resource property to the template.
The Shutdown event configuration.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-lifecycleeventconfiguration-shutdowneventconfiguration.html

    .PARAMETER DelayUntilElbConnectionsDrained
        Whether to enable Elastic Load Balancing connection draining. For more information, see Connection Draining: https://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/TerminologyandKeyConcepts.html#conn-drain

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-lifecycleeventconfiguration-shutdowneventconfiguration.html#cfn-opsworks-layer-lifecycleconfiguration-shutdowneventconfiguration-delayuntilelbconnectionsdrained
        PrimitiveType: Boolean
        UpdateType: Mutable

    .PARAMETER ExecutionTimeout
        The time, in seconds, that AWS OpsWorks Stacks will wait after triggering a Shutdown event before shutting down an instance.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-lifecycleeventconfiguration-shutdowneventconfiguration.html#cfn-opsworks-layer-lifecycleconfiguration-shutdowneventconfiguration-executiontimeout
        PrimitiveType: Integer
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksLayerShutdownEventConfiguration])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $false)]
        [object]
        $DelayUntilElbConnectionsDrained,
        [parameter(Mandatory = $false)]
        [object]
        $ExecutionTimeout
    )
    Process {
        $obj = [OpsWorksLayerShutdownEventConfiguration]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksLayerShutdownEventConfiguration'

function Add-VSOpsWorksLayerVolumeConfiguration {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Layer.VolumeConfiguration resource property to the template. Describes an Amazon EBS volume configuration.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Layer.VolumeConfiguration resource property to the template.
Describes an Amazon EBS volume configuration.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-volumeconfiguration.html

    .PARAMETER Encrypted
        Specifies whether an Amazon EBS volume is encrypted. For more information, see Amazon EBS Encryption: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-volumeconfiguration.html#cfn-opsworks-layer-volumeconfiguration-encrypted
        PrimitiveType: Boolean
        UpdateType: Mutable

    .PARAMETER Iops
        The number of I/O operations per second IOPS to provision for the volume. For PIOPS volumes, the IOPS per disk.
If you specify io1 for the volume type, you must specify this property.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-volumeconfiguration.html#cfn-opsworks-layer-volconfig-iops
        PrimitiveType: Integer
        UpdateType: Mutable

    .PARAMETER MountPoint
        The volume mount point. For example "/dev/sdh".

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-volumeconfiguration.html#cfn-opsworks-layer-volconfig-mountpoint
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER NumberOfDisks
        The number of disks in the volume.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-volumeconfiguration.html#cfn-opsworks-layer-volconfig-numberofdisks
        PrimitiveType: Integer
        UpdateType: Mutable

    .PARAMETER RaidLevel
        The volume RAID level: http://en.wikipedia.org/wiki/Standard_RAID_levels.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-volumeconfiguration.html#cfn-opsworks-layer-volconfig-raidlevel
        PrimitiveType: Integer
        UpdateType: Mutable

    .PARAMETER Size
        The volume size.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-volumeconfiguration.html#cfn-opsworks-layer-volconfig-size
        PrimitiveType: Integer
        UpdateType: Mutable

    .PARAMETER VolumeType
        The volume type. For more information, see Amazon EBS Volume Types: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html.
+ standard - Magnetic. Magnetic volumes must have a minimum size of 1 GiB and a maximum size of 1024 GiB.
+ io1 - Provisioned IOPS SSD. PIOPS volumes must have a minimum size of 4 GiB and a maximum size of 16384 GiB.
+ gp2 - General Purpose SSD. General purpose volumes must have a minimum size of 1 GiB and a maximum size of 16384 GiB.
+ st1 - Throughput Optimized hard disk drive HDD. Throughput optimized HDD volumes must have a minimum size of 500 GiB and a maximum size of 16384 GiB.
+ sc1 - Cold HDD. Cold HDD volumes must have a minimum size of 500 GiB and a maximum size of 16384 GiB.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-layer-volumeconfiguration.html#cfn-opsworks-layer-volconfig-volumetype
        PrimitiveType: String
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksLayerVolumeConfiguration])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $false)]
        [object]
        $Encrypted,
        [parameter(Mandatory = $false)]
        [object]
        $Iops,
        [parameter(Mandatory = $false)]
        [object]
        $MountPoint,
        [parameter(Mandatory = $false)]
        [object]
        $NumberOfDisks,
        [parameter(Mandatory = $false)]
        [object]
        $RaidLevel,
        [parameter(Mandatory = $false)]
        [object]
        $Size,
        [parameter(Mandatory = $false)]
        [object]
        $VolumeType
    )
    Process {
        $obj = [OpsWorksLayerVolumeConfiguration]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksLayerVolumeConfiguration'

function Add-VSOpsWorksStackChefConfiguration {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Stack.ChefConfiguration resource property to the template. Describes the Chef configuration.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Stack.ChefConfiguration resource property to the template.
Describes the Chef configuration.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-chefconfiguration.html

    .PARAMETER BerkshelfVersion
        The Berkshelf version.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-chefconfiguration.html#cfn-opsworks-chefconfiguration-berkshelfversion
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER ManageBerkshelf
        Whether to enable Berkshelf.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-chefconfiguration.html#cfn-opsworks-chefconfiguration-berkshelfversion
        PrimitiveType: Boolean
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksStackChefConfiguration])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $false)]
        [object]
        $BerkshelfVersion,
        [parameter(Mandatory = $false)]
        [object]
        $ManageBerkshelf
    )
    Process {
        $obj = [OpsWorksStackChefConfiguration]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksStackChefConfiguration'

function Add-VSOpsWorksStackElasticIp {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Stack.ElasticIp resource property to the template. Describes an Elastic IP address.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Stack.ElasticIp resource property to the template.
Describes an Elastic IP address.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-elasticip.html

    .PARAMETER Ip
        The IP address.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-elasticip.html#cfn-opsworks-stack-elasticip-ip
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Name
        The name.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-elasticip.html#cfn-opsworks-stack-elasticip-name
        PrimitiveType: String
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksStackElasticIp])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $true)]
        [object]
        $Ip,
        [parameter(Mandatory = $false)]
        [object]
        $Name
    )
    Process {
        $obj = [OpsWorksStackElasticIp]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksStackElasticIp'

function Add-VSOpsWorksStackRdsDbInstance {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Stack.RdsDbInstance resource property to the template. Describes an Amazon RDS instance.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Stack.RdsDbInstance resource property to the template.
Describes an Amazon RDS instance.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-rdsdbinstance.html

    .PARAMETER DbPassword
        AWS OpsWorks Stacks returns *****FILTERED***** instead of the actual value.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-rdsdbinstance.html#cfn-opsworks-stack-rdsdbinstance-dbpassword
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER DbUser
        The master user name.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-rdsdbinstance.html#cfn-opsworks-stack-rdsdbinstance-dbuser
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER RdsDbInstanceArn
        The instance's ARN.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-rdsdbinstance.html#cfn-opsworks-stack-rdsdbinstance-rdsdbinstancearn
        PrimitiveType: String
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksStackRdsDbInstance])]
    [cmdletbinding()]
    [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingPlainTextForPassword","DbPassword")]
    [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingUserNameAndPasswordParams","DbPassword")]
    Param(
        [parameter(Mandatory = $true)]
        [object]
        $DbPassword,
        [parameter(Mandatory = $true)]
        [object]
        $DbUser,
        [parameter(Mandatory = $true)]
        [object]
        $RdsDbInstanceArn
    )
    Process {
        $obj = [OpsWorksStackRdsDbInstance]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksStackRdsDbInstance'

function Add-VSOpsWorksStackSource {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Stack.Source resource property to the template. Contains the information required to retrieve an app or cookbook from a repository. For more information, see Creating Apps: https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html or Custom Recipes and Cookbooks: https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Stack.Source resource property to the template.
Contains the information required to retrieve an app or cookbook from a repository. For more information, see Creating Apps: https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html or Custom Recipes and Cookbooks: https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-source.html

    .PARAMETER Password
        When included in a request, the parameter depends on the repository type.
+ For Amazon S3 bundles, set Password to the appropriate IAM secret access key.
+ For HTTP bundles and Subversion repositories, set Password to the password.
For more information on how to safely handle IAM credentials, see https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html: https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html.
In responses, AWS OpsWorks Stacks returns *****FILTERED***** instead of the actual value.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-source.html#cfn-opsworks-custcookbooksource-password
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Revision
        The application's version. AWS OpsWorks Stacks enables you to easily deploy new versions of an application. One of the simplest approaches is to have branches or revisions in your repository that represent different versions that can potentially be deployed.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-source.html#cfn-opsworks-custcookbooksource-revision
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER SshKey
        The repository's SSH key. For more information, see Using Git Repository SSH Keys: https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-deploykeys.html in the *AWS OpsWorks User Guide*. To pass in an SSH key as a parameter, see the following example:
"Parameters" : { "GitSSHKey" : { "Description" : "Change SSH key newlines to commas.", "Type" : "CommaDelimitedList", "NoEcho" : "true" }, ... "CustomCookbooksSource": { "Revision" : { "Ref": "GitRevision"}, "SshKey" : { "Fn::Join" : "n", { "Ref": "GitSSHKey"} ] }, "Type": "git", "Url": { "Ref": "GitURL"} } ...

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-source.html#cfn-opsworks-custcookbooksource-sshkey
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Type
        The repository type.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-source.html#cfn-opsworks-custcookbooksource-type
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Url
        The source URL. The following is an example of an Amazon S3 source URL: https://s3.amazonaws.com/opsworks-demo-bucket/opsworks_cookbook_demo.tar.gz.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-source.html#cfn-opsworks-custcookbooksource-url
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Username
        This parameter depends on the repository type.
+ For Amazon S3 bundles, set Username to the appropriate IAM access key ID.
+ For HTTP bundles, Git repositories, and Subversion repositories, set Username to the user name.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-source.html#cfn-opsworks-custcookbooksource-username
        PrimitiveType: String
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksStackSource])]
    [cmdletbinding()]
    [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingPlainTextForPassword","Password")]
    [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingUserNameAndPasswordParams","Password")]
    Param(
        [parameter(Mandatory = $false)]
        [object]
        $Password,
        [parameter(Mandatory = $false)]
        [object]
        $Revision,
        [parameter(Mandatory = $false)]
        [object]
        $SshKey,
        [parameter(Mandatory = $false)]
        [object]
        $Type,
        [parameter(Mandatory = $false)]
        [object]
        $Url,
        [parameter(Mandatory = $false)]
        [object]
        $Username
    )
    Process {
        $obj = [OpsWorksStackSource]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksStackSource'

function Add-VSOpsWorksStackStackConfigurationManager {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Stack.StackConfigurationManager resource property to the template. Describes the configuration manager.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Stack.StackConfigurationManager resource property to the template.
Describes the configuration manager.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-stackconfigmanager.html

    .PARAMETER Name
        The name. This parameter must be set to "Chef".

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-stackconfigmanager.html#cfn-opsworks-configmanager-name
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Version
        The Chef version. This parameter must be set to 12, 11.10, or 11.4 for Linux stacks, and to 12.2 for Windows stacks. The default value for Linux stacks is 11.4.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-opsworks-stack-stackconfigmanager.html#cfn-opsworks-configmanager-version
        PrimitiveType: String
        UpdateType: Mutable

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksStackStackConfigurationManager])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $false)]
        [object]
        $Name,
        [parameter(Mandatory = $false)]
        [object]
        $Version
    )
    Process {
        $obj = [OpsWorksStackStackConfigurationManager]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'Add-VSOpsWorksStackStackConfigurationManager'

function New-VSOpsWorksApp {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::App resource to the template. Creates an app for a specified stack. For more information, see Creating Apps: https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html.

    .DESCRIPTION
        Adds an AWS::OpsWorks::App resource to the template. Creates an app for a specified stack. For more information, see Creating Apps: https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html.

**Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions: https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-app.html

    .PARAMETER LogicalId
        The logical ID must be alphanumeric (A-Za-z0-9) and unique within the template. 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 volume to an Amazon EC2 instance, you reference the logical IDs to associate the block stores with the instance.

    .PARAMETER AppSource
        A Source object that specifies the app repository.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-app.html#cfn-opsworks-app-appsource
        Type: Source
        UpdateType: Mutable

    .PARAMETER Attributes
        One or more user-defined key/value pairs to be added to the stack attributes.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-app.html#cfn-opsworks-app-attributes
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: Map
        UpdateType: Mutable

    .PARAMETER DataSources
        The app's data source.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-app.html#cfn-opsworks-app-datasources
        DuplicatesAllowed: False
        ItemType: DataSource
        Type: List
        UpdateType: Mutable

    .PARAMETER Description
        A description of the app.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-app.html#cfn-opsworks-app-description
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Domains
        The app virtual host settings, with multiple domains separated by commas. For example: 'www.example.com, example.com'

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-app.html#cfn-opsworks-app-domains
        DuplicatesAllowed: True
        PrimitiveItemType: String
        Type: List
        UpdateType: Mutable

    .PARAMETER EnableSsl
        Whether to enable SSL for the app.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-app.html#cfn-opsworks-app-enablessl
        PrimitiveType: Boolean
        UpdateType: Mutable

    .PARAMETER Environment
        An array of EnvironmentVariable objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instance. For more information, see Environment Variables: https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment.
There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 20 KB. This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large maximum is 20KB."
If you have specified one or more environment variables, you cannot modify the stack's Chef version.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-app.html#cfn-opsworks-app-environment
        DuplicatesAllowed: True
        ItemType: EnvironmentVariable
        Type: List
        UpdateType: Mutable

    .PARAMETER Name
        The app name.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-app.html#cfn-opsworks-app-name
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Shortname
        The app's short name.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-app.html#cfn-opsworks-app-shortname
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER SslConfiguration
        An SslConfiguration object with the SSL configuration.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-app.html#cfn-opsworks-app-sslconfiguration
        Type: SslConfiguration
        UpdateType: Mutable

    .PARAMETER StackId
        The stack ID.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-app.html#cfn-opsworks-app-stackid
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER Type
        The app type. Each supported type is associated with a particular layer. For example, PHP applications are associated with a PHP layer. AWS OpsWorks Stacks deploys an application to those instances that are members of the corresponding layer. If your app isn't one of the standard types, or you prefer to implement your own Deploy recipes, specify other.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-app.html#cfn-opsworks-app-type
        PrimitiveType: String
        UpdateType: Mutable

    .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.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .PARAMETER UpdateReplacePolicy
        Use the UpdateReplacePolicy attribute to retain or (in some cases) backup the existing physical instance of a resource when it is replaced during a stack update operation.

        When you initiate a stack update, AWS CloudFormation updates resources based on differences between what you submit and the stack's current template and parameters. If you update a resource property that requires that the resource be replaced, AWS CloudFormation recreates the resource during the update. Recreating the resource generates a new physical ID. AWS CloudFormation creates the replacement resource first, and then changes references from other dependent resources to point to the replacement resource. By default, AWS CloudFormation then deletes the old resource. Using the UpdateReplacePolicy, you can specify that AWS CloudFormation retain or (in some cases) create a snapshot of the old resource.

        For resources that support snapshots, such as AWS::EC2::Volume, specify Snapshot to have AWS CloudFormation create a snapshot before deleting the old resource instance.

        You can apply the UpdateReplacePolicy attribute to any resource. UpdateReplacePolicy is only executed if you update a resource property whose update behavior is specified as Replacement, thereby causing AWS CloudFormation to replace the old resource with a new one with a new physical ID. For example, if you update the Engine property of an AWS::RDS::DBInstance resource type, AWS CloudFormation creates a new resource and replaces the current DB instance resource with the new one. The UpdateReplacePolicy attribute would then dictate whether AWS CloudFormation deleted, retained, or created a snapshot of the old DB instance. The update behavior for each property of a resource is specified in the reference topic for that resource in the AWS Resource and Property Types Reference. For more information on resource update behavior, see Update Behaviors of Stack Resources.

        The UpdateReplacePolicy attribute applies to stack updates you perform directly, as well as stack updates performed using change sets.

        Note
        Resources that are retained continue to exist and continue to incur applicable charges until you delete those resources. Snapshots that are created with this policy continue to exist and continue to incur applicable charges until you delete those snapshots. UpdateReplacePolicy retains the old physical resource or snapshot, but removes it from AWS CloudFormation's scope.

        UpdateReplacePolicy differs from the DeletionPolicy attribute in that it only applies to resources replaced during stack updates. Use DeletionPolicy for resources deleted when a stack is deleted, or when the resource definition itself is deleted from the template as part of a stack update.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .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.

        This parameter takes a string or list of strings representing Logical IDs of resources that must be created prior to this resource being created.


    .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 or YAML 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.

        This will be returned when describing the resource using AWS CLI.


    .PARAMETER UpdatePolicy
        Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup resource. AWS CloudFormation invokes one of three update policies depending on the type of change you make or whether a scheduled action is associated with the Auto Scaling group.

        You must use the "Add-UpdatePolicy" function or the [UpdatePolicy] class here.
    .PARAMETER Condition
        Logical ID of the condition that this resource needs to be true in order for this resource to be provisioned.

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksApp])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $true,Position = 0)]
        [ValidateLogicalId()]
        [string]
        $LogicalId,
        [parameter(Mandatory = $false)]
        $AppSource,
        [parameter(Mandatory = $false)]
        [IDictionary]
        $Attributes,
        [parameter(Mandatory = $false)]
        [object]
        $DataSources,
        [parameter(Mandatory = $false)]
        [object]
        $Description,
        [parameter(Mandatory = $false)]
        $Domains,
        [parameter(Mandatory = $false)]
        [object]
        $EnableSsl,
        [parameter(Mandatory = $false)]
        [object]
        $Environment,
        [parameter(Mandatory = $true)]
        [object]
        $Name,
        [parameter(Mandatory = $false)]
        [object]
        $Shortname,
        [parameter(Mandatory = $false)]
        $SslConfiguration,
        [parameter(Mandatory = $true)]
        [object]
        $StackId,
        [parameter(Mandatory = $true)]
        [object]
        $Type,
        [parameter()]
        [DeletionPolicy]
        $DeletionPolicy,
        [parameter()]
        [UpdateReplacePolicy]
        $UpdateReplacePolicy,
        [parameter(Mandatory = $false)]
        [string[]]
        $DependsOn,
        [parameter(Mandatory = $false)]
        [VSJson]
        $Metadata,
        [parameter(Mandatory = $false)]
        [UpdatePolicy]
        $UpdatePolicy,
        [parameter(Mandatory = $false)]
        [string]
        $Condition
    )
    Process {
        $obj = [OpsWorksApp]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'New-VSOpsWorksApp'

function New-VSOpsWorksElasticLoadBalancerAttachment {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::ElasticLoadBalancerAttachment resource to the template. Attaches an Elastic Load Balancing load balancer to an AWS OpsWorks layer that you specify.

    .DESCRIPTION
        Adds an AWS::OpsWorks::ElasticLoadBalancerAttachment resource to the template. Attaches an Elastic Load Balancing load balancer to an AWS OpsWorks layer that you specify.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-elbattachment.html

    .PARAMETER LogicalId
        The logical ID must be alphanumeric (A-Za-z0-9) and unique within the template. 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 volume to an Amazon EC2 instance, you reference the logical IDs to associate the block stores with the instance.

    .PARAMETER ElasticLoadBalancerName
        The Elastic Load Balancing instance's name.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-elbattachment.html#cfn-opsworks-elbattachment-elbname
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER LayerId
        The AWS OpsWorks layer ID that the Elastic Load Balancing load balancer will be attached to.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-elbattachment.html#cfn-opsworks-elbattachment-layerid
        PrimitiveType: String
        UpdateType: Mutable

    .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.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .PARAMETER UpdateReplacePolicy
        Use the UpdateReplacePolicy attribute to retain or (in some cases) backup the existing physical instance of a resource when it is replaced during a stack update operation.

        When you initiate a stack update, AWS CloudFormation updates resources based on differences between what you submit and the stack's current template and parameters. If you update a resource property that requires that the resource be replaced, AWS CloudFormation recreates the resource during the update. Recreating the resource generates a new physical ID. AWS CloudFormation creates the replacement resource first, and then changes references from other dependent resources to point to the replacement resource. By default, AWS CloudFormation then deletes the old resource. Using the UpdateReplacePolicy, you can specify that AWS CloudFormation retain or (in some cases) create a snapshot of the old resource.

        For resources that support snapshots, such as AWS::EC2::Volume, specify Snapshot to have AWS CloudFormation create a snapshot before deleting the old resource instance.

        You can apply the UpdateReplacePolicy attribute to any resource. UpdateReplacePolicy is only executed if you update a resource property whose update behavior is specified as Replacement, thereby causing AWS CloudFormation to replace the old resource with a new one with a new physical ID. For example, if you update the Engine property of an AWS::RDS::DBInstance resource type, AWS CloudFormation creates a new resource and replaces the current DB instance resource with the new one. The UpdateReplacePolicy attribute would then dictate whether AWS CloudFormation deleted, retained, or created a snapshot of the old DB instance. The update behavior for each property of a resource is specified in the reference topic for that resource in the AWS Resource and Property Types Reference. For more information on resource update behavior, see Update Behaviors of Stack Resources.

        The UpdateReplacePolicy attribute applies to stack updates you perform directly, as well as stack updates performed using change sets.

        Note
        Resources that are retained continue to exist and continue to incur applicable charges until you delete those resources. Snapshots that are created with this policy continue to exist and continue to incur applicable charges until you delete those snapshots. UpdateReplacePolicy retains the old physical resource or snapshot, but removes it from AWS CloudFormation's scope.

        UpdateReplacePolicy differs from the DeletionPolicy attribute in that it only applies to resources replaced during stack updates. Use DeletionPolicy for resources deleted when a stack is deleted, or when the resource definition itself is deleted from the template as part of a stack update.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .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.

        This parameter takes a string or list of strings representing Logical IDs of resources that must be created prior to this resource being created.


    .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 or YAML 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.

        This will be returned when describing the resource using AWS CLI.


    .PARAMETER UpdatePolicy
        Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup resource. AWS CloudFormation invokes one of three update policies depending on the type of change you make or whether a scheduled action is associated with the Auto Scaling group.

        You must use the "Add-UpdatePolicy" function or the [UpdatePolicy] class here.
    .PARAMETER Condition
        Logical ID of the condition that this resource needs to be true in order for this resource to be provisioned.

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksElasticLoadBalancerAttachment])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $true,Position = 0)]
        [ValidateLogicalId()]
        [string]
        $LogicalId,
        [parameter(Mandatory = $true)]
        [object]
        $ElasticLoadBalancerName,
        [parameter(Mandatory = $true)]
        [object]
        $LayerId,
        [parameter()]
        [DeletionPolicy]
        $DeletionPolicy,
        [parameter()]
        [UpdateReplacePolicy]
        $UpdateReplacePolicy,
        [parameter(Mandatory = $false)]
        [string[]]
        $DependsOn,
        [parameter(Mandatory = $false)]
        [VSJson]
        $Metadata,
        [parameter(Mandatory = $false)]
        [UpdatePolicy]
        $UpdatePolicy,
        [parameter(Mandatory = $false)]
        [string]
        $Condition
    )
    Process {
        $obj = [OpsWorksElasticLoadBalancerAttachment]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'New-VSOpsWorksElasticLoadBalancerAttachment'

function New-VSOpsWorksInstance {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Instance resource to the template. Creates an instance in a specified stack. For more information, see Adding an Instance to a Layer: https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-add.html.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Instance resource to the template. Creates an instance in a specified stack. For more information, see Adding an Instance to a Layer: https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-add.html.

**Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions: https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html

    .PARAMETER LogicalId
        The logical ID must be alphanumeric (A-Za-z0-9) and unique within the template. 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 volume to an Amazon EC2 instance, you reference the logical IDs to associate the block stores with the instance.

    .PARAMETER AgentVersion
        The default AWS OpsWorks Stacks agent version. You have the following options:
+ INHERIT - Use the stack's default agent version setting.
+ *version_number* - Use the specified agent version. This value overrides the stack's default setting. To update the agent version, edit the instance configuration and specify a new version. AWS OpsWorks Stacks then automatically installs that version on the instance.
The default setting is INHERIT. To specify an agent version, you must use the complete version number, not the abbreviated number shown on the console. For a list of available agent version numbers, call DescribeAgentVersions: https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeAgentVersions. AgentVersion cannot be set to Chef 12.2.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-agentversion
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER AmiId
        A custom AMI ID to be used to create the instance. The AMI should be based on one of the supported operating systems. For more information, see Using Custom AMIs: https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html.
If you specify a custom AMI, you must set Os to Custom.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-amiid
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Architecture
        The instance architecture. The default option is x86_64. Instance types do not necessarily support both architectures. For a list of the architectures that are supported by the different instance types, see Instance Families and Types: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-architecture
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER AutoScalingType
        For load-based or time-based instances, the type. Windows stacks can use only time-based instances.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-autoscalingtype
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER AvailabilityZone
        The Availability Zone of the AWS OpsWorks instance, such as us-east-2a.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-availabilityzone
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER BlockDeviceMappings
        An array of BlockDeviceMapping objects that specify the instance's block devices. For more information, see Block Device Mapping: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-device-mapping-concepts.html. Note that block device mappings are not supported for custom AMIs.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-blockdevicemappings
        DuplicatesAllowed: False
        ItemType: BlockDeviceMapping
        Type: List
        UpdateType: Immutable

    .PARAMETER EbsOptimized
        Whether to create an Amazon EBS-optimized instance.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-ebsoptimized
        PrimitiveType: Boolean
        UpdateType: Immutable

    .PARAMETER ElasticIps
        A list of Elastic IP addresses to associate with the instance.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-elasticips
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: List
        UpdateType: Mutable

    .PARAMETER Hostname
        The instance host name.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-hostname
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER InstallUpdatesOnBoot
        Whether to install operating system and package updates when the instance boots. The default value is true. To control when updates are installed, set this value to false. You must then update your instances manually by using CreateDeployment: https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateDeployment to run the update_dependencies stack command or by manually running yum Amazon Linux or apt-get Ubuntu on the instances.
We strongly recommend using the default value of true to ensure that your instances have the latest security updates.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-installupdatesonboot
        PrimitiveType: Boolean
        UpdateType: Mutable

    .PARAMETER InstanceType
        The instance type, such as t2.micro. For a list of supported instance types, open the stack in the console, choose **Instances**, and choose **+ Instance**. The **Size** list contains the currently supported types. For more information, see Instance Families and Types: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html. The parameter values that you use to specify the various types are in the **API Name** column of the **Available Instance Types** table.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-instancetype
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER LayerIds
        An array that contains the instance's layer IDs.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-layerids
        DuplicatesAllowed: True
        PrimitiveItemType: String
        Type: List
        UpdateType: Mutable

    .PARAMETER Os
        The instance's operating system, which must be set to one of the following.
+ A supported Linux operating system: An Amazon Linux version, such as Amazon Linux 2018.03, Amazon Linux 2017.09, Amazon Linux 2017.03, Amazon Linux 2016.09, Amazon Linux 2016.03, Amazon Linux 2015.09, or Amazon Linux 2015.03.
+ A supported Ubuntu operating system, such as Ubuntu 16.04 LTS, Ubuntu 14.04 LTS, or Ubuntu 12.04 LTS.
+ CentOS Linux 7
+ Red Hat Enterprise Linux 7
+ A supported Windows operating system, such as Microsoft Windows Server 2012 R2 Base, Microsoft Windows Server 2012 R2 with SQL Server Express, Microsoft Windows Server 2012 R2 with SQL Server Standard, or Microsoft Windows Server 2012 R2 with SQL Server Web.
+ A custom AMI: Custom.
For more information about the supported operating systems, see AWS OpsWorks Stacks Operating Systems: https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html.
The default option is the current Amazon Linux version. If you set this parameter to Custom, you must use the CreateInstance: https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateInstance action's AmiId parameter to specify the custom AMI that you want to use. Block device mappings are not supported if the value is Custom. For more information about supported operating systems, see Operating Systems: https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.htmlFor more information about how to use custom AMIs with AWS OpsWorks Stacks, see Using Custom AMIs: https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-os
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER RootDeviceType
        The instance root device type. For more information, see Storage for the Root Device: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-rootdevicetype
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER SshKeyName
        The instance's Amazon EC2 key-pair name.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-sshkeyname
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER StackId
        The stack ID.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-stackid
        PrimitiveType: String
        UpdateType: Immutable

    .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 Stacks to launch the instance in a different subnet.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-subnetid
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER Tenancy
        The instance's tenancy option. The default option is no tenancy, or if the instance is running in a VPC, inherit tenancy settings from the VPC. The following are valid values for this parameter: dedicated, default, or host. Because there are costs associated with changes in tenancy options, we recommend that you research tenancy options before choosing them for your instances. For more information about dedicated hosts, see Dedicated Hosts Overview: http://aws.amazon.com/ec2/dedicated-hosts/ and Amazon EC2 Dedicated Hosts: http://aws.amazon.com/ec2/dedicated-hosts/. For more information about dedicated instances, see Dedicated Instances: https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/dedicated-instance.html and Amazon EC2 Dedicated Instances: http://aws.amazon.com/ec2/purchasing-options/dedicated-instances/.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-tenancy
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER TimeBasedAutoScaling
        The time-based scaling configuration for the instance.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-timebasedautoscaling
        Type: TimeBasedAutoScaling
        UpdateType: Immutable

    .PARAMETER VirtualizationType
        The instance's virtualization type, paravirtual or hvm.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-virtualizationtype
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER Volumes
        A list of AWS OpsWorks volume IDs to associate with the instance. For more information, see AWS::OpsWorks::Volume: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-volume.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-instance.html#cfn-opsworks-instance-volumes
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: List
        UpdateType: Mutable

    .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.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .PARAMETER UpdateReplacePolicy
        Use the UpdateReplacePolicy attribute to retain or (in some cases) backup the existing physical instance of a resource when it is replaced during a stack update operation.

        When you initiate a stack update, AWS CloudFormation updates resources based on differences between what you submit and the stack's current template and parameters. If you update a resource property that requires that the resource be replaced, AWS CloudFormation recreates the resource during the update. Recreating the resource generates a new physical ID. AWS CloudFormation creates the replacement resource first, and then changes references from other dependent resources to point to the replacement resource. By default, AWS CloudFormation then deletes the old resource. Using the UpdateReplacePolicy, you can specify that AWS CloudFormation retain or (in some cases) create a snapshot of the old resource.

        For resources that support snapshots, such as AWS::EC2::Volume, specify Snapshot to have AWS CloudFormation create a snapshot before deleting the old resource instance.

        You can apply the UpdateReplacePolicy attribute to any resource. UpdateReplacePolicy is only executed if you update a resource property whose update behavior is specified as Replacement, thereby causing AWS CloudFormation to replace the old resource with a new one with a new physical ID. For example, if you update the Engine property of an AWS::RDS::DBInstance resource type, AWS CloudFormation creates a new resource and replaces the current DB instance resource with the new one. The UpdateReplacePolicy attribute would then dictate whether AWS CloudFormation deleted, retained, or created a snapshot of the old DB instance. The update behavior for each property of a resource is specified in the reference topic for that resource in the AWS Resource and Property Types Reference. For more information on resource update behavior, see Update Behaviors of Stack Resources.

        The UpdateReplacePolicy attribute applies to stack updates you perform directly, as well as stack updates performed using change sets.

        Note
        Resources that are retained continue to exist and continue to incur applicable charges until you delete those resources. Snapshots that are created with this policy continue to exist and continue to incur applicable charges until you delete those snapshots. UpdateReplacePolicy retains the old physical resource or snapshot, but removes it from AWS CloudFormation's scope.

        UpdateReplacePolicy differs from the DeletionPolicy attribute in that it only applies to resources replaced during stack updates. Use DeletionPolicy for resources deleted when a stack is deleted, or when the resource definition itself is deleted from the template as part of a stack update.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .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.

        This parameter takes a string or list of strings representing Logical IDs of resources that must be created prior to this resource being created.


    .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 or YAML 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.

        This will be returned when describing the resource using AWS CLI.


    .PARAMETER UpdatePolicy
        Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup resource. AWS CloudFormation invokes one of three update policies depending on the type of change you make or whether a scheduled action is associated with the Auto Scaling group.

        You must use the "Add-UpdatePolicy" function or the [UpdatePolicy] class here.
    .PARAMETER Condition
        Logical ID of the condition that this resource needs to be true in order for this resource to be provisioned.

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksInstance])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $true,Position = 0)]
        [ValidateLogicalId()]
        [string]
        $LogicalId,
        [parameter(Mandatory = $false)]
        [object]
        $AgentVersion,
        [parameter(Mandatory = $false)]
        [object]
        $AmiId,
        [parameter(Mandatory = $false)]
        [object]
        $Architecture,
        [parameter(Mandatory = $false)]
        [object]
        $AutoScalingType,
        [parameter(Mandatory = $false)]
        [object]
        $AvailabilityZone,
        [parameter(Mandatory = $false)]
        [object]
        $BlockDeviceMappings,
        [parameter(Mandatory = $false)]
        [object]
        $EbsOptimized,
        [parameter(Mandatory = $false)]
        $ElasticIps,
        [parameter(Mandatory = $false)]
        [object]
        $Hostname,
        [parameter(Mandatory = $false)]
        [object]
        $InstallUpdatesOnBoot,
        [parameter(Mandatory = $true)]
        [object]
        $InstanceType,
        [parameter(Mandatory = $true)]
        $LayerIds,
        [parameter(Mandatory = $false)]
        [object]
        $Os,
        [parameter(Mandatory = $false)]
        [object]
        $RootDeviceType,
        [parameter(Mandatory = $false)]
        [object]
        $SshKeyName,
        [parameter(Mandatory = $true)]
        [object]
        $StackId,
        [parameter(Mandatory = $false)]
        [object]
        $SubnetId,
        [parameter(Mandatory = $false)]
        [object]
        $Tenancy,
        [parameter(Mandatory = $false)]
        $TimeBasedAutoScaling,
        [parameter(Mandatory = $false)]
        [object]
        $VirtualizationType,
        [parameter(Mandatory = $false)]
        $Volumes,
        [parameter()]
        [DeletionPolicy]
        $DeletionPolicy,
        [parameter()]
        [UpdateReplacePolicy]
        $UpdateReplacePolicy,
        [parameter(Mandatory = $false)]
        [string[]]
        $DependsOn,
        [parameter(Mandatory = $false)]
        [VSJson]
        $Metadata,
        [parameter(Mandatory = $false)]
        [UpdatePolicy]
        $UpdatePolicy,
        [parameter(Mandatory = $false)]
        [string]
        $Condition
    )
    Process {
        $obj = [OpsWorksInstance]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'New-VSOpsWorksInstance'

function New-VSOpsWorksLayer {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Layer resource to the template. Creates a layer. For more information, see How to Create a Layer: https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-create.html.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Layer resource to the template. Creates a layer. For more information, see How to Create a Layer: https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-create.html.

**Note**

You should use **CreateLayer** for noncustom layer types such as PHP App Server only if the stack does not have an existing layer of that type. A stack can have at most one instance of each noncustom layer; if you attempt to create a second instance, **CreateLayer** fails. A stack can have an arbitrary number of custom layers, so you can call **CreateLayer** as many times as you like for that layer type.

**Required Permissions**: To use this action, an IAM user must have a Manage permissions level for the stack, or an attached policy that explicitly grants permissions. For more information on user permissions, see Managing User Permissions: https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html

    .PARAMETER LogicalId
        The logical ID must be alphanumeric (A-Za-z0-9) and unique within the template. 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 volume to an Amazon EC2 instance, you reference the logical IDs to associate the block stores with the instance.

    .PARAMETER Attributes
        One or more user-defined key-value pairs to be added to the stack attributes.
To create a cluster layer, set the EcsClusterArn attribute to the cluster's ARN.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-attributes
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: Map
        UpdateType: Mutable

    .PARAMETER AutoAssignElasticIps
        Whether to automatically assign an Elastic IP address: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html to the layer's instances. For more information, see How to Edit a Layer: https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-autoassignelasticips
        PrimitiveType: Boolean
        UpdateType: Mutable

    .PARAMETER AutoAssignPublicIps
        For stacks that are running in a VPC, whether to automatically assign a public IP address to the layer's instances. For more information, see How to Edit a Layer: https://docs.aws.amazon.com/opsworks/latest/userguide/workinglayers-basics-edit.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-autoassignpublicips
        PrimitiveType: Boolean
        UpdateType: Mutable

    .PARAMETER CustomInstanceProfileArn
        The ARN of an IAM profile to be used for the layer's EC2 instances. For more information about IAM ARNs, see Using Identifiers: https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-custominstanceprofilearn
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER CustomJson
        A JSON-formatted string containing custom stack configuration and deployment attributes to be installed on the layer's instances. For more information, see Using Custom JSON: https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-json-override.html. This feature is supported as of version 1.7.42 of the AWS CLI.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-customjson
        PrimitiveType: Json
        UpdateType: Mutable

    .PARAMETER CustomRecipes
        A LayerCustomRecipes object that specifies the layer custom recipes.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-customrecipes
        Type: Recipes
        UpdateType: Mutable

    .PARAMETER CustomSecurityGroupIds
        An array containing the layer custom security group IDs.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-customsecuritygroupids
        DuplicatesAllowed: True
        PrimitiveItemType: String
        Type: List
        UpdateType: Mutable

    .PARAMETER EnableAutoHealing
        Whether to disable auto healing for the layer.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-enableautohealing
        PrimitiveType: Boolean
        UpdateType: Mutable

    .PARAMETER InstallUpdatesOnBoot
        Whether to install operating system and package updates when the instance boots. The default value is true. To control when updates are installed, set this value to false. You must then update your instances manually by using CreateDeployment: https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateDeployment to run the update_dependencies stack command or by manually running yum Amazon Linux or apt-get Ubuntu on the instances.
To ensure that your instances have the latest security updates, we strongly recommend using the default value of true.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-installupdatesonboot
        PrimitiveType: Boolean
        UpdateType: Mutable

    .PARAMETER LifecycleEventConfiguration
        A LifeCycleEventConfiguration object that you can use to configure the Shutdown event to specify an execution timeout and enable or disable Elastic Load Balancer connection draining.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-lifecycleeventconfiguration
        Type: LifecycleEventConfiguration
        UpdateType: Mutable

    .PARAMETER LoadBasedAutoScaling
        The load-based scaling configuration for the AWS OpsWorks layer.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-loadbasedautoscaling
        Type: LoadBasedAutoScaling
        UpdateType: Mutable

    .PARAMETER Name
        The layer name, which is used by the console.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-name
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Packages
        An array of Package objects that describes the layer packages.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-packages
        DuplicatesAllowed: True
        PrimitiveItemType: String
        Type: List
        UpdateType: Mutable

    .PARAMETER Shortname
        For custom layers only, use this parameter to specify the layer's short name, which is used internally by AWS OpsWorks Stacks and by Chef recipes. The short name is also used as the name for the directory where your app files are installed. It can have a maximum of 200 characters, which are limited to the alphanumeric characters, '-', '_', and '.'.
The built-in layers' short names are defined by AWS OpsWorks Stacks. For more information, see the Layer Reference: https://docs.aws.amazon.com/opsworks/latest/userguide/layers.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-shortname
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER StackId
        The layer stack ID.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-stackid
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER Tags
        Specifies one or more sets of tags key–value pairs to associate with this AWS OpsWorks layer. Use tags to manage your resources.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-tags
        DuplicatesAllowed: True
        ItemType: Tag
        Type: List
        UpdateType: Mutable

    .PARAMETER Type
        The layer type. A stack cannot have more than one built-in layer of the same type. It can have any number of custom layers. Built-in layers are not available in Chef 12 stacks.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-type
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER UseEbsOptimizedInstances
        Whether to use Amazon EBS-optimized instances.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-useebsoptimizedinstances
        PrimitiveType: Boolean
        UpdateType: Mutable

    .PARAMETER VolumeConfigurations
        A VolumeConfigurations object that describes the layer's Amazon EBS volumes.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html#cfn-opsworks-layer-volumeconfigurations
        DuplicatesAllowed: True
        ItemType: VolumeConfiguration
        Type: List
        UpdateType: Mutable

    .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.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .PARAMETER UpdateReplacePolicy
        Use the UpdateReplacePolicy attribute to retain or (in some cases) backup the existing physical instance of a resource when it is replaced during a stack update operation.

        When you initiate a stack update, AWS CloudFormation updates resources based on differences between what you submit and the stack's current template and parameters. If you update a resource property that requires that the resource be replaced, AWS CloudFormation recreates the resource during the update. Recreating the resource generates a new physical ID. AWS CloudFormation creates the replacement resource first, and then changes references from other dependent resources to point to the replacement resource. By default, AWS CloudFormation then deletes the old resource. Using the UpdateReplacePolicy, you can specify that AWS CloudFormation retain or (in some cases) create a snapshot of the old resource.

        For resources that support snapshots, such as AWS::EC2::Volume, specify Snapshot to have AWS CloudFormation create a snapshot before deleting the old resource instance.

        You can apply the UpdateReplacePolicy attribute to any resource. UpdateReplacePolicy is only executed if you update a resource property whose update behavior is specified as Replacement, thereby causing AWS CloudFormation to replace the old resource with a new one with a new physical ID. For example, if you update the Engine property of an AWS::RDS::DBInstance resource type, AWS CloudFormation creates a new resource and replaces the current DB instance resource with the new one. The UpdateReplacePolicy attribute would then dictate whether AWS CloudFormation deleted, retained, or created a snapshot of the old DB instance. The update behavior for each property of a resource is specified in the reference topic for that resource in the AWS Resource and Property Types Reference. For more information on resource update behavior, see Update Behaviors of Stack Resources.

        The UpdateReplacePolicy attribute applies to stack updates you perform directly, as well as stack updates performed using change sets.

        Note
        Resources that are retained continue to exist and continue to incur applicable charges until you delete those resources. Snapshots that are created with this policy continue to exist and continue to incur applicable charges until you delete those snapshots. UpdateReplacePolicy retains the old physical resource or snapshot, but removes it from AWS CloudFormation's scope.

        UpdateReplacePolicy differs from the DeletionPolicy attribute in that it only applies to resources replaced during stack updates. Use DeletionPolicy for resources deleted when a stack is deleted, or when the resource definition itself is deleted from the template as part of a stack update.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .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.

        This parameter takes a string or list of strings representing Logical IDs of resources that must be created prior to this resource being created.


    .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 or YAML 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.

        This will be returned when describing the resource using AWS CLI.


    .PARAMETER UpdatePolicy
        Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup resource. AWS CloudFormation invokes one of three update policies depending on the type of change you make or whether a scheduled action is associated with the Auto Scaling group.

        You must use the "Add-UpdatePolicy" function or the [UpdatePolicy] class here.
    .PARAMETER Condition
        Logical ID of the condition that this resource needs to be true in order for this resource to be provisioned.

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksLayer])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $true,Position = 0)]
        [ValidateLogicalId()]
        [string]
        $LogicalId,
        [parameter(Mandatory = $false)]
        [IDictionary]
        $Attributes,
        [parameter(Mandatory = $true)]
        [object]
        $AutoAssignElasticIps,
        [parameter(Mandatory = $true)]
        [object]
        $AutoAssignPublicIps,
        [parameter(Mandatory = $false)]
        [object]
        $CustomInstanceProfileArn,
        [parameter(Mandatory = $false)]
        [VSJson]
        $CustomJson,
        [parameter(Mandatory = $false)]
        $CustomRecipes,
        [parameter(Mandatory = $false)]
        $CustomSecurityGroupIds,
        [parameter(Mandatory = $true)]
        [object]
        $EnableAutoHealing,
        [parameter(Mandatory = $false)]
        [object]
        $InstallUpdatesOnBoot,
        [parameter(Mandatory = $false)]
        $LifecycleEventConfiguration,
        [parameter(Mandatory = $false)]
        $LoadBasedAutoScaling,
        [parameter(Mandatory = $true)]
        [object]
        $Name,
        [parameter(Mandatory = $false)]
        $Packages,
        [parameter(Mandatory = $true)]
        [object]
        $Shortname,
        [parameter(Mandatory = $true)]
        [object]
        $StackId,
        [TransformTag()]
        [object]
        [parameter(Mandatory = $false)]
        $Tags,
        [parameter(Mandatory = $true)]
        [object]
        $Type,
        [parameter(Mandatory = $false)]
        [object]
        $UseEbsOptimizedInstances,
        [parameter(Mandatory = $false)]
        [object]
        $VolumeConfigurations,
        [parameter()]
        [DeletionPolicy]
        $DeletionPolicy,
        [parameter()]
        [UpdateReplacePolicy]
        $UpdateReplacePolicy,
        [parameter(Mandatory = $false)]
        [string[]]
        $DependsOn,
        [parameter(Mandatory = $false)]
        [VSJson]
        $Metadata,
        [parameter(Mandatory = $false)]
        [UpdatePolicy]
        $UpdatePolicy,
        [parameter(Mandatory = $false)]
        [string]
        $Condition
    )
    Process {
        $obj = [OpsWorksLayer]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'New-VSOpsWorksLayer'

function New-VSOpsWorksStack {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Stack resource to the template. Creates a new stack. For more information, see Create a New Stack: https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-edit.html.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Stack resource to the template. Creates a new stack. For more information, see Create a New Stack: https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-edit.html.

**Required Permissions**: To use this action, an IAM user must have an attached policy that explicitly grants permissions. For more information about user permissions, see Managing User Permissions: https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html

    .PARAMETER LogicalId
        The logical ID must be alphanumeric (A-Za-z0-9) and unique within the template. 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 volume to an Amazon EC2 instance, you reference the logical IDs to associate the block stores with the instance.

    .PARAMETER AgentVersion
        The default AWS OpsWorks Stacks agent version. You have the following options:
+ Auto-update - Set this parameter to LATEST. AWS OpsWorks Stacks automatically installs new agent versions on the stack's instances as soon as they are available.
+ Fixed version - Set this parameter to your preferred agent version. To update the agent version, you must edit the stack configuration and specify a new version. AWS OpsWorks Stacks then automatically installs that version on the stack's instances.
The default setting is the most recent release of the agent. To specify an agent version, you must use the complete version number, not the abbreviated number shown on the console. For a list of available agent version numbers, call DescribeAgentVersions: https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeAgentVersions. AgentVersion cannot be set to Chef 12.2.
You can also specify an agent version when you create or update an instance, which overrides the stack's default setting.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-agentversion
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Attributes
        One or more user-defined key-value pairs to be added to the stack attributes.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-attributes
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: Map
        UpdateType: Mutable

    .PARAMETER ChefConfiguration
        A ChefConfiguration object that specifies whether to enable Berkshelf and the Berkshelf version on Chef 11.10 stacks. For more information, see Create a New Stack: https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-chefconfiguration
        Type: ChefConfiguration
        UpdateType: Mutable

    .PARAMETER CloneAppIds
        If you're cloning an AWS OpsWorks stack, a list of AWS OpsWorks application stack IDs from the source stack to include in the cloned stack.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-cloneappids
        DuplicatesAllowed: False
        PrimitiveItemType: String
        Type: List
        UpdateType: Immutable

    .PARAMETER ClonePermissions
        If you're cloning an AWS OpsWorks stack, indicates whether to clone the source stack's permissions.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-clonepermissions
        PrimitiveType: Boolean
        UpdateType: Immutable

    .PARAMETER ConfigurationManager
        The configuration manager. When you create a stack we recommend that you use the configuration manager to specify the Chef version: 12, 11.10, or 11.4 for Linux stacks, or 12.2 for Windows stacks. The default value for Linux stacks is currently 12.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-configmanager
        Type: StackConfigurationManager
        UpdateType: Mutable

    .PARAMETER CustomCookbooksSource
        Contains the information required to retrieve an app or cookbook from a repository. For more information, see Adding Apps: https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html or Cookbooks and Recipes: https://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-custcookbooksource
        Type: Source
        UpdateType: Mutable

    .PARAMETER CustomJson
        A string that contains user-defined, custom JSON. It can be used to override the corresponding default stack configuration attribute values or to pass data to recipes. The string should be in the following format:
"{"key1": "value1", "key2": "value2",...}"
For more information about custom JSON, see Use Custom JSON to Modify the Stack Configuration Attributes: https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-json.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-custjson
        PrimitiveType: Json
        UpdateType: Mutable

    .PARAMETER DefaultAvailabilityZone
        The stack's default Availability Zone, which must be in the specified region. For more information, see Regions and Endpoints: https://docs.aws.amazon.com/general/latest/gr/rande.html. If you also specify a value for DefaultSubnetId, the subnet must be in the same zone. For more information, see the VpcId parameter description.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-defaultaz
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER DefaultInstanceProfileArn
        The Amazon Resource Name ARN of an IAM profile that is the default profile for all of the stack's EC2 instances. For more information about IAM ARNs, see Using Identifiers: https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-defaultinstanceprof
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER DefaultOs
        The stack's default operating system, which is installed on every instance unless you specify a different operating system when you create the instance. You can specify one of the following.
+ A supported Linux operating system: An Amazon Linux version, such as Amazon Linux 2018.03, Amazon Linux 2017.09, Amazon Linux 2017.03, Amazon Linux 2016.09, Amazon Linux 2016.03, Amazon Linux 2015.09, or Amazon Linux 2015.03.
+ A supported Ubuntu operating system, such as Ubuntu 16.04 LTS, Ubuntu 14.04 LTS, or Ubuntu 12.04 LTS.
+ CentOS Linux 7
+ Red Hat Enterprise Linux 7
+ A supported Windows operating system, such as Microsoft Windows Server 2012 R2 Base, Microsoft Windows Server 2012 R2 with SQL Server Express, Microsoft Windows Server 2012 R2 with SQL Server Standard, or Microsoft Windows Server 2012 R2 with SQL Server Web.
+ A custom AMI: Custom. You specify the custom AMI you want to use when you create instances. For more information, see Using Custom AMIs: https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-custom-ami.html.
The default option is the current Amazon Linux version. For more information about supported operating systems, see AWS OpsWorks Stacks Operating Systems: https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-os.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-defaultos
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER DefaultRootDeviceType
        The default root device type. This value is the default for all instances in the stack, but you can override it when you create an instance. The default option is instance-store. For more information, see Storage for the Root Device: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ComponentsAMIs.html#storage-for-the-root-device.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-defaultrootdevicetype
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER DefaultSshKeyName
        A default Amazon EC2 key pair name. The default value is none. If you specify a key pair name, AWS OpsWorks installs the public key on the instance and you can use the private key with an SSH client to log in to the instance. For more information, see Using SSH to Communicate with an Instance: https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-ssh.html and Managing SSH Access: https://docs.aws.amazon.com/opsworks/latest/userguide/security-ssh-access.html. You can override this setting by specifying a different key pair, or no key pair, when you create an instance: https://docs.aws.amazon.com/opsworks/latest/userguide/workinginstances-add.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-defaultsshkeyname
        PrimitiveType: String
        UpdateType: Mutable

    .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. This parameter is required if you specify a value for the VpcId parameter. If you also specify a value for DefaultAvailabilityZone, the subnet must be in that zone.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#defaultsubnet
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER EcsClusterArn
        The Amazon Resource Name ARN of the Amazon Elastic Container Service Amazon ECS cluster to register with the AWS OpsWorks stack.
If you specify a cluster that's registered with another AWS OpsWorks stack, AWS CloudFormation deregisters the existing association before registering the cluster.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-ecsclusterarn
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER ElasticIps
        A list of Elastic IP addresses to register with the AWS OpsWorks stack.
If you specify an IP address that's registered with another AWS OpsWorks stack, AWS CloudFormation deregisters the existing association before registering the IP address.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-elasticips
        DuplicatesAllowed: False
        ItemType: ElasticIp
        Type: List
        UpdateType: Mutable

    .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. By default, HostnameTheme is set to Layer_Dependent, which creates host names by appending integers to the layer's short name. The other themes are:
+ Baked_Goods
+ Clouds
+ Europe_Cities
+ Fruits
+ Greek_Deities_and_Titans
+ Legendary_creatures_from_Japan
+ Planets_and_Moons
+ Roman_Deities
+ Scottish_Islands
+ US_Cities
+ Wild_Cats
To obtain a generated host name, call GetHostNameSuggestion, which returns a host name based on the current theme.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-hostnametheme
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Name
        The stack name.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-name
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER RdsDbInstances
        The Amazon Relational Database Service Amazon RDS DB instance to register with the AWS OpsWorks stack.
If you specify a DB instance that's registered with another AWS OpsWorks stack, AWS CloudFormation deregisters the existing association before registering the DB instance.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-rdsdbinstances
        DuplicatesAllowed: False
        ItemType: RdsDbInstance
        Type: List
        UpdateType: Mutable

    .PARAMETER ServiceRoleArn
        The stack's AWS Identity and Access Management IAM role, which allows AWS OpsWorks Stacks to work with AWS resources on your behalf. You must set this parameter to the Amazon Resource Name ARN for an existing IAM role. For more information about IAM ARNs, see Using Identifiers: https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-servicerolearn
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER SourceStackId
        If you're cloning an AWS OpsWorks stack, the stack ID of the source AWS OpsWorks stack to clone.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-sourcestackid
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER Tags
        A map that contains tag keys and tag values that are attached to a stack or layer.
+ The key cannot be empty.
+ The key can be a maximum of 127 characters, and can contain only Unicode letters, numbers, or separators, or the following special characters: + - = . _ : /
+ The value can be a maximum 255 characters, and contain only Unicode letters, numbers, or separators, or the following special characters: + - = . _ : /
+ Leading and trailing white spaces are trimmed from both the key and value.
+ A maximum of 40 tags is allowed for any resource.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-tags
        DuplicatesAllowed: True
        ItemType: Tag
        Type: List
        UpdateType: Mutable

    .PARAMETER UseCustomCookbooks
        Whether the stack uses custom cookbooks.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#usecustcookbooks
        PrimitiveType: Boolean
        UpdateType: Mutable

    .PARAMETER UseOpsworksSecurityGroups
        Whether to associate the AWS OpsWorks Stacks built-in security groups with the stack's layers.
AWS OpsWorks Stacks provides a standard set of built-in security groups, one for each layer, which are associated with layers by default. With UseOpsworksSecurityGroups you can instead provide your own custom security groups. UseOpsworksSecurityGroups has the following settings:
+ True - AWS OpsWorks Stacks automatically associates the appropriate built-in security group with each layer default setting. You can associate additional security groups with a layer after you create it, but you cannot delete the built-in security group.
+ False - AWS OpsWorks Stacks does not associate built-in security groups with layers. You must create appropriate EC2 security groups and associate a security group with each layer that you create. However, you can still manually associate a built-in security group with a layer on creation; custom security groups are required only for those layers that need custom settings.
For more information, see Create a New Stack: https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-creating.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-useopsworkssecuritygroups
        PrimitiveType: Boolean
        UpdateType: Mutable

    .PARAMETER VpcId
        The ID of the VPC that the stack is to be launched into. The VPC must be in the stack's region. All instances are launched into this VPC. You cannot change the ID later.
+ If your account supports EC2-Classic, the default value is no VPC.
+ If your account does not support EC2-Classic, the default value is the default VPC for the specified region.
If the VPC ID corresponds to a default VPC and you have specified either the DefaultAvailabilityZone or the DefaultSubnetId parameter only, AWS OpsWorks Stacks infers the value of the other parameter. If you specify neither parameter, AWS OpsWorks Stacks sets these parameters to the first valid Availability Zone for the specified region and the corresponding default VPC subnet ID, respectively.
If you specify a nondefault VPC ID, note the following:
+ It must belong to a VPC in your account that is in the specified region.
+ You must specify a value for DefaultSubnetId.
For more information about how to use AWS OpsWorks Stacks with a VPC, see Running a Stack in a VPC: https://docs.aws.amazon.com/opsworks/latest/userguide/workingstacks-vpc.html. For more information about default VPC and EC2-Classic, see Supported Platforms: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-supported-platforms.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-stack.html#cfn-opsworks-stack-vpcid
        PrimitiveType: String
        UpdateType: Immutable

    .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.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .PARAMETER UpdateReplacePolicy
        Use the UpdateReplacePolicy attribute to retain or (in some cases) backup the existing physical instance of a resource when it is replaced during a stack update operation.

        When you initiate a stack update, AWS CloudFormation updates resources based on differences between what you submit and the stack's current template and parameters. If you update a resource property that requires that the resource be replaced, AWS CloudFormation recreates the resource during the update. Recreating the resource generates a new physical ID. AWS CloudFormation creates the replacement resource first, and then changes references from other dependent resources to point to the replacement resource. By default, AWS CloudFormation then deletes the old resource. Using the UpdateReplacePolicy, you can specify that AWS CloudFormation retain or (in some cases) create a snapshot of the old resource.

        For resources that support snapshots, such as AWS::EC2::Volume, specify Snapshot to have AWS CloudFormation create a snapshot before deleting the old resource instance.

        You can apply the UpdateReplacePolicy attribute to any resource. UpdateReplacePolicy is only executed if you update a resource property whose update behavior is specified as Replacement, thereby causing AWS CloudFormation to replace the old resource with a new one with a new physical ID. For example, if you update the Engine property of an AWS::RDS::DBInstance resource type, AWS CloudFormation creates a new resource and replaces the current DB instance resource with the new one. The UpdateReplacePolicy attribute would then dictate whether AWS CloudFormation deleted, retained, or created a snapshot of the old DB instance. The update behavior for each property of a resource is specified in the reference topic for that resource in the AWS Resource and Property Types Reference. For more information on resource update behavior, see Update Behaviors of Stack Resources.

        The UpdateReplacePolicy attribute applies to stack updates you perform directly, as well as stack updates performed using change sets.

        Note
        Resources that are retained continue to exist and continue to incur applicable charges until you delete those resources. Snapshots that are created with this policy continue to exist and continue to incur applicable charges until you delete those snapshots. UpdateReplacePolicy retains the old physical resource or snapshot, but removes it from AWS CloudFormation's scope.

        UpdateReplacePolicy differs from the DeletionPolicy attribute in that it only applies to resources replaced during stack updates. Use DeletionPolicy for resources deleted when a stack is deleted, or when the resource definition itself is deleted from the template as part of a stack update.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .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.

        This parameter takes a string or list of strings representing Logical IDs of resources that must be created prior to this resource being created.


    .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 or YAML 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.

        This will be returned when describing the resource using AWS CLI.


    .PARAMETER UpdatePolicy
        Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup resource. AWS CloudFormation invokes one of three update policies depending on the type of change you make or whether a scheduled action is associated with the Auto Scaling group.

        You must use the "Add-UpdatePolicy" function or the [UpdatePolicy] class here.
    .PARAMETER Condition
        Logical ID of the condition that this resource needs to be true in order for this resource to be provisioned.

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksStack])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $true,Position = 0)]
        [ValidateLogicalId()]
        [string]
        $LogicalId,
        [parameter(Mandatory = $false)]
        [object]
        $AgentVersion,
        [parameter(Mandatory = $false)]
        [IDictionary]
        $Attributes,
        [parameter(Mandatory = $false)]
        $ChefConfiguration,
        [parameter(Mandatory = $false)]
        $CloneAppIds,
        [parameter(Mandatory = $false)]
        [object]
        $ClonePermissions,
        [parameter(Mandatory = $false)]
        $ConfigurationManager,
        [parameter(Mandatory = $false)]
        $CustomCookbooksSource,
        [parameter(Mandatory = $false)]
        [VSJson]
        $CustomJson,
        [parameter(Mandatory = $false)]
        [object]
        $DefaultAvailabilityZone,
        [parameter(Mandatory = $true)]
        [object]
        $DefaultInstanceProfileArn,
        [parameter(Mandatory = $false)]
        [object]
        $DefaultOs,
        [parameter(Mandatory = $false)]
        [object]
        $DefaultRootDeviceType,
        [parameter(Mandatory = $false)]
        [object]
        $DefaultSshKeyName,
        [parameter(Mandatory = $false)]
        [object]
        $DefaultSubnetId,
        [parameter(Mandatory = $false)]
        [object]
        $EcsClusterArn,
        [parameter(Mandatory = $false)]
        [object]
        $ElasticIps,
        [parameter(Mandatory = $false)]
        [object]
        $HostnameTheme,
        [parameter(Mandatory = $true)]
        [object]
        $Name,
        [parameter(Mandatory = $false)]
        [object]
        $RdsDbInstances,
        [parameter(Mandatory = $true)]
        [object]
        $ServiceRoleArn,
        [parameter(Mandatory = $false)]
        [object]
        $SourceStackId,
        [TransformTag()]
        [object]
        [parameter(Mandatory = $false)]
        $Tags,
        [parameter(Mandatory = $false)]
        [object]
        $UseCustomCookbooks,
        [parameter(Mandatory = $false)]
        [object]
        $UseOpsworksSecurityGroups,
        [parameter(Mandatory = $false)]
        [object]
        $VpcId,
        [parameter()]
        [DeletionPolicy]
        $DeletionPolicy,
        [parameter()]
        [UpdateReplacePolicy]
        $UpdateReplacePolicy,
        [parameter(Mandatory = $false)]
        [string[]]
        $DependsOn,
        [parameter(Mandatory = $false)]
        [VSJson]
        $Metadata,
        [parameter(Mandatory = $false)]
        [UpdatePolicy]
        $UpdatePolicy,
        [parameter(Mandatory = $false)]
        [string]
        $Condition
    )
    Process {
        $obj = [OpsWorksStack]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'New-VSOpsWorksStack'

function New-VSOpsWorksUserProfile {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::UserProfile resource to the template. Describes a user's SSH information.

    .DESCRIPTION
        Adds an AWS::OpsWorks::UserProfile resource to the template. Describes a user's SSH information.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-userprofile.html

    .PARAMETER LogicalId
        The logical ID must be alphanumeric (A-Za-z0-9) and unique within the template. 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 volume to an Amazon EC2 instance, you reference the logical IDs to associate the block stores with the instance.

    .PARAMETER AllowSelfManagement
        Whether users can specify their own SSH public key through the My Settings page. For more information, see Managing User Permissions: https://docs.aws.amazon.com/opsworks/latest/userguide/security-settingsshkey.html.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-userprofile.html#cfn-opsworks-userprofile-allowselfmanagement
        PrimitiveType: Boolean
        UpdateType: Mutable

    .PARAMETER IamUserArn
        The user's IAM ARN.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-userprofile.html#cfn-opsworks-userprofile-iamuserarn
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER SshPublicKey
        The user's SSH public key.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-userprofile.html#cfn-opsworks-userprofile-sshpublickey
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER SshUsername
        The user's SSH user name.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-userprofile.html#cfn-opsworks-userprofile-sshusername
        PrimitiveType: String
        UpdateType: Mutable

    .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.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .PARAMETER UpdateReplacePolicy
        Use the UpdateReplacePolicy attribute to retain or (in some cases) backup the existing physical instance of a resource when it is replaced during a stack update operation.

        When you initiate a stack update, AWS CloudFormation updates resources based on differences between what you submit and the stack's current template and parameters. If you update a resource property that requires that the resource be replaced, AWS CloudFormation recreates the resource during the update. Recreating the resource generates a new physical ID. AWS CloudFormation creates the replacement resource first, and then changes references from other dependent resources to point to the replacement resource. By default, AWS CloudFormation then deletes the old resource. Using the UpdateReplacePolicy, you can specify that AWS CloudFormation retain or (in some cases) create a snapshot of the old resource.

        For resources that support snapshots, such as AWS::EC2::Volume, specify Snapshot to have AWS CloudFormation create a snapshot before deleting the old resource instance.

        You can apply the UpdateReplacePolicy attribute to any resource. UpdateReplacePolicy is only executed if you update a resource property whose update behavior is specified as Replacement, thereby causing AWS CloudFormation to replace the old resource with a new one with a new physical ID. For example, if you update the Engine property of an AWS::RDS::DBInstance resource type, AWS CloudFormation creates a new resource and replaces the current DB instance resource with the new one. The UpdateReplacePolicy attribute would then dictate whether AWS CloudFormation deleted, retained, or created a snapshot of the old DB instance. The update behavior for each property of a resource is specified in the reference topic for that resource in the AWS Resource and Property Types Reference. For more information on resource update behavior, see Update Behaviors of Stack Resources.

        The UpdateReplacePolicy attribute applies to stack updates you perform directly, as well as stack updates performed using change sets.

        Note
        Resources that are retained continue to exist and continue to incur applicable charges until you delete those resources. Snapshots that are created with this policy continue to exist and continue to incur applicable charges until you delete those snapshots. UpdateReplacePolicy retains the old physical resource or snapshot, but removes it from AWS CloudFormation's scope.

        UpdateReplacePolicy differs from the DeletionPolicy attribute in that it only applies to resources replaced during stack updates. Use DeletionPolicy for resources deleted when a stack is deleted, or when the resource definition itself is deleted from the template as part of a stack update.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .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.

        This parameter takes a string or list of strings representing Logical IDs of resources that must be created prior to this resource being created.


    .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 or YAML 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.

        This will be returned when describing the resource using AWS CLI.


    .PARAMETER UpdatePolicy
        Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup resource. AWS CloudFormation invokes one of three update policies depending on the type of change you make or whether a scheduled action is associated with the Auto Scaling group.

        You must use the "Add-UpdatePolicy" function or the [UpdatePolicy] class here.
    .PARAMETER Condition
        Logical ID of the condition that this resource needs to be true in order for this resource to be provisioned.

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksUserProfile])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $true,Position = 0)]
        [ValidateLogicalId()]
        [string]
        $LogicalId,
        [parameter(Mandatory = $false)]
        [object]
        $AllowSelfManagement,
        [parameter(Mandatory = $true)]
        [object]
        $IamUserArn,
        [parameter(Mandatory = $false)]
        [object]
        $SshPublicKey,
        [parameter(Mandatory = $false)]
        [object]
        $SshUsername,
        [parameter()]
        [DeletionPolicy]
        $DeletionPolicy,
        [parameter()]
        [UpdateReplacePolicy]
        $UpdateReplacePolicy,
        [parameter(Mandatory = $false)]
        [string[]]
        $DependsOn,
        [parameter(Mandatory = $false)]
        [VSJson]
        $Metadata,
        [parameter(Mandatory = $false)]
        [UpdatePolicy]
        $UpdatePolicy,
        [parameter(Mandatory = $false)]
        [string]
        $Condition
    )
    Process {
        $obj = [OpsWorksUserProfile]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'New-VSOpsWorksUserProfile'

function New-VSOpsWorksVolume {
    <#
    .SYNOPSIS
        Adds an AWS::OpsWorks::Volume resource to the template. Describes an instance's Amazon EBS volume.

    .DESCRIPTION
        Adds an AWS::OpsWorks::Volume resource to the template. Describes an instance's Amazon EBS volume.

    .LINK
        http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-volume.html

    .PARAMETER LogicalId
        The logical ID must be alphanumeric (A-Za-z0-9) and unique within the template. 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 volume to an Amazon EC2 instance, you reference the logical IDs to associate the block stores with the instance.

    .PARAMETER Ec2VolumeId
        The Amazon EC2 volume ID.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-volume.html#cfn-opsworks-volume-ec2volumeid
        PrimitiveType: String
        UpdateType: Immutable

    .PARAMETER MountPoint
        The volume mount point. For example, "/mnt/disk1".

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-volume.html#cfn-opsworks-volume-mountpoint
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER Name
        The volume name.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-volume.html#cfn-opsworks-volume-name
        PrimitiveType: String
        UpdateType: Mutable

    .PARAMETER StackId
        The stack ID.

        Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-volume.html#cfn-opsworks-volume-stackid
        PrimitiveType: String
        UpdateType: Immutable

    .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.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .PARAMETER UpdateReplacePolicy
        Use the UpdateReplacePolicy attribute to retain or (in some cases) backup the existing physical instance of a resource when it is replaced during a stack update operation.

        When you initiate a stack update, AWS CloudFormation updates resources based on differences between what you submit and the stack's current template and parameters. If you update a resource property that requires that the resource be replaced, AWS CloudFormation recreates the resource during the update. Recreating the resource generates a new physical ID. AWS CloudFormation creates the replacement resource first, and then changes references from other dependent resources to point to the replacement resource. By default, AWS CloudFormation then deletes the old resource. Using the UpdateReplacePolicy, you can specify that AWS CloudFormation retain or (in some cases) create a snapshot of the old resource.

        For resources that support snapshots, such as AWS::EC2::Volume, specify Snapshot to have AWS CloudFormation create a snapshot before deleting the old resource instance.

        You can apply the UpdateReplacePolicy attribute to any resource. UpdateReplacePolicy is only executed if you update a resource property whose update behavior is specified as Replacement, thereby causing AWS CloudFormation to replace the old resource with a new one with a new physical ID. For example, if you update the Engine property of an AWS::RDS::DBInstance resource type, AWS CloudFormation creates a new resource and replaces the current DB instance resource with the new one. The UpdateReplacePolicy attribute would then dictate whether AWS CloudFormation deleted, retained, or created a snapshot of the old DB instance. The update behavior for each property of a resource is specified in the reference topic for that resource in the AWS Resource and Property Types Reference. For more information on resource update behavior, see Update Behaviors of Stack Resources.

        The UpdateReplacePolicy attribute applies to stack updates you perform directly, as well as stack updates performed using change sets.

        Note
        Resources that are retained continue to exist and continue to incur applicable charges until you delete those resources. Snapshots that are created with this policy continue to exist and continue to incur applicable charges until you delete those snapshots. UpdateReplacePolicy retains the old physical resource or snapshot, but removes it from AWS CloudFormation's scope.

        UpdateReplacePolicy differs from the DeletionPolicy attribute in that it only applies to resources replaced during stack updates. Use DeletionPolicy for resources deleted when a stack is deleted, or when the resource definition itself is deleted from the template as part of a stack update.

        You must use one of the following options: "Delete","Retain","Snapshot"

    .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.

        This parameter takes a string or list of strings representing Logical IDs of resources that must be created prior to this resource being created.


    .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 or YAML 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.

        This will be returned when describing the resource using AWS CLI.


    .PARAMETER UpdatePolicy
        Use the UpdatePolicy attribute to specify how AWS CloudFormation handles updates to the AWS::AutoScaling::AutoScalingGroup resource. AWS CloudFormation invokes one of three update policies depending on the type of change you make or whether a scheduled action is associated with the Auto Scaling group.

        You must use the "Add-UpdatePolicy" function or the [UpdatePolicy] class here.
    .PARAMETER Condition
        Logical ID of the condition that this resource needs to be true in order for this resource to be provisioned.

    .FUNCTIONALITY
        Vaporshell
    #>

    [OutputType([OpsWorksVolume])]
    [cmdletbinding()]
    Param(
        [parameter(Mandatory = $true,Position = 0)]
        [ValidateLogicalId()]
        [string]
        $LogicalId,
        [parameter(Mandatory = $true)]
        [object]
        $Ec2VolumeId,
        [parameter(Mandatory = $false)]
        [object]
        $MountPoint,
        [parameter(Mandatory = $false)]
        [object]
        $Name,
        [parameter(Mandatory = $true)]
        [object]
        $StackId,
        [parameter()]
        [DeletionPolicy]
        $DeletionPolicy,
        [parameter()]
        [UpdateReplacePolicy]
        $UpdateReplacePolicy,
        [parameter(Mandatory = $false)]
        [string[]]
        $DependsOn,
        [parameter(Mandatory = $false)]
        [VSJson]
        $Metadata,
        [parameter(Mandatory = $false)]
        [UpdatePolicy]
        $UpdatePolicy,
        [parameter(Mandatory = $false)]
        [string]
        $Condition
    )
    Process {
        $obj = [OpsWorksVolume]::new($PSBoundParameters)
        Write-Debug "$($MyInvocation.MyCommand) PSBoundParameters:`n$($PSBoundParameters | ConvertTo-Json -Depth 20 | Format-Json)"
        Write-Verbose "Resulting object from $($MyInvocation.MyCommand): `n$($obj.ToJson() | Format-Json)"
        $obj
    }
}

Export-ModuleMember -Function 'New-VSOpsWorksVolume'