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 = '{{ region }}' 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 = '{{ region }}';
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.controltower.enabled_controls (
ControlIdentifier,
TargetIdentifier,
Parameters,
Tags,
region
)
SELECT
'{{ control_identifier }}',
'{{ target_identifier }}',
'{{ parameters }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
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 }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.controltower.enabled_controls
WHERE
Identifier = '{{ target_identifier }}|{{ control_identifier }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
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