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

UpdateReplacePolicy is incorrectly nested #74

Closed
indented-automation opened this issue Apr 9, 2020 · 1 comment
Closed

UpdateReplacePolicy is incorrectly nested #74

indented-automation opened this issue Apr 9, 2020 · 1 comment
Assignees
Labels

Comments

@indented-automation
Copy link
Collaborator

indented-automation commented Apr 9, 2020

Description

The UpdateReplacePolicy parameter should allow me to set the policy to Retain, Delete, or Snapshot. The resulting template file should pass CFN-Lint tests.

The UpdateReplacePolicy is incorrectly nested under Parameters which is not consistent with the AWS documentation:

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatereplacepolicy.html

Steps to reproduce

$Template = Initialize-Vaporshell
$params = @{
    LogicalID           = 'TransitGateway'
    DeletionPolicy      = 'Retain'
    UpdateReplacePolicy = 'Retain'
}
$Template.AddResource((
    New-VSEC2TransitGateway @params
))
$template.resources.TransitGateway

Expected output

Type                     Properties    DeletionPolicy    UpdateReplacePolicy 
----                     ----------    --------------    -------------------
AWS::EC2::TransitGateway @{}           Retain            Retain

Actual output

Type                     Properties                    DeletionPolicy
----                     ----------                    --------------
AWS::EC2::TransitGateway @{UpdateReplacePolicy=Retain} Retain
@scrthq scrthq added the bug label Apr 9, 2020
@scrthq scrthq self-assigned this Apr 9, 2020
@scrthq
Copy link
Member

scrthq commented Apr 9, 2020

Thanks, @indented-automation !! Checking this out :-)

@scrthq scrthq mentioned this issue May 3, 2020
Merged
@scrthq scrthq closed this as completed in 525ef38 May 3, 2020
scrthq added a commit that referenced this issue May 3, 2020
## 2.12.0 - 2020-05-03

* [Issue #74](#74)
    * Fixed: `UpdateReplacePolicy` was incorrectly nested under the Resource Properties, not top-level next to `DeletionPolicy`.
* [Issue #75](#75)
    * Added: Support for `ResourcesToImport` declaration on changes sets with `New-VSChangeSet`
    * Added: New helper function `Add-VSChangeSetResourceToImport` to create the `ResourceToImport` object needed as the value of the `ResourcesToImport` parameter on `New-VSChangeSet`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants