CloudFormation stacks should have a stack policy to prevent unintended or unauthorized updates to stack resources, protecting critical resources from accidental changes or deployment mistakes.
For Ansible tasks using the amazon.aws.cloudformation or cloudformation modules, the stack_policy property must be defined and set to a valid JSON policy that restricts update actions. Resources missing the stack_policy property or with it undefined are flagged. Provide a JSON policy string (or file content) that explicitly denies Update actions for any logical resource IDs you want to protect.
- name:create a stack, pass in the template via an URLamazon.aws.cloudformation:stack_name:ansible-cloudformationstack_policy:wowowowoowowstate:presentregion:us-east-1disable_rollback:truetemplate_url:https://s3.amazonaws.com/my-bucket/cloudformation.templatetemplate_parameters:KeyName:jmartinDiskType:ephemeralInstanceType:m1.smallClusterSize:3tags:Stack:ansible-cloudformation
Non-Compliant Code Examples
- name:create a stack, pass in the template via an URLamazon.aws.cloudformation:stack_name:"ansible-cloudformation"state:presentregion:us-east-1disable_rollback:truetemplate_url:https://s3.amazonaws.com/my-bucket/cloudformation.templatetemplate_parameters:KeyName:jmartinDiskType:ephemeralInstanceType:m1.smallClusterSize:3tags:Stack:ansible-cloudformation
1
2
rulesets:- Ansible / AWS # Rules to enforce / AWS.
맞춤형 데모 요청
Datadog 시작하기
Ask AI
AI-generated responses may be inaccurate. Verify important info.