stack_policies
Creates, updates, deletes, gets or lists a stack_policies resource.
Overview
| Name | stack_policies |
| Type | Resource |
| Id | aws.cloudformation.stack_policies |
Fields
The following fields are returned by SELECT queries:
- get_stack_policy
| Name | Datatype | Description |
|---|---|---|
line_items | array |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_stack_policy | select | StackName, region | Returns the stack policy for a specified stack. If a stack doesn't have a policy, a null value is returned. | |
set_stack_policy | update | StackName, region | StackPolicyBody, StackPolicyURL | Sets a stack policy for a specified stack. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
StackName | string | The name or unique stack ID that you want to associate a policy with. |
region | string | AWS region (default: us-east-1) |
StackPolicyBody | string | Structure that contains the stack policy body. For more information, see Prevent updates to stack resources in the CloudFormation User Guide. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both. |
StackPolicyURL | string | Location of a file that contains the stack policy. The URL must point to a policy (maximum size: 16 KB) located in an Amazon S3 bucket in the same Amazon Web Services Region as the stack. The location for an Amazon S3 bucket must start with https://. URLs from S3 static websites are not supported. You can specify either the StackPolicyBody or the StackPolicyURL parameter, but not both. |
SELECT examples
- get_stack_policy
Returns the stack policy for a specified stack. If a stack doesn't have a policy, a null value is returned.
SELECT
line_items
FROM aws.cloudformation.stack_policies
WHERE StackName = '{{ StackName }}' -- required
AND region = '{{ region }}' -- required
;
UPDATE examples
- set_stack_policy
Sets a stack policy for a specified stack.
UPDATE aws.cloudformation.stack_policies
SET
-- No updatable properties
WHERE
StackName = '{{ StackName }}' --required
AND region = '{{ region }}' --required
AND StackPolicyBody = '{{ StackPolicyBody}}'
AND StackPolicyURL = '{{ StackPolicyURL}}';