Modifying an AWS CloudFormation Stack Policy

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html#protect-stack-resources-modifying

To get current stack policy, run the following command:

aws cloudformation get-stack-policy --region AWS_REGION --stack-name STACK_NAME | jq '.StackPolicyBody' | sed 's/"{/{/g' | sed 's/}"/}/g' | sed 's/\\n/ /g' | sed 's/\\"/"/g' | jq '.'

To allow further modification of a stack policy, run the following command:

aws cloudformation set-stack-policy --region AWS_REGION --stack-name STACK_NAME --stack-policy-body '{"Statement" : [{"Effect" : "Allow", "Action" : "Update:*", "Principal": "*", "Resource" : "*"}]}'