Public/Resource Property Types/Add-VSDynamoDBTableGlobalSecondaryIndex.ps1
function Add-VSDynamoDBTableGlobalSecondaryIndex { <# .SYNOPSIS Adds an AWS::DynamoDB::Table.GlobalSecondaryIndex resource property to the template .DESCRIPTION Adds an AWS::DynamoDB::Table.GlobalSecondaryIndex resource property to the template .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-gsi.html .PARAMETER IndexName Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-gsi.html#cfn-dynamodb-gsi-indexname PrimitiveType: String Required: True UpdateType: Mutable .PARAMETER KeySchema Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-gsi.html#cfn-dynamodb-gsi-keyschema DuplicatesAllowed: True ItemType: KeySchema Required: True Type: List UpdateType: Mutable .PARAMETER Projection Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-gsi.html#cfn-dynamodb-gsi-projection Required: True Type: Projection UpdateType: Mutable .PARAMETER ProvisionedThroughput Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-gsi.html#cfn-dynamodb-gsi-provisionedthroughput Required: True Type: ProvisionedThroughput UpdateType: Mutable .FUNCTIONALITY Vaporshell #> [OutputType('Vaporshell.Resource.DynamoDB.Table.GlobalSecondaryIndex')] [cmdletbinding()] Param ( [parameter(Mandatory = $true)] [ValidateScript( { $allowedTypes = "System.String","Vaporshell.Function" if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") { $true } else { throw "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")." } })] $IndexName, [parameter(Mandatory = $true)] [ValidateScript( { $allowedTypes = "Vaporshell.Resource.DynamoDB.Table.KeySchema" if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") { $true } else { throw "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ")." } })] $KeySchema, [parameter(Mandatory = $true)] $Projection, [parameter(Mandatory = $true)] $ProvisionedThroughput ) Begin { $obj = [PSCustomObject]@{} } Process { foreach ($key in $PSBoundParameters.Keys) { $val = $((Get-Variable $key).Value) if ($val -eq "True") { $val = "true" } elseif ($val -eq "False") { $val = "false" } $obj | Add-Member -MemberType NoteProperty -Name $key -Value $val } } End { $obj | Add-ObjectDetail -TypeName 'Vaporshell.Resource.DynamoDB.Table.GlobalSecondaryIndex' } } |