AWS code-library documentation change
Summary
Added PowerShell V5 examples for Update-CFNStack cmdlet with various parameter configurations including IAM capabilities
Security assessment
Example 5 explicitly documents required CAPABILITY_IAM parameter for stacks with IAM resources, which is a security-related best practice but does not indicate a security vulnerability being fixed
Diff
diff --git a/code-library/latest/ug/cloudformation_example_cloudformation_UpdateStack_section.md b/code-library/latest/ug/cloudformation_example_cloudformation_UpdateStack_section.md index 1869ad129..447f5d56a 100644 --- a//code-library/latest/ug/cloudformation_example_cloudformation_UpdateStack_section.md +++ b//code-library/latest/ug/cloudformation_example_cloudformation_UpdateStack_section.md @@ -93,0 +94,47 @@ PowerShell +**Tools for PowerShell V5** + + +**Example 1: Updates the stack 'myStack' with the specified template and customization parameters. 'PK1' represents the name of a parameter declared in the template and 'PV1' represents its value. The customization parameters can also be specified using 'Key' and 'Value' instead of 'ParameterKey' and 'ParameterValue'.** + + + Update-CFNStack -StackName "myStack" ` + -TemplateBody "{Template Content Here}" ` + -Parameter @{ ParameterKey="PK1"; ParameterValue="PV1" } + + +**Example 2: Updates the stack 'myStack' with the specified template and customization parameters. 'PK1' and 'PK2' represent the names of parameters declared in the template, 'PV1' and 'PV2' represents their requested values. The customization parameters can also be specified using 'Key' and 'Value' instead of 'ParameterKey' and 'ParameterValue'.** + + + Update-CFNStack -StackName "myStack" ` + -TemplateBody "{Template Content Here}" ` + -Parameter @( @{ ParameterKey="PK1"; ParameterValue="PV1" }, @{ ParameterKey="PK2"; ParameterValue="PV2" } ) + + +**Example 3: Updates the stack 'myStack' with the specified template and customization parameters. 'PK1' represents the name of a parameter declared in the template and 'PV2' represents its value. The customization parameters can also be specified using 'Key' and 'Value' instead of 'ParameterKey' and 'ParameterValue'.** + + + Update-CFNStack -StackName "myStack" -TemplateBody "{Template Content Here}" -Parameters @{ ParameterKey="PK1"; ParameterValue="PV1" } + + +**Example 4: Updates the stack 'myStack' with the specified template, obtained from Amazon S3, and customization parameters. 'PK1' and 'PK2' represent the names of parameters declared in the template, 'PV1' and 'PV2' represents their requested values. The customization parameters can also be specified using 'Key' and 'Value' instead of 'ParameterKey' and 'ParameterValue'.** + + + Update-CFNStack -StackName "myStack" ` + -TemplateURL https://s3.amazonaws.com/amzn-s3-demo-bucket/templatefile.template ` + -Parameter @( @{ ParameterKey="PK1"; ParameterValue="PV1" }, @{ ParameterKey="PK2"; ParameterValue="PV2" } ) + + +**Example 5: Updates the stack 'myStack', which is assumed in this example to contain IAM resources, with the specified template, obtained from Amazon S3, and customization parameters. 'PK1' and 'PK2' represent the names of parameters declared in the template, 'PV1' and 'PV2' represents their requested values. The customization parameters can also be specified using 'Key' and 'Value' instead of 'ParameterKey' and 'ParameterValue'. Stacks containing IAM resources require you to specify the -Capabilities "CAPABILITY_IAM" parameter otherwise the update will fail with an 'InsufficientCapabilities' error.** + + + Update-CFNStack -StackName "myStack" ` + -TemplateURL https://s3.amazonaws.com/amzn-s3-demo-bucket/templatefile.template ` + -Parameter @( @{ ParameterKey="PK1"; ParameterValue="PV1" }, @{ ParameterKey="PK2"; ParameterValue="PV2" } ) ` + -Capabilities "CAPABILITY_IAM" + + + * For API details, see [UpdateStack](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. + + + +