VaporShell.Lambda.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-VSLambdaAliasAliasRoutingConfiguration { <# .SYNOPSIS Adds an AWS::Lambda::Alias.AliasRoutingConfiguration resource property to the template. The traffic-shifting: https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html configuration of a Lambda function alias. .DESCRIPTION Adds an AWS::Lambda::Alias.AliasRoutingConfiguration resource property to the template. The traffic-shifting: https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html configuration of a Lambda function alias. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-alias-aliasroutingconfiguration.html .PARAMETER AdditionalVersionWeights The name of the second alias, and the percentage of traffic that's routed to it. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-alias-aliasroutingconfiguration.html#cfn-lambda-alias-aliasroutingconfiguration-additionalversionweights DuplicatesAllowed: False ItemType: VersionWeight Type: List UpdateType: Mutable .FUNCTIONALITY Vaporshell #> [OutputType([LambdaAliasAliasRoutingConfiguration])] [cmdletbinding()] Param( [parameter(Mandatory = $true)] [object] $AdditionalVersionWeights ) Process { $obj = [LambdaAliasAliasRoutingConfiguration]::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-VSLambdaAliasAliasRoutingConfiguration' function Add-VSLambdaAliasProvisionedConcurrencyConfiguration { <# .SYNOPSIS Adds an AWS::Lambda::Alias.ProvisionedConcurrencyConfiguration resource property to the template. A provisioned concurrency configuration for a function's alias. .DESCRIPTION Adds an AWS::Lambda::Alias.ProvisionedConcurrencyConfiguration resource property to the template. A provisioned concurrency configuration for a function's alias. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-alias-provisionedconcurrencyconfiguration.html .PARAMETER ProvisionedConcurrentExecutions The amount of provisioned concurrency to allocate for the alias. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-alias-provisionedconcurrencyconfiguration.html#cfn-lambda-alias-provisionedconcurrencyconfiguration-provisionedconcurrentexecutions PrimitiveType: Integer UpdateType: Mutable .FUNCTIONALITY Vaporshell #> [OutputType([LambdaAliasProvisionedConcurrencyConfiguration])] [cmdletbinding()] Param( [parameter(Mandatory = $true)] [object] $ProvisionedConcurrentExecutions ) Process { $obj = [LambdaAliasProvisionedConcurrencyConfiguration]::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-VSLambdaAliasProvisionedConcurrencyConfiguration' function Add-VSLambdaAliasVersionWeight { <# .SYNOPSIS Adds an AWS::Lambda::Alias.VersionWeight resource property to the template. The traffic-shifting: https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html configuration of a Lambda function alias. .DESCRIPTION Adds an AWS::Lambda::Alias.VersionWeight resource property to the template. The traffic-shifting: https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html configuration of a Lambda function alias. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-alias-versionweight.html .PARAMETER FunctionVersion The qualifier of the second version. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-alias-versionweight.html#cfn-lambda-alias-versionweight-functionversion PrimitiveType: String UpdateType: Mutable .PARAMETER FunctionWeight The percentage of traffic that the alias routes to the second version. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-alias-versionweight.html#cfn-lambda-alias-versionweight-functionweight PrimitiveType: Double UpdateType: Mutable .FUNCTIONALITY Vaporshell #> [OutputType([LambdaAliasVersionWeight])] [cmdletbinding()] Param( [parameter(Mandatory = $true)] [object] $FunctionVersion, [parameter(Mandatory = $true)] [object] $FunctionWeight ) Process { $obj = [LambdaAliasVersionWeight]::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-VSLambdaAliasVersionWeight' function Add-VSLambdaCodeSigningConfigAllowedPublishers { <# .SYNOPSIS Adds an AWS::Lambda::CodeSigningConfig.AllowedPublishers resource property to the template. .DESCRIPTION Adds an AWS::Lambda::CodeSigningConfig.AllowedPublishers resource property to the template. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-codesigningconfig-allowedpublishers.html .PARAMETER SigningProfileVersionArns Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-codesigningconfig-allowedpublishers.html#cfn-lambda-codesigningconfig-allowedpublishers-signingprofileversionarns UpdateType: Mutable Type: List PrimitiveItemType: String .FUNCTIONALITY Vaporshell #> [OutputType([LambdaCodeSigningConfigAllowedPublishers])] [cmdletbinding()] Param( [parameter(Mandatory = $true)] $SigningProfileVersionArns ) Process { $obj = [LambdaCodeSigningConfigAllowedPublishers]::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-VSLambdaCodeSigningConfigAllowedPublishers' function Add-VSLambdaCodeSigningConfigCodeSigningPolicies { <# .SYNOPSIS Adds an AWS::Lambda::CodeSigningConfig.CodeSigningPolicies resource property to the template. .DESCRIPTION Adds an AWS::Lambda::CodeSigningConfig.CodeSigningPolicies resource property to the template. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-codesigningconfig-codesigningpolicies.html .PARAMETER UntrustedArtifactOnDeployment Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-codesigningconfig-codesigningpolicies.html#cfn-lambda-codesigningconfig-codesigningpolicies-untrustedartifactondeployment UpdateType: Mutable PrimitiveType: String .FUNCTIONALITY Vaporshell #> [OutputType([LambdaCodeSigningConfigCodeSigningPolicies])] [cmdletbinding()] Param( [parameter(Mandatory = $true)] [object] $UntrustedArtifactOnDeployment ) Process { $obj = [LambdaCodeSigningConfigCodeSigningPolicies]::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-VSLambdaCodeSigningConfigCodeSigningPolicies' function Add-VSLambdaEventInvokeConfigDestinationConfig { <# .SYNOPSIS Adds an AWS::Lambda::EventInvokeConfig.DestinationConfig resource property to the template. A configuration object that specifies the destination of an event after Lambda processes it. .DESCRIPTION Adds an AWS::Lambda::EventInvokeConfig.DestinationConfig resource property to the template. A configuration object that specifies the destination of an event after Lambda processes it. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventinvokeconfig-destinationconfig.html .PARAMETER OnSuccess The destination configuration for successful invocations. Type: OnSuccess Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventinvokeconfig-destinationconfig.html#cfn-lambda-eventinvokeconfig-destinationconfig-onsuccess UpdateType: Mutable .PARAMETER OnFailure The destination configuration for failed invocations. Type: OnFailure Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventinvokeconfig-destinationconfig.html#cfn-lambda-eventinvokeconfig-destinationconfig-onfailure UpdateType: Mutable .FUNCTIONALITY Vaporshell #> [OutputType([LambdaEventInvokeConfigDestinationConfig])] [cmdletbinding()] Param( [parameter(Mandatory = $false)] $OnSuccess, [parameter(Mandatory = $false)] $OnFailure ) Process { $obj = [LambdaEventInvokeConfigDestinationConfig]::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-VSLambdaEventInvokeConfigDestinationConfig' function Add-VSLambdaEventInvokeConfigOnFailure { <# .SYNOPSIS Adds an AWS::Lambda::EventInvokeConfig.OnFailure resource property to the template. A destination for events that failed processing. .DESCRIPTION Adds an AWS::Lambda::EventInvokeConfig.OnFailure resource property to the template. A destination for events that failed processing. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventinvokeconfig-destinationconfig-onfailure.html .PARAMETER Destination The Amazon Resource Name ARN of the destination resource. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventinvokeconfig-destinationconfig-onfailure.html#cfn-lambda-eventinvokeconfig-destinationconfig-onfailure-destination PrimitiveType: String UpdateType: Mutable .FUNCTIONALITY Vaporshell #> [OutputType([LambdaEventInvokeConfigOnFailure])] [cmdletbinding()] Param( [parameter(Mandatory = $true)] [object] $Destination ) Process { $obj = [LambdaEventInvokeConfigOnFailure]::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-VSLambdaEventInvokeConfigOnFailure' function Add-VSLambdaEventInvokeConfigOnSuccess { <# .SYNOPSIS Adds an AWS::Lambda::EventInvokeConfig.OnSuccess resource property to the template. A destination for events that were processed successfully. .DESCRIPTION Adds an AWS::Lambda::EventInvokeConfig.OnSuccess resource property to the template. A destination for events that were processed successfully. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventinvokeconfig-destinationconfig-onsuccess.html .PARAMETER Destination The Amazon Resource Name ARN of the destination resource. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventinvokeconfig-destinationconfig-onsuccess.html#cfn-lambda-eventinvokeconfig-destinationconfig-onsuccess-destination PrimitiveType: String UpdateType: Mutable .FUNCTIONALITY Vaporshell #> [OutputType([LambdaEventInvokeConfigOnSuccess])] [cmdletbinding()] Param( [parameter(Mandatory = $true)] [object] $Destination ) Process { $obj = [LambdaEventInvokeConfigOnSuccess]::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-VSLambdaEventInvokeConfigOnSuccess' function Add-VSLambdaEventSourceMappingDestinationConfig { <# .SYNOPSIS Adds an AWS::Lambda::EventSourceMapping.DestinationConfig resource property to the template. (Streams An Amazon SQS queue or Amazon SNS topic destination for discarded records. .DESCRIPTION Adds an AWS::Lambda::EventSourceMapping.DestinationConfig resource property to the template. (Streams An Amazon SQS queue or Amazon SNS topic destination for discarded records. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-destinationconfig.html .PARAMETER OnFailure The destination configuration for failed invocations. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-destinationconfig.html#cfn-lambda-eventsourcemapping-destinationconfig-onfailure UpdateType: Mutable Type: OnFailure .FUNCTIONALITY Vaporshell #> [OutputType([LambdaEventSourceMappingDestinationConfig])] [cmdletbinding()] Param( [parameter(Mandatory = $false)] $OnFailure ) Process { $obj = [LambdaEventSourceMappingDestinationConfig]::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-VSLambdaEventSourceMappingDestinationConfig' function Add-VSLambdaEventSourceMappingEndpoints { <# .SYNOPSIS Adds an AWS::Lambda::EventSourceMapping.Endpoints resource property to the template. .DESCRIPTION Adds an AWS::Lambda::EventSourceMapping.Endpoints resource property to the template. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-endpoints.html .PARAMETER KafkaBootstrapServers Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-endpoints.html#cfn-lambda-eventsourcemapping-endpoints-kafkabootstrapservers UpdateType: Immutable Type: List PrimitiveItemType: String DuplicatesAllowed: False .FUNCTIONALITY Vaporshell #> [OutputType([LambdaEventSourceMappingEndpoints])] [cmdletbinding()] Param( [parameter(Mandatory = $false)] $KafkaBootstrapServers ) Process { $obj = [LambdaEventSourceMappingEndpoints]::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-VSLambdaEventSourceMappingEndpoints' function Add-VSLambdaEventSourceMappingOnFailure { <# .SYNOPSIS Adds an AWS::Lambda::EventSourceMapping.OnFailure resource property to the template. A destination for events that failed processing. .DESCRIPTION Adds an AWS::Lambda::EventSourceMapping.OnFailure resource property to the template. A destination for events that failed processing. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-onfailure.html .PARAMETER Destination The Amazon Resource Name ARN of the destination resource. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-onfailure.html#cfn-lambda-eventsourcemapping-onfailure-destination UpdateType: Mutable PrimitiveType: String .FUNCTIONALITY Vaporshell #> [OutputType([LambdaEventSourceMappingOnFailure])] [cmdletbinding()] Param( [parameter(Mandatory = $false)] [object] $Destination ) Process { $obj = [LambdaEventSourceMappingOnFailure]::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-VSLambdaEventSourceMappingOnFailure' function Add-VSLambdaEventSourceMappingSelfManagedEventSource { <# .SYNOPSIS Adds an AWS::Lambda::EventSourceMapping.SelfManagedEventSource resource property to the template. .DESCRIPTION Adds an AWS::Lambda::EventSourceMapping.SelfManagedEventSource resource property to the template. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-selfmanagedeventsource.html .PARAMETER Endpoints Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-selfmanagedeventsource.html#cfn-lambda-eventsourcemapping-selfmanagedeventsource-endpoints UpdateType: Immutable Type: Endpoints .FUNCTIONALITY Vaporshell #> [OutputType([LambdaEventSourceMappingSelfManagedEventSource])] [cmdletbinding()] Param( [parameter(Mandatory = $false)] $Endpoints ) Process { $obj = [LambdaEventSourceMappingSelfManagedEventSource]::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-VSLambdaEventSourceMappingSelfManagedEventSource' function Add-VSLambdaEventSourceMappingSourceAccessConfiguration { <# .SYNOPSIS Adds an AWS::Lambda::EventSourceMapping.SourceAccessConfiguration resource property to the template. .DESCRIPTION Adds an AWS::Lambda::EventSourceMapping.SourceAccessConfiguration resource property to the template. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-sourceaccessconfiguration.html .PARAMETER Type Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-sourceaccessconfiguration.html#cfn-lambda-eventsourcemapping-sourceaccessconfiguration-type UpdateType: Mutable PrimitiveType: String .PARAMETER URI Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-eventsourcemapping-sourceaccessconfiguration.html#cfn-lambda-eventsourcemapping-sourceaccessconfiguration-uri UpdateType: Mutable PrimitiveType: String .FUNCTIONALITY Vaporshell #> [OutputType([LambdaEventSourceMappingSourceAccessConfiguration])] [cmdletbinding()] Param( [parameter(Mandatory = $false)] [object] $Type, [parameter(Mandatory = $false)] [object] $URI ) Process { $obj = [LambdaEventSourceMappingSourceAccessConfiguration]::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-VSLambdaEventSourceMappingSourceAccessConfiguration' function Add-VSLambdaFunctionCode { <# .SYNOPSIS Adds an AWS::Lambda::Function.Code resource property to the template. The deployment package for a Lambda function. For all runtimes, you can specify the location of an object in Amazon S3. For Node.js and Python functions, you can specify the function code inline in the template. .DESCRIPTION Adds an AWS::Lambda::Function.Code resource property to the template. The deployment package for a Lambda function. For all runtimes, you can specify the location of an object in Amazon S3. For Node.js and Python functions, you can specify the function code inline in the template. Changes to a deployment package in Amazon S3 are not detected automatically during stack updates. To update the function code, change the object key or version in the template. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html .PARAMETER S3Bucket An Amazon S3 bucket in the same AWS Region as your function. The bucket can be in a different AWS account. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3bucket UpdateType: Mutable PrimitiveType: String .PARAMETER S3Key The Amazon S3 key of the deployment package. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3key UpdateType: Mutable PrimitiveType: String .PARAMETER S3ObjectVersion For versioned objects, the version of the deployment package object to use. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-s3objectversion UpdateType: Mutable PrimitiveType: String .PARAMETER ZipFile Node.js and Python The source code of your Lambda function. If you include your function source inline with this parameter, AWS CloudFormation places it in a file named index and zips it to create a deployment package: https://docs.aws.amazon.com/lambda/latest/dg/deployment-package-v2.html. For the Handler property, the first part of the handler identifier must be index. For example, index.handler. Your source code can contain up to 4096 characters. For JSON, you must escape quotes and special characters such as newline n with a backslash. If you specify a function that interacts with an AWS CloudFormation custom resource, you don't have to write your own functions to send responses to the custom resource that invoked the function. AWS CloudFormation provides a response module cfn-response: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-lambda-function-code-cfnresponsemodule.html that simplifies sending responses. See Using AWS Lambda with AWS CloudFormation: https://docs.aws.amazon.com/lambda/latest/dg/services-cloudformation.html for details. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-zipfile UpdateType: Mutable PrimitiveType: String .PARAMETER ImageUri Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-code.html#cfn-lambda-function-code-imageuri UpdateType: Mutable PrimitiveType: String .FUNCTIONALITY Vaporshell #> [OutputType([LambdaFunctionCode])] [cmdletbinding()] Param( [parameter(Mandatory = $false)] [object] $S3Bucket, [parameter(Mandatory = $false)] [object] $S3Key, [parameter(Mandatory = $false)] [object] $S3ObjectVersion, [parameter(Mandatory = $false)] [object] $ZipFile, [parameter(Mandatory = $false)] [object] $ImageUri ) Process { $params = $PSBoundParameters $params['ZipFile'] = [System.IO.File]::ReadAllText($ZipFilePath) $params.Remove('ZipFile') | Out-Null $obj = [LambdaFunctionCode]::new($params) 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-VSLambdaFunctionCode' function Add-VSLambdaFunctionDeadLetterConfig { <# .SYNOPSIS Adds an AWS::Lambda::Function.DeadLetterConfig resource property to the template. The dead-letter queue: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq for failed asynchronous invocations. .DESCRIPTION Adds an AWS::Lambda::Function.DeadLetterConfig resource property to the template. The dead-letter queue: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq for failed asynchronous invocations. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-deadletterconfig.html .PARAMETER TargetArn The Amazon Resource Name ARN of an Amazon SQS queue or Amazon SNS topic. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-deadletterconfig.html#cfn-lambda-function-deadletterconfig-targetarn UpdateType: Mutable PrimitiveType: String .FUNCTIONALITY Vaporshell #> [OutputType([LambdaFunctionDeadLetterConfig])] [cmdletbinding()] Param( [parameter(Mandatory = $false)] [object] $TargetArn ) Process { $obj = [LambdaFunctionDeadLetterConfig]::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-VSLambdaFunctionDeadLetterConfig' function Add-VSLambdaFunctionEnvironment { <# .SYNOPSIS Adds an AWS::Lambda::Function.Environment resource property to the template. A function's environment variable settings. .DESCRIPTION Adds an AWS::Lambda::Function.Environment resource property to the template. A function's environment variable settings. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-environment.html .PARAMETER Variables Environment variable key-value pairs. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-environment.html#cfn-lambda-function-environment-variables UpdateType: Mutable Type: Map PrimitiveItemType: String .FUNCTIONALITY Vaporshell #> [OutputType([LambdaFunctionEnvironment])] [cmdletbinding()] Param( [parameter(Mandatory = $false)] [IDictionary] $Variables ) Process { $obj = [LambdaFunctionEnvironment]::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-VSLambdaFunctionEnvironment' function Add-VSLambdaFunctionFileSystemConfig { <# .SYNOPSIS Adds an AWS::Lambda::Function.FileSystemConfig resource property to the template. .DESCRIPTION Adds an AWS::Lambda::Function.FileSystemConfig resource property to the template. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-filesystemconfig.html .PARAMETER Arn Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-filesystemconfig.html#cfn-lambda-function-filesystemconfig-arn UpdateType: Mutable PrimitiveType: String .PARAMETER LocalMountPath Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-filesystemconfig.html#cfn-lambda-function-filesystemconfig-localmountpath UpdateType: Mutable PrimitiveType: String .FUNCTIONALITY Vaporshell #> [OutputType([LambdaFunctionFileSystemConfig])] [cmdletbinding()] Param( [parameter(Mandatory = $true)] [object] $Arn, [parameter(Mandatory = $true)] [object] $LocalMountPath ) Process { $obj = [LambdaFunctionFileSystemConfig]::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-VSLambdaFunctionFileSystemConfig' function Add-VSLambdaFunctionImageConfig { <# .SYNOPSIS Adds an AWS::Lambda::Function.ImageConfig resource property to the template. .DESCRIPTION Adds an AWS::Lambda::Function.ImageConfig resource property to the template. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-imageconfig.html .PARAMETER EntryPoint Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-imageconfig.html#cfn-lambda-function-imageconfig-entrypoint UpdateType: Mutable Type: List PrimitiveItemType: String DuplicatesAllowed: False .PARAMETER Command Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-imageconfig.html#cfn-lambda-function-imageconfig-command UpdateType: Mutable Type: List PrimitiveItemType: String DuplicatesAllowed: False .PARAMETER WorkingDirectory Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-imageconfig.html#cfn-lambda-function-imageconfig-workingdirectory UpdateType: Mutable PrimitiveType: String .FUNCTIONALITY Vaporshell #> [OutputType([LambdaFunctionImageConfig])] [cmdletbinding()] Param( [parameter(Mandatory = $false)] $EntryPoint, [parameter(Mandatory = $false)] $Command, [parameter(Mandatory = $false)] [object] $WorkingDirectory ) Process { $obj = [LambdaFunctionImageConfig]::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-VSLambdaFunctionImageConfig' function Add-VSLambdaFunctionTracingConfig { <# .SYNOPSIS Adds an AWS::Lambda::Function.TracingConfig resource property to the template. The function's AWS X-Ray tracing configuration. To sample and record incoming requests, set Mode to Active. .DESCRIPTION Adds an AWS::Lambda::Function.TracingConfig resource property to the template. The function's AWS X-Ray tracing configuration. To sample and record incoming requests, set Mode to Active. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-tracingconfig.html .PARAMETER Mode The tracing mode. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-tracingconfig.html#cfn-lambda-function-tracingconfig-mode UpdateType: Mutable PrimitiveType: String .FUNCTIONALITY Vaporshell #> [OutputType([LambdaFunctionTracingConfig])] [cmdletbinding()] Param( [parameter(Mandatory = $false)] [object] $Mode ) Process { $obj = [LambdaFunctionTracingConfig]::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-VSLambdaFunctionTracingConfig' function Add-VSLambdaFunctionVpcConfig { <# .SYNOPSIS Adds an AWS::Lambda::Function.VpcConfig resource property to the template. The VPC security groups and subnets that are attached to a Lambda function. When you connect a function to a VPC, Lambda creates an elastic network interface for each combination of security group and subnet in the function's VPC configuration. The function can only access resources and the internet through that VPC. For more information, see VPC Settings: https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html. .DESCRIPTION Adds an AWS::Lambda::Function.VpcConfig resource property to the template. The VPC security groups and subnets that are attached to a Lambda function. When you connect a function to a VPC, Lambda creates an elastic network interface for each combination of security group and subnet in the function's VPC configuration. The function can only access resources and the internet through that VPC. For more information, see VPC Settings: https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html. **Note** When you delete a function, AWS CloudFormation monitors the state of its network interfaces and waits for Lambda to delete them before proceeding. If the VPC is defined in the same stack, the network interfaces need to be deleted by Lambda before AWS CloudFormation can delete the VPC's resources. To monitor network interfaces, AWS CloudFormation needs the ec2:DescribeNetworkInterfaces permission. It obtains this from the user or role that modifies the stack. If you don't provide this permission, AWS CloudFormation does not wait for network interfaces to be deleted. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html .PARAMETER SecurityGroupIds A list of VPC security groups IDs. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html#cfn-lambda-function-vpcconfig-securitygroupids UpdateType: Mutable Type: List PrimitiveItemType: String DuplicatesAllowed: True .PARAMETER SubnetIds A list of VPC subnet IDs. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-function-vpcconfig.html#cfn-lambda-function-vpcconfig-subnetids UpdateType: Mutable Type: List PrimitiveItemType: String DuplicatesAllowed: True .FUNCTIONALITY Vaporshell #> [OutputType([LambdaFunctionVpcConfig])] [cmdletbinding()] Param( [parameter(Mandatory = $false)] $SecurityGroupIds, [parameter(Mandatory = $false)] $SubnetIds ) Process { $obj = [LambdaFunctionVpcConfig]::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-VSLambdaFunctionVpcConfig' function Add-VSLambdaLayerVersionContent { <# .SYNOPSIS Adds an AWS::Lambda::LayerVersion.Content resource property to the template. A ZIP archive that contains the contents of an AWS Lambda layer: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html. .DESCRIPTION Adds an AWS::Lambda::LayerVersion.Content resource property to the template. A ZIP archive that contains the contents of an AWS Lambda layer: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-layerversion-content.html .PARAMETER S3ObjectVersion For versioned objects, the version of the layer archive object to use. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-layerversion-content.html#cfn-lambda-layerversion-content-s3objectversion PrimitiveType: String UpdateType: Immutable .PARAMETER S3Bucket The Amazon S3 bucket of the layer archive. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-layerversion-content.html#cfn-lambda-layerversion-content-s3bucket PrimitiveType: String UpdateType: Immutable .PARAMETER S3Key The Amazon S3 key of the layer archive. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-layerversion-content.html#cfn-lambda-layerversion-content-s3key PrimitiveType: String UpdateType: Immutable .FUNCTIONALITY Vaporshell #> [OutputType([LambdaLayerVersionContent])] [cmdletbinding()] Param( [parameter(Mandatory = $false)] [object] $S3ObjectVersion, [parameter(Mandatory = $true)] [object] $S3Bucket, [parameter(Mandatory = $true)] [object] $S3Key ) Process { $obj = [LambdaLayerVersionContent]::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-VSLambdaLayerVersionContent' function Add-VSLambdaVersionProvisionedConcurrencyConfiguration { <# .SYNOPSIS Adds an AWS::Lambda::Version.ProvisionedConcurrencyConfiguration resource property to the template. A provisioned concurrency configuration for a function's version. .DESCRIPTION Adds an AWS::Lambda::Version.ProvisionedConcurrencyConfiguration resource property to the template. A provisioned concurrency configuration for a function's version. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-version-provisionedconcurrencyconfiguration.html .PARAMETER ProvisionedConcurrentExecutions The amount of provisioned concurrency to allocate for the version. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-lambda-version-provisionedconcurrencyconfiguration.html#cfn-lambda-version-provisionedconcurrencyconfiguration-provisionedconcurrentexecutions PrimitiveType: Integer UpdateType: Mutable .FUNCTIONALITY Vaporshell #> [OutputType([LambdaVersionProvisionedConcurrencyConfiguration])] [cmdletbinding()] Param( [parameter(Mandatory = $true)] [object] $ProvisionedConcurrentExecutions ) Process { $obj = [LambdaVersionProvisionedConcurrencyConfiguration]::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-VSLambdaVersionProvisionedConcurrencyConfiguration' function New-VSLambdaAlias { <# .SYNOPSIS Adds an AWS::Lambda::Alias resource to the template. The AWS::Lambda::Alias resource creates an alias: https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html for a Lambda function version. Use aliases to provide clients with a function identifier that you can update to invoke a different version. .DESCRIPTION Adds an AWS::Lambda::Alias resource to the template. The AWS::Lambda::Alias resource creates an alias: https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html for a Lambda function version. Use aliases to provide clients with a function identifier that you can update to invoke a different version. You can also map an alias to split invocation requests between two versions. Use the RoutingConfig parameter to specify a second version and the percentage of invocation requests that it receives. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.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 Description A description of the alias. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-description PrimitiveType: String UpdateType: Mutable .PARAMETER FunctionName The name of the Lambda function. **Name formats** + **Function name** - MyFunction. + **Function ARN** - arn:aws:lambda:us-west-2:123456789012:function:MyFunction. + **Partial ARN** - 123456789012:function:MyFunction. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-functionname PrimitiveType: String UpdateType: Immutable .PARAMETER FunctionVersion The function version that the alias invokes. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-functionversion PrimitiveType: String UpdateType: Mutable .PARAMETER Name The name of the alias. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-name PrimitiveType: String UpdateType: Immutable .PARAMETER ProvisionedConcurrencyConfig Specifies a provisioned concurrency configuration for a function's alias. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-provisionedconcurrencyconfig Type: ProvisionedConcurrencyConfiguration UpdateType: Mutable .PARAMETER RoutingConfig The routing configuration: https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.html of the alias. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-alias.html#cfn-lambda-alias-routingconfig Type: AliasRoutingConfiguration 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([LambdaAlias])] [cmdletbinding()] Param( [parameter(Mandatory = $true,Position = 0)] [ValidateLogicalId()] [string] $LogicalId, [parameter(Mandatory = $false)] [object] $Description, [parameter(Mandatory = $true)] [object] $FunctionName, [parameter(Mandatory = $true)] [object] $FunctionVersion, [parameter(Mandatory = $true)] [object] $Name, [parameter(Mandatory = $false)] $ProvisionedConcurrencyConfig, [parameter(Mandatory = $false)] $RoutingConfig, [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 = [LambdaAlias]::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-VSLambdaAlias' function New-VSLambdaCodeSigningConfig { <# .SYNOPSIS Adds an AWS::Lambda::CodeSigningConfig resource to the template. .DESCRIPTION Adds an AWS::Lambda::CodeSigningConfig resource to the template. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-codesigningconfig.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 Description Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-codesigningconfig.html#cfn-lambda-codesigningconfig-description UpdateType: Mutable PrimitiveType: String .PARAMETER AllowedPublishers Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-codesigningconfig.html#cfn-lambda-codesigningconfig-allowedpublishers UpdateType: Mutable Type: AllowedPublishers .PARAMETER CodeSigningPolicies Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-codesigningconfig.html#cfn-lambda-codesigningconfig-codesigningpolicies UpdateType: Mutable Type: CodeSigningPolicies .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([LambdaCodeSigningConfig])] [cmdletbinding()] Param( [parameter(Mandatory = $true,Position = 0)] [ValidateLogicalId()] [string] $LogicalId, [parameter(Mandatory = $false)] [object] $Description, [parameter(Mandatory = $true)] $AllowedPublishers, [parameter(Mandatory = $false)] $CodeSigningPolicies, [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 = [LambdaCodeSigningConfig]::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-VSLambdaCodeSigningConfig' function New-VSLambdaEventInvokeConfig { <# .SYNOPSIS Adds an AWS::Lambda::EventInvokeConfig resource to the template. The AWS::Lambda::EventInvokeConfig resource configures options for asynchronous invocation: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html on a version or an alias. .DESCRIPTION Adds an AWS::Lambda::EventInvokeConfig resource to the template. The AWS::Lambda::EventInvokeConfig resource configures options for asynchronous invocation: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html on a version or an alias. By default, Lambda retries an asynchronous invocation twice if the function returns an error. It retains events in a queue for up to six hours. When an event fails all processing attempts or stays in the asynchronous invocation queue for too long, Lambda discards it. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventinvokeconfig.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 FunctionName The name of the Lambda function. *Minimum*: 1 *Maximum*: 64 *Pattern*: a-zA-Z0-9-_]+ Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventinvokeconfig.html#cfn-lambda-eventinvokeconfig-functionname PrimitiveType: String UpdateType: Immutable .PARAMETER MaximumRetryAttempts The maximum number of times to retry when the function returns an error. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventinvokeconfig.html#cfn-lambda-eventinvokeconfig-maximumretryattempts PrimitiveType: Integer UpdateType: Mutable .PARAMETER DestinationConfig A destination for events after they have been sent to a function for processing. **Destinations** + **Function** - The Amazon Resource Name ARN of a Lambda function. + **Queue** - The ARN of an SQS queue. + **Topic** - The ARN of an SNS topic. + **Event Bus** - The ARN of an Amazon EventBridge event bus. Type: DestinationConfig Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventinvokeconfig.html#cfn-lambda-eventinvokeconfig-destinationconfig UpdateType: Mutable .PARAMETER Qualifier The identifier of a version or alias. + **Version** - A version number. + **Alias** - An alias name. + **Latest** - To specify the unpublished version, use $LATEST. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventinvokeconfig.html#cfn-lambda-eventinvokeconfig-qualifier PrimitiveType: String UpdateType: Immutable .PARAMETER MaximumEventAgeInSeconds The maximum age of a request that Lambda sends to a function for processing. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventinvokeconfig.html#cfn-lambda-eventinvokeconfig-maximumeventageinseconds PrimitiveType: Integer 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([LambdaEventInvokeConfig])] [cmdletbinding()] Param( [parameter(Mandatory = $true,Position = 0)] [ValidateLogicalId()] [string] $LogicalId, [parameter(Mandatory = $true)] [object] $FunctionName, [parameter(Mandatory = $false)] [object] $MaximumRetryAttempts, [parameter(Mandatory = $false)] $DestinationConfig, [parameter(Mandatory = $true)] [object] $Qualifier, [parameter(Mandatory = $false)] [object] $MaximumEventAgeInSeconds, [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 = [LambdaEventInvokeConfig]::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-VSLambdaEventInvokeConfig' function New-VSLambdaEventSourceMapping { <# .SYNOPSIS Adds an AWS::Lambda::EventSourceMapping resource to the template. The AWS::Lambda::EventSourceMapping resource creates a mapping between an event source and an AWS Lambda function. Lambda reads items from the event source and triggers the function. .DESCRIPTION Adds an AWS::Lambda::EventSourceMapping resource to the template. The AWS::Lambda::EventSourceMapping resource creates a mapping between an event source and an AWS Lambda function. Lambda reads items from the event source and triggers the function. For details about each event source type, see the following topics. + Using AWS Lambda with Amazon Kinesis: https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html + Using AWS Lambda with Amazon SQS: https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html + Using AWS Lambda with Amazon DynamoDB: https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.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 BatchSize The maximum number of items to retrieve in a single batch. + **Amazon Kinesis** - Default 100. Max 10,000. + **Amazon DynamoDB Streams** - Default 100. Max 1,000. + **Amazon Simple Queue Service** - Default 10. Max 10. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-batchsize UpdateType: Mutable PrimitiveType: Integer .PARAMETER BisectBatchOnFunctionError Streams If the function returns an error, split the batch in two and retry. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-bisectbatchonfunctionerror UpdateType: Mutable PrimitiveType: Boolean .PARAMETER DestinationConfig Streams An Amazon SQS queue or Amazon SNS topic destination for discarded records. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-destinationconfig UpdateType: Mutable Type: DestinationConfig .PARAMETER Enabled Disables the event source mapping to pause polling and invocation. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-enabled UpdateType: Mutable PrimitiveType: Boolean .PARAMETER EventSourceArn The Amazon Resource Name ARN of the event source. + **Amazon Kinesis** - The ARN of the data stream or a stream consumer. + **Amazon DynamoDB Streams** - The ARN of the stream. + **Amazon Simple Queue Service** - The ARN of the queue. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-eventsourcearn UpdateType: Immutable PrimitiveType: String .PARAMETER FilterCriteria Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-filtercriteria UpdateType: Mutable PrimitiveType: Json .PARAMETER FunctionName The name of the Lambda function. **Name formats** + **Function name** - MyFunction. + **Function ARN** - arn:aws:lambda:us-west-2:123456789012:function:MyFunction. + **Version or Alias ARN** - arn:aws:lambda:us-west-2:123456789012:function:MyFunction:PROD. + **Partial ARN** - 123456789012:function:MyFunction. The length constraint applies only to the full ARN. If you specify only the function name, it's limited to 64 characters in length. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-functionname UpdateType: Mutable PrimitiveType: String .PARAMETER MaximumBatchingWindowInSeconds Streams The maximum amount of time to gather records before invoking the function, in seconds. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumbatchingwindowinseconds UpdateType: Mutable PrimitiveType: Integer .PARAMETER MaximumRecordAgeInSeconds Streams The maximum age of a record that Lambda sends to a function for processing. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumrecordageinseconds UpdateType: Mutable PrimitiveType: Integer .PARAMETER MaximumRetryAttempts Streams The maximum number of times to retry when the function returns an error. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-maximumretryattempts UpdateType: Mutable PrimitiveType: Integer .PARAMETER ParallelizationFactor Streams The number of batches to process from each shard concurrently. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-parallelizationfactor UpdateType: Mutable PrimitiveType: Integer .PARAMETER StartingPosition The position in a stream from which to start reading. Required for Amazon Kinesis and Amazon DynamoDB Streams sources. + **LATEST** - Read only new records. + **TRIM_HORIZON** - Process all available records. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingposition UpdateType: Immutable PrimitiveType: String .PARAMETER StartingPositionTimestamp Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-startingpositiontimestamp UpdateType: Mutable PrimitiveType: Double .PARAMETER Topics Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-topics UpdateType: Mutable Type: List PrimitiveItemType: String DuplicatesAllowed: False .PARAMETER Queues Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-queues UpdateType: Mutable Type: List PrimitiveItemType: String DuplicatesAllowed: False .PARAMETER SourceAccessConfigurations Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-sourceaccessconfigurations UpdateType: Mutable Type: List ItemType: SourceAccessConfiguration DuplicatesAllowed: False .PARAMETER TumblingWindowInSeconds Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-tumblingwindowinseconds UpdateType: Mutable PrimitiveType: Integer .PARAMETER FunctionResponseTypes Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-functionresponsetypes UpdateType: Mutable Type: List PrimitiveItemType: String DuplicatesAllowed: False .PARAMETER SelfManagedEventSource Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-eventsourcemapping.html#cfn-lambda-eventsourcemapping-selfmanagedeventsource UpdateType: Immutable Type: SelfManagedEventSource .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([LambdaEventSourceMapping])] [cmdletbinding()] Param( [parameter(Mandatory = $true,Position = 0)] [ValidateLogicalId()] [string] $LogicalId, [parameter(Mandatory = $false)] [object] $BatchSize, [parameter(Mandatory = $false)] [object] $BisectBatchOnFunctionError, [parameter(Mandatory = $false)] $DestinationConfig, [parameter(Mandatory = $false)] [object] $Enabled, [parameter(Mandatory = $false)] [object] $EventSourceArn, [parameter(Mandatory = $false)] [VSJson] $FilterCriteria, [parameter(Mandatory = $true)] [object] $FunctionName, [parameter(Mandatory = $false)] [object] $MaximumBatchingWindowInSeconds, [parameter(Mandatory = $false)] [object] $MaximumRecordAgeInSeconds, [parameter(Mandatory = $false)] [object] $MaximumRetryAttempts, [parameter(Mandatory = $false)] [object] $ParallelizationFactor, [parameter(Mandatory = $false)] [object] $StartingPosition, [parameter(Mandatory = $false)] [object] $StartingPositionTimestamp, [parameter(Mandatory = $false)] $Topics, [parameter(Mandatory = $false)] $Queues, [parameter(Mandatory = $false)] [object] $SourceAccessConfigurations, [parameter(Mandatory = $false)] [object] $TumblingWindowInSeconds, [parameter(Mandatory = $false)] $FunctionResponseTypes, [parameter(Mandatory = $false)] $SelfManagedEventSource, [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 = [LambdaEventSourceMapping]::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-VSLambdaEventSourceMapping' function New-VSLambdaFunction { <# .SYNOPSIS Adds an AWS::Lambda::Function resource to the template. The AWS::Lambda::Function resource creates a Lambda function. To create a function, you need a deployment package: https://docs.aws.amazon.com/lambda/latest/dg/deployment-package-v2.html and an execution role: https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role. The deployment package contains your function code. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X-Ray for request tracing. .DESCRIPTION Adds an AWS::Lambda::Function resource to the template. The AWS::Lambda::Function resource creates a Lambda function. To create a function, you need a deployment package: https://docs.aws.amazon.com/lambda/latest/dg/deployment-package-v2.html and an execution role: https://docs.aws.amazon.com/lambda/latest/dg/intro-permission-model.html#lambda-intro-execution-role. The deployment package contains your function code. The execution role grants the function permission to use AWS services, such as Amazon CloudWatch Logs for log streaming and AWS X-Ray for request tracing. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.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 Code The code for the function. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-code UpdateType: Mutable Type: Code .PARAMETER DeadLetterConfig A dead letter queue configuration that specifies the queue or topic where Lambda sends asynchronous events when they fail processing. For more information, see Dead Letter Queues: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-deadletterconfig UpdateType: Mutable Type: DeadLetterConfig .PARAMETER Description A description of the function. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-description UpdateType: Mutable PrimitiveType: String .PARAMETER Environment Environment variables that are accessible from function code during execution. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-environment UpdateType: Mutable Type: Environment .PARAMETER FileSystemConfigs Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-filesystemconfigs UpdateType: Mutable Type: List ItemType: FileSystemConfig .PARAMETER FunctionName The name of the Lambda function, up to 64 characters in length. If you don't specify a name, AWS CloudFormation generates one. If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-functionname UpdateType: Immutable PrimitiveType: String .PARAMETER Handler The name of the method within your code that Lambda calls to execute your function. The format includes the file name. It can also include namespaces and other qualifiers, depending on the runtime. For more information, see Programming Model: https://docs.aws.amazon.com/lambda/latest/dg/programming-model-v2.html. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-handler UpdateType: Mutable PrimitiveType: String .PARAMETER Architectures Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-architectures UpdateType: Mutable Type: List PrimitiveItemType: String DuplicatesAllowed: False .PARAMETER KmsKeyArn The ARN of the AWS Key Management Service AWS KMS key that's used to encrypt your function's environment variables. If it's not provided, AWS Lambda uses a default service key. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-kmskeyarn UpdateType: Mutable PrimitiveType: String .PARAMETER Layers A list of function layers: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html to add to the function's execution environment. Specify each layer by its ARN, including the version. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-layers UpdateType: Mutable Type: List PrimitiveItemType: String DuplicatesAllowed: True .PARAMETER MemorySize The amount of memory that your function has access to. Increasing the function's memory also increases its CPU allocation. The default value is 128 MB. The value must be a multiple of 64 MB. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-memorysize UpdateType: Mutable PrimitiveType: Integer .PARAMETER ReservedConcurrentExecutions The number of simultaneous executions to reserve for the function. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-reservedconcurrentexecutions UpdateType: Mutable PrimitiveType: Integer .PARAMETER Role The Amazon Resource Name ARN of the function's execution role. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-role UpdateType: Mutable PrimitiveType: String .PARAMETER Runtime The identifier of the function's runtime: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-runtime UpdateType: Mutable PrimitiveType: String .PARAMETER Tags A list of tags: https://docs.aws.amazon.com/lambda/latest/dg/tagging.html to apply to the function. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-tags UpdateType: Mutable Type: List ItemType: Tag DuplicatesAllowed: False .PARAMETER Timeout The amount of time that Lambda allows a function to run before stopping it. The default is 3 seconds. The maximum allowed value is 900 seconds. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-timeout UpdateType: Mutable PrimitiveType: Integer .PARAMETER TracingConfig Set Mode to Active to sample and trace a subset of incoming requests with AWS X-Ray. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-tracingconfig UpdateType: Mutable Type: TracingConfig .PARAMETER VpcConfig For network connectivity to AWS resources in a VPC, specify a list of security groups and subnets in the VPC. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-vpcconfig UpdateType: Mutable Type: VpcConfig .PARAMETER CodeSigningConfigArn Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-codesigningconfigarn UpdateType: Mutable PrimitiveType: String .PARAMETER ImageConfig Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-imageconfig UpdateType: Mutable Type: ImageConfig .PARAMETER PackageType Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-function.html#cfn-lambda-function-packagetype UpdateType: Mutable PrimitiveType: String .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([LambdaFunction])] [cmdletbinding()] Param( [parameter(Mandatory = $true,Position = 0)] [ValidateLogicalId()] [string] $LogicalId, [parameter(Mandatory = $true)] $Code, [parameter(Mandatory = $false)] $DeadLetterConfig, [parameter(Mandatory = $false)] [object] $Description, [parameter(Mandatory = $false)] $Environment, [parameter(Mandatory = $false)] [object] $FileSystemConfigs, [parameter(Mandatory = $false)] [object] $FunctionName, [parameter(Mandatory = $false)] [object] $Handler, [parameter(Mandatory = $false)] $Architectures, [parameter(Mandatory = $false)] [object] $KmsKeyArn, [parameter(Mandatory = $false)] $Layers, [parameter(Mandatory = $false)] [object] $MemorySize, [parameter(Mandatory = $false)] [object] $ReservedConcurrentExecutions, [parameter(Mandatory = $true)] [object] $Role, [parameter(Mandatory = $false)] [object] $Runtime, [TransformTag()] [object] [parameter(Mandatory = $false)] $Tags, [parameter(Mandatory = $false)] [object] $Timeout, [parameter(Mandatory = $false)] $TracingConfig, [parameter(Mandatory = $false)] $VpcConfig, [parameter(Mandatory = $false)] [object] $CodeSigningConfigArn, [parameter(Mandatory = $false)] $ImageConfig, [parameter(Mandatory = $false)] [object] $PackageType, [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 = [LambdaFunction]::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-VSLambdaFunction' function New-VSLambdaLayerVersion { <# .SYNOPSIS Adds an AWS::Lambda::LayerVersion resource to the template. The AWS::Lambda::LayerVersion resource creates an AWS Lambda layer: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html from a ZIP archive. .DESCRIPTION Adds an AWS::Lambda::LayerVersion resource to the template. The AWS::Lambda::LayerVersion resource creates an AWS Lambda layer: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html from a ZIP archive. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.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 CompatibleRuntimes A list of compatible function runtimes: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html. Used for filtering with ListLayers: https://docs.aws.amazon.com/lambda/latest/dg/API_ListLayers.html and ListLayerVersions: https://docs.aws.amazon.com/lambda/latest/dg/API_ListLayerVersions.html. PrimitiveItemType: String Type: List Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-compatibleruntimes UpdateType: Immutable .PARAMETER LicenseInfo The layer's software license. It can be any of the following: + An SPDX license identifier: https://spdx.org/licenses/. For example, MIT. + The URL of a license hosted on the internet. For example, https://opensource.org/licenses/MIT. + The full text of the license. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-licenseinfo PrimitiveType: String UpdateType: Immutable .PARAMETER Description The description of the version. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-description PrimitiveType: String UpdateType: Immutable .PARAMETER LayerName The name or Amazon Resource Name ARN of the layer. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-layername PrimitiveType: String UpdateType: Immutable .PARAMETER Content The function layer archive. Type: Content Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-content UpdateType: Immutable .PARAMETER CompatibleArchitectures PrimitiveItemType: String Type: List Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversion.html#cfn-lambda-layerversion-compatiblearchitectures 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([LambdaLayerVersion])] [cmdletbinding()] Param( [parameter(Mandatory = $true,Position = 0)] [ValidateLogicalId()] [string] $LogicalId, [parameter(Mandatory = $false)] $CompatibleRuntimes, [parameter(Mandatory = $false)] [object] $LicenseInfo, [parameter(Mandatory = $false)] [object] $Description, [parameter(Mandatory = $false)] [object] $LayerName, [parameter(Mandatory = $true)] $Content, [parameter(Mandatory = $false)] $CompatibleArchitectures, [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 = [LambdaLayerVersion]::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-VSLambdaLayerVersion' function New-VSLambdaLayerVersionPermission { <# .SYNOPSIS Adds an AWS::Lambda::LayerVersionPermission resource to the template. The AWS::Lambda::LayerVersionPermission resource adds permissions to the resource-based policy of a version of an AWS Lambda layer: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html. Use this action to grant layer usage permission to other accounts. You can grant permission to a single account, all AWS accounts, or all accounts in an organization. .DESCRIPTION Adds an AWS::Lambda::LayerVersionPermission resource to the template. The AWS::Lambda::LayerVersionPermission resource adds permissions to the resource-based policy of a version of an AWS Lambda layer: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html. Use this action to grant layer usage permission to other accounts. You can grant permission to a single account, all AWS accounts, or all accounts in an organization. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversionpermission.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 Action The API action that grants access to the layer. For example, lambda:GetLayerVersion. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversionpermission.html#cfn-lambda-layerversionpermission-action PrimitiveType: String UpdateType: Immutable .PARAMETER LayerVersionArn The Amazon Resource Name ARN of the layer. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversionpermission.html#cfn-lambda-layerversionpermission-layerversionarn PrimitiveType: String UpdateType: Immutable .PARAMETER OrganizationId With the principal set to *, grant permission to all accounts in the specified organization. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversionpermission.html#cfn-lambda-layerversionpermission-organizationid PrimitiveType: String UpdateType: Immutable .PARAMETER Principal An account ID, or * to grant permission to all AWS accounts. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-layerversionpermission.html#cfn-lambda-layerversionpermission-principal 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([LambdaLayerVersionPermission])] [cmdletbinding()] Param( [parameter(Mandatory = $true,Position = 0)] [ValidateLogicalId()] [string] $LogicalId, [parameter(Mandatory = $true)] [object] $Action, [parameter(Mandatory = $true)] [object] $LayerVersionArn, [parameter(Mandatory = $false)] [object] $OrganizationId, [parameter(Mandatory = $true)] [object] $Principal, [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 = [LambdaLayerVersionPermission]::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-VSLambdaLayerVersionPermission' function New-VSLambdaPermission { <# .SYNOPSIS Adds an AWS::Lambda::Permission resource to the template. The AWS::Lambda::Permission resource grants an AWS service or another account permission to use a function. You can apply the policy at the function level, or specify a qualifier to restrict access to a single version or alias. If you use a qualifier, the invoker must use the full Amazon Resource Name (ARN of that version or alias to invoke the function. .DESCRIPTION Adds an AWS::Lambda::Permission resource to the template. The AWS::Lambda::Permission resource grants an AWS service or another account permission to use a function. You can apply the policy at the function level, or specify a qualifier to restrict access to a single version or alias. If you use a qualifier, the invoker must use the full Amazon Resource Name (ARN of that version or alias to invoke the function. To grant permission to another account, specify the account ID as the Principal. For AWS services, the principal is a domain-style identifier defined by the service, like s3.amazonaws.com or sns.amazonaws.com. For AWS services, you can also specify the ARN of the associated resource as the SourceArn. If you grant permission to a service principal without specifying the source, other accounts could potentially configure resources in their account to invoke your Lambda function. This resource adds a statement to a resource-based permission policy for the function. For more information about function policies, see Lambda Function Policies: https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.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 Action The action that the principal can use on the function. For example, lambda:InvokeFunction or lambda:GetFunction. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-action PrimitiveType: String UpdateType: Immutable .PARAMETER EventSourceToken For Alexa Smart Home functions, a token that must be supplied by the invoker. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-eventsourcetoken PrimitiveType: String UpdateType: Immutable .PARAMETER FunctionName The name of the Lambda function, version, or alias. **Name formats** + **Function name** - my-function name-only, my-function:v1 with alias. + **Function ARN** - arn:aws:lambda:us-west-2:123456789012:function:my-function. + **Partial ARN** - 123456789012:function:my-function. You can append a version number or alias to any of the formats. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-functionname PrimitiveType: String UpdateType: Immutable .PARAMETER Principal The AWS service or account that invokes the function. If you specify a service, use SourceArn or SourceAccount to limit who can invoke the function through that service. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-principal PrimitiveType: String UpdateType: Immutable .PARAMETER SourceAccount For Amazon S3, the ID of the account that owns the resource. Use this together with SourceArn to ensure that the resource is owned by the specified account. It is possible for an Amazon S3 bucket to be deleted by its owner and recreated by another account. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-sourceaccount PrimitiveType: String UpdateType: Immutable .PARAMETER SourceArn For AWS services, the ARN of the AWS resource that invokes the function. For example, an Amazon S3 bucket or Amazon SNS topic. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html#cfn-lambda-permission-sourcearn 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([LambdaPermission])] [cmdletbinding()] Param( [parameter(Mandatory = $true,Position = 0)] [ValidateLogicalId()] [string] $LogicalId, [parameter(Mandatory = $true)] [object] $Action, [parameter(Mandatory = $false)] [object] $EventSourceToken, [parameter(Mandatory = $true)] [object] $FunctionName, [parameter(Mandatory = $true)] [object] $Principal, [parameter(Mandatory = $false)] [object] $SourceAccount, [parameter(Mandatory = $false)] [object] $SourceArn, [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 = [LambdaPermission]::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-VSLambdaPermission' function New-VSLambdaVersion { <# .SYNOPSIS Adds an AWS::Lambda::Version resource to the template. The AWS::Lambda::Version resource creates a version: https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html from the current code and configuration of a function. Use versions to create a snapshot of your function code and configuration that doesn't change. .DESCRIPTION Adds an AWS::Lambda::Version resource to the template. The AWS::Lambda::Version resource creates a version: https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html from the current code and configuration of a function. Use versions to create a snapshot of your function code and configuration that doesn't change. .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.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 CodeSha256 Only publish a version if the hash value matches the value that's specified. Use this option to avoid publishing a version if the function code has changed since you last updated it. Updates are not supported for this property. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html#cfn-lambda-version-codesha256 PrimitiveType: String UpdateType: Mutable .PARAMETER Description A description for the version to override the description in the function configuration. Updates are not supported for this property. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html#cfn-lambda-version-description PrimitiveType: String UpdateType: Mutable .PARAMETER FunctionName The name of the Lambda function. **Name formats** + **Function name** - MyFunction. + **Function ARN** - arn:aws:lambda:us-west-2:123456789012:function:MyFunction. + **Partial ARN** - 123456789012:function:MyFunction. The length constraint applies only to the full ARN. If you specify only the function name, it is limited to 64 characters in length. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html#cfn-lambda-version-functionname PrimitiveType: String UpdateType: Immutable .PARAMETER ProvisionedConcurrencyConfig Specifies a provisioned concurrency configuration for a function's version. Updates are not supported for this property. Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-version.html#cfn-lambda-version-provisionedconcurrencyconfig Type: ProvisionedConcurrencyConfiguration 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([LambdaVersion])] [cmdletbinding()] Param( [parameter(Mandatory = $true,Position = 0)] [ValidateLogicalId()] [string] $LogicalId, [parameter(Mandatory = $false)] [object] $CodeSha256, [parameter(Mandatory = $false)] [object] $Description, [parameter(Mandatory = $true)] [object] $FunctionName, [parameter(Mandatory = $false)] $ProvisionedConcurrencyConfig, [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 = [LambdaVersion]::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-VSLambdaVersion' |