enabled_controls
Creates, updates, deletes or gets an enabled_control resource or lists enabled_controls in a region
Overview
| Name | enabled_controls |
| Type | Resource |
| Description | Enables a control on a specified target. |
| Id | awscc.controltower.enabled_controls |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
control_identifier | string | Arn of the control. |
target_identifier | string | Arn for Organizational unit to which the control needs to be applied |
parameters | array | Parameters to configure the enabled control behavior. |
tags | array | A set of tags to assign to the enabled control. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
control_identifier | string | Arn of the control. |
target_identifier | string | Arn for Organizational unit to which the control needs to be applied |
region | string | AWS region. |
For more information, see AWS::ControlTower::EnabledControl.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | enabled_controls | INSERT | TargetIdentifier, ControlIdentifier, region |
delete_resource | enabled_controls | DELETE | Identifier, region |
update_resource | enabled_controls | UPDATE | Identifier, PatchDocument, region |
list_resources | enabled_controls_list_only | SELECT | region |
get_resource | enabled_controls | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual enabled_control.
SELECT
region,
control_identifier,
target_identifier,
parameters,
tags
FROM awscc.controltower.enabled_controls
WHERE
region = 'us-east-1' AND
Identifier = '{{ target_identifier }}|{{ control_identifier }}';
Lists all enabled_controls in a region.
SELECT
region,
target_identifier,
control_identifier
FROM awscc.controltower.enabled_controls_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new enabled_control resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.controltower.enabled_controls (
ControlIdentifier,
TargetIdentifier,
region
)
SELECT
'{{ control_identifier }}',
'{{ target_identifier }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.controltower.enabled_controls (
ControlIdentifier,
TargetIdentifier,
Parameters,
Tags,
region
)
SELECT
'{{ control_identifier }}',
'{{ target_identifier }}',
'{{ parameters }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: enabled_control
props:
- name: control_identifier
value: '{{ control_identifier }}'
- name: target_identifier
value: '{{ target_identifier }}'
- name: parameters
value:
- value: null
key: '{{ key }}'
- name: tags
value:
- value: '{{ value }}'
key: '{{ key }}'
UPDATE example
Use the following StackQL query and manifest file to update a enabled_control resource, using stack-deploy.
/*+ update */
UPDATE awscc.controltower.enabled_controls
SET PatchDocument = string('{{ {
"Parameters": parameters,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ target_identifier }}|{{ control_identifier }}';
DELETE example
/*+ delete */
DELETE FROM awscc.controltower.enabled_controls
WHERE
Identifier = '{{ target_identifier }}|{{ control_identifier }}' AND
region = 'us-east-1';
Permissions
To operate on the enabled_controls resource, the following permissions are required:
- Create
- Update
- Delete
- Read
- List
controltower:ListEnabledControls,
controltower:GetEnabledControl,
controltower:GetControlOperation,
controltower:EnableControl,
controltower:TagResource,
organizations:UpdatePolicy,
organizations:CreatePolicy,
organizations:AttachPolicy,
organizations:DetachPolicy,
organizations:ListPoliciesForTarget,
organizations:ListTargetsForPolicy,
organizations:DescribePolicy,
controltower:ListTagsForResource
controltower:ListEnabledControls,
controltower:GetEnabledControl,
controltower:GetControlOperation,
controltower:UpdateEnabledControl,
controltower:UntagResource,
controltower:TagResource,
organizations:UpdatePolicy,
organizations:CreatePolicy,
organizations:AttachPolicy,
organizations:DetachPolicy,
organizations:ListPoliciesForTarget,
organizations:ListTargetsForPolicy,
organizations:DescribePolicy,
controltower:ListTagsForResource
controltower:ListEnabledControls,
controltower:GetEnabledControl,
controltower:GetControlOperation,
controltower:DisableControl,
organizations:UpdatePolicy,
organizations:DeletePolicy,
organizations:CreatePolicy,
organizations:AttachPolicy,
organizations:DetachPolicy,
organizations:ListPoliciesForTarget,
organizations:ListTargetsForPolicy,
organizations:DescribePolicy,
controltower:ListTagsForResource
controltower:ListEnabledControls,
controltower:GetEnabledControl,
controltower:ListTagsForResource
controltower:ListEnabledControls