CmdID / aws / aws cloudformation
aws cloudformation get-stack-policy
Returns the stack policy for a specified stack. AWS CLI reference
1 example 1 option Its page in the AWS CLI reference
Examples
To view a stack policy
The following get-stack-policy example displays the stack policy for the specified stack. To attach a policy to a stack, use the set-stack-policy command.
aws cloudformation get-stack-policy --stack-name my-stackIdentify--stack-nameThe name or unique stack ID that's associated with the stack whose policy you want to get.Its output
{
"StackPolicyBody": "{\n \"Statement\" : [\n {\n \"Effect\" : \"Allow\",\n \"Action\" : \"Update:*\",\n \"Principal\": \"*\",\n \"Resource\" : \"*\"\n },\n {\n \"Effect\" : \"Deny\",\n \"Action\" : \"Update:*\",\n \"Principal\": \"*\",\n \"Resource\" : \"LogicalResourceId/bucket\"\n }\n ]\n}\n"
}For more information, see Prevent updates to stack resources in the AWS CloudFormation User Guide.
Options
--stack-nameThe name or unique stack ID that's associated with the stack whose policy you want to get.