Public/Resource Property Types/Add-VSS3BucketCorsRule.ps1
function Add-VSS3BucketCorsRule { <# .SYNOPSIS Adds an AWS::S3::Bucket.CorsRule resource property to the template .DESCRIPTION Adds an AWS::S3::Bucket.CorsRule resource property to the template .LINK http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html .PARAMETER AllowedHeaders Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-allowedheaders DuplicatesAllowed: False PrimitiveItemType: String Required: False Type: List UpdateType: Mutable .PARAMETER AllowedMethods Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-allowedmethods DuplicatesAllowed: False PrimitiveItemType: String Required: True Type: List UpdateType: Mutable .PARAMETER AllowedOrigins Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-allowedorigins DuplicatesAllowed: False PrimitiveItemType: String Required: True Type: List UpdateType: Mutable .PARAMETER ExposedHeaders Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-exposedheaders DuplicatesAllowed: False PrimitiveItemType: String Required: False Type: List UpdateType: Mutable .PARAMETER Id Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-id PrimitiveType: String Required: False UpdateType: Mutable .PARAMETER MaxAge Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-cors-corsrule.html#cfn-s3-bucket-cors-corsrule-maxage PrimitiveType: Integer Required: False UpdateType: Mutable .FUNCTIONALITY Vaporshell #> [OutputType('Vaporshell.Resource.S3.Bucket.CorsRule')] [cmdletbinding()] Param ( [parameter(Mandatory = $false)] $AllowedHeaders, [parameter(Mandatory = $true)] $AllowedMethods, [parameter(Mandatory = $true)] $AllowedOrigins, [parameter(Mandatory = $false)] $ExposedHeaders, [parameter(Mandatory = $false)] [ValidateScript( { $allowedTypes = "System.String","Vaporshell.Function" if ([string]$($_.PSTypeNames) -match "($(($allowedTypes|ForEach-Object{[RegEx]::Escape($_)}) -join '|'))") { $true } else { $PSCmdlet.ThrowTerminatingError((New-VSError -String "This parameter only accepts the following types: $($allowedTypes -join ", "). The current types of the value are: $($_.PSTypeNames -join ", ").")) } })] $Id, [parameter(Mandatory = $false)] [Int] $MaxAge ) Begin { $obj = [PSCustomObject]@{} } Process { foreach ($key in $PSBoundParameters.Keys) { $obj | Add-Member -MemberType NoteProperty -Name $key -Value $PSBoundParameters.$key } } End { $obj | Add-ObjectDetail -TypeName 'Vaporshell.Resource.S3.Bucket.CorsRule' } } |