Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Commit

Permalink
fixes #74 and brings functions up to date
Browse files Browse the repository at this point in the history
  • Loading branch information
scrthq committed May 3, 2020
1 parent 3e20e98 commit 525ef38
Show file tree
Hide file tree
Showing 618 changed files with 21,346 additions and 67 deletions.
27 changes: 17 additions & 10 deletions VaporShell/Public/Primary Functions/New-VaporResource.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ function New-VaporResource {
<#
.SYNOPSIS
Adds a Resource object to the template
.DESCRIPTION
The required Resources section declares the AWS resources that you want to include in the stack, such as an Amazon EC2 instance or an Amazon S3 bucket. You must declare each resource separately; however, if you have multiple resources of the same type, you can declare them together by separating them with commas.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.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.
In addition to the logical ID, certain resources also have a physical ID, which is the actual assigned name for that resource, such as an EC2 instance ID or an S3 bucket name. Use the physical IDs to identify resources outside of AWS CloudFormation templates, but only after the resources have been created. For example, you might give an EC2 instance resource a logical ID of MyEC2Instance; but when AWS CloudFormation creates the instance, AWS CloudFormation automatically generates and assigns a physical ID (such as i-28f9ba55) to the instance. You can use this physical ID to identify the instance and view its properties (such as the DNS name) by using the Amazon EC2 console. For resources that support custom names, you can assign your own names (physical IDs) to help you quickly identify resources. For example, you can name an S3 bucket that stores logs as MyPerformanceLogs.
.PARAMETER Type
The resource type identifies the type of resource that you are declaring. For example, AWS::EC2::Instance declares an EC2 instance. For a list of all of the resource types, see AWS Resource Types Reference.
.PARAMETER Properties
This is a collection of Resource properties are additional options that you can specify for a resource. For example, for each EC2 instance, you must specify an Amazon Machine Image (AMI) ID for that instance.
Expand Down Expand Up @@ -48,7 +48,7 @@ function New-VaporResource {
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 here.
.PARAMETER Condition
Logical ID of the condition that this resource needs to be true in order for this resource to be provisioned.
Expand All @@ -62,7 +62,7 @@ function New-VaporResource {
}
))
When the template is exported, this will convert to:
When the template is exported, this will convert to:
```json
{
"AWSTemplateFormatVersion": "2010-09-09",
Expand All @@ -77,7 +77,7 @@ function New-VaporResource {
"",
[
"Queue=",
{
{
"Ref": "MyQueue"
}
]
Expand All @@ -86,8 +86,8 @@ function New-VaporResource {
},
"AvailabilityZone": "us-east-1a",
"ImageId": "ami-20b65349"
}
}
}
}
}
}
```
Expand Down Expand Up @@ -139,6 +139,10 @@ function New-VaporResource {
[ValidateSet("Delete","Retain","Snapshot")]
[System.String]
$DeletionPolicy,
[parameter(Mandatory = $false)]
[ValidateSet("Delete","Retain","Snapshot")]
[System.String]
$UpdateReplacePolicy,
[parameter(Mandatory = $false,Position = 5)]
[System.String[]]
$DependsOn,
Expand Down Expand Up @@ -185,6 +189,9 @@ function New-VaporResource {
if ($DeletionPolicy) {
$obj.Props | Add-Member -MemberType NoteProperty -Name "DeletionPolicy" -Value $DeletionPolicy
}
if ($UpdateReplacePolicy) {
$obj.Props | Add-Member -MemberType NoteProperty -Name "UpdateReplacePolicy" -Value $UpdateReplacePolicy
}
if ($DependsOn) {
$obj.Props | Add-Member -MemberType NoteProperty -Name "DependsOn" -Value $DependsOn
}
Expand All @@ -197,4 +204,4 @@ function New-VaporResource {
$obj | Add-Member -MemberType ScriptMethod -Name ToString -Value {$this.LogicalId} -Force
$obj | Add-ObjectDetail -TypeName 'Vaporshell.Resource'
Write-Verbose "Resulting JSON from $($MyInvocation.MyCommand): `n`n$(@{$obj.LogicalId = $obj.Props} | ConvertTo-Json -Depth 5)`n"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
function Add-VSApiGatewayV2IntegrationTlsConfig {
<#
.SYNOPSIS
Adds an AWS::ApiGatewayV2::Integration.TlsConfig resource property to the template.
.DESCRIPTION
Adds an AWS::ApiGatewayV2::Integration.TlsConfig resource property to the template.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-integration-tlsconfig.html
.PARAMETER ServerNameToVerify
Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-integration-tlsconfig.html#cfn-apigatewayv2-integration-tlsconfig-servernametoverify
PrimitiveType: String
UpdateType: Mutable
.FUNCTIONALITY
Vaporshell
#>
[OutputType('Vaporshell.Resource.ApiGatewayV2.Integration.TlsConfig')]
[cmdletbinding()]
Param
(
[parameter(Mandatory = $false)]
[ValidateScript( {
$allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
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 ", ")."))
}
})]
$ServerNameToVerify
)
Begin {
$obj = [PSCustomObject]@{}
$commonParams = @('Verbose','Debug','ErrorAction','WarningAction','InformationAction','ErrorVariable','WarningVariable','InformationVariable','OutVariable','OutBuffer','PipelineVariable')
}
Process {
foreach ($key in $PSBoundParameters.Keys | Where-Object {$commonParams -notcontains $_}) {
switch ($key) {
Default {
$obj | Add-Member -MemberType NoteProperty -Name $key -Value $PSBoundParameters.$key
}
}
}
}
End {
$obj | Add-ObjectDetail -TypeName 'Vaporshell.Resource.ApiGatewayV2.Integration.TlsConfig'
Write-Verbose "Resulting JSON from $($MyInvocation.MyCommand): `n`n$($obj | ConvertTo-Json -Depth 5)`n"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
function Add-VSAthenaWorkGroupEncryptionConfiguration {
<#
.SYNOPSIS
Adds an AWS::Athena::WorkGroup.EncryptionConfiguration resource property to the template.
.DESCRIPTION
Adds an AWS::Athena::WorkGroup.EncryptionConfiguration resource property to the template.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-encryptionconfiguration.html
.PARAMETER EncryptionOption
Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-encryptionconfiguration.html#cfn-athena-workgroup-encryptionconfiguration-encryptionoption
UpdateType: Mutable
PrimitiveType: String
.PARAMETER KmsKey
Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-encryptionconfiguration.html#cfn-athena-workgroup-encryptionconfiguration-kmskey
UpdateType: Mutable
PrimitiveType: String
.FUNCTIONALITY
Vaporshell
#>
[OutputType('Vaporshell.Resource.Athena.WorkGroup.EncryptionConfiguration')]
[cmdletbinding()]
Param
(
[parameter(Mandatory = $true)]
[ValidateScript( {
$allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
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 ", ")."))
}
})]
$EncryptionOption,
[parameter(Mandatory = $false)]
[ValidateScript( {
$allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
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 ", ")."))
}
})]
$KmsKey
)
Begin {
$obj = [PSCustomObject]@{}
$commonParams = @('Verbose','Debug','ErrorAction','WarningAction','InformationAction','ErrorVariable','WarningVariable','InformationVariable','OutVariable','OutBuffer','PipelineVariable')
}
Process {
foreach ($key in $PSBoundParameters.Keys | Where-Object {$commonParams -notcontains $_}) {
switch ($key) {
Default {
$obj | Add-Member -MemberType NoteProperty -Name $key -Value $PSBoundParameters.$key
}
}
}
}
End {
$obj | Add-ObjectDetail -TypeName 'Vaporshell.Resource.Athena.WorkGroup.EncryptionConfiguration'
Write-Verbose "Resulting JSON from $($MyInvocation.MyCommand): `n`n$($obj | ConvertTo-Json -Depth 5)`n"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
function Add-VSAthenaWorkGroupResultConfiguration {
<#
.SYNOPSIS
Adds an AWS::Athena::WorkGroup.ResultConfiguration resource property to the template.
.DESCRIPTION
Adds an AWS::Athena::WorkGroup.ResultConfiguration resource property to the template.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-resultconfiguration.html
.PARAMETER EncryptionConfiguration
Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-resultconfiguration.html#cfn-athena-workgroup-resultconfiguration-encryptionconfiguration
UpdateType: Mutable
Type: EncryptionConfiguration
.PARAMETER OutputLocation
Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-resultconfiguration.html#cfn-athena-workgroup-resultconfiguration-outputlocation
UpdateType: Mutable
PrimitiveType: String
.FUNCTIONALITY
Vaporshell
#>
[OutputType('Vaporshell.Resource.Athena.WorkGroup.ResultConfiguration')]
[cmdletbinding()]
Param
(
[parameter(Mandatory = $false)]
$EncryptionConfiguration,
[parameter(Mandatory = $false)]
[ValidateScript( {
$allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
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 ", ")."))
}
})]
$OutputLocation
)
Begin {
$obj = [PSCustomObject]@{}
$commonParams = @('Verbose','Debug','ErrorAction','WarningAction','InformationAction','ErrorVariable','WarningVariable','InformationVariable','OutVariable','OutBuffer','PipelineVariable')
}
Process {
foreach ($key in $PSBoundParameters.Keys | Where-Object {$commonParams -notcontains $_}) {
switch ($key) {
Default {
$obj | Add-Member -MemberType NoteProperty -Name $key -Value $PSBoundParameters.$key
}
}
}
}
End {
$obj | Add-ObjectDetail -TypeName 'Vaporshell.Resource.Athena.WorkGroup.ResultConfiguration'
Write-Verbose "Resulting JSON from $($MyInvocation.MyCommand): `n`n$($obj | ConvertTo-Json -Depth 5)`n"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
function Add-VSAthenaWorkGroupResultConfigurationUpdates {
<#
.SYNOPSIS
Adds an AWS::Athena::WorkGroup.ResultConfigurationUpdates resource property to the template.
.DESCRIPTION
Adds an AWS::Athena::WorkGroup.ResultConfigurationUpdates resource property to the template.
.LINK
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-resultconfigurationupdates.html
.PARAMETER EncryptionConfiguration
Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-resultconfigurationupdates.html#cfn-athena-workgroup-resultconfigurationupdates-encryptionconfiguration
UpdateType: Mutable
Type: EncryptionConfiguration
.PARAMETER OutputLocation
Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-resultconfigurationupdates.html#cfn-athena-workgroup-resultconfigurationupdates-outputlocation
UpdateType: Mutable
PrimitiveType: String
.PARAMETER RemoveEncryptionConfiguration
Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-resultconfigurationupdates.html#cfn-athena-workgroup-resultconfigurationupdates-removeencryptionconfiguration
UpdateType: Mutable
PrimitiveType: Boolean
.PARAMETER RemoveOutputLocation
Documentation: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-athena-workgroup-resultconfigurationupdates.html#cfn-athena-workgroup-resultconfigurationupdates-removeoutputlocation
UpdateType: Mutable
PrimitiveType: Boolean
.FUNCTIONALITY
Vaporshell
#>
[OutputType('Vaporshell.Resource.Athena.WorkGroup.ResultConfigurationUpdates')]
[cmdletbinding()]
Param
(
[parameter(Mandatory = $false)]
$EncryptionConfiguration,
[parameter(Mandatory = $false)]
[ValidateScript( {
$allowedTypes = "System.String","Vaporshell.Function","Vaporshell.Condition"
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 ", ")."))
}
})]
$OutputLocation,
[parameter(Mandatory = $false)]
[ValidateScript( {
$allowedTypes = "System.Boolean","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 ", ")."))
}
})]
$RemoveEncryptionConfiguration,
[parameter(Mandatory = $false)]
[ValidateScript( {
$allowedTypes = "System.Boolean","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 ", ")."))
}
})]
$RemoveOutputLocation
)
Begin {
$obj = [PSCustomObject]@{}
$commonParams = @('Verbose','Debug','ErrorAction','WarningAction','InformationAction','ErrorVariable','WarningVariable','InformationVariable','OutVariable','OutBuffer','PipelineVariable')
}
Process {
foreach ($key in $PSBoundParameters.Keys | Where-Object {$commonParams -notcontains $_}) {
switch ($key) {
Default {
$obj | Add-Member -MemberType NoteProperty -Name $key -Value $PSBoundParameters.$key
}
}
}
}
End {
$obj | Add-ObjectDetail -TypeName 'Vaporshell.Resource.Athena.WorkGroup.ResultConfigurationUpdates'
Write-Verbose "Resulting JSON from $($MyInvocation.MyCommand): `n`n$($obj | ConvertTo-Json -Depth 5)`n"
}
}
Loading

0 comments on commit 525ef38

Please sign in to comment.