targets_for_policies
Creates, updates, deletes, gets or lists a targets_for_policies resource.
Overview
| Name | targets_for_policies |
| Type | Resource |
| Id | aws.organizations.targets_for_policies |
Fields
The following fields are returned by SELECT queries:
- list_targets_for_policy
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the policy target. For more information about ARNs in Organizations, see ARN Formats Supported by Organizations in the Amazon Web Services Service Authorization Reference. (pattern: <code>^arn:aws:organizations::.+:.+</code>) |
name | string | The friendly name of the policy target. The regex pattern that is used to validate this parameter is a string of any of the characters in the ASCII character range. |
target_id | string | The unique identifier (ID) of the policy target. The regex pattern for a target ID string requires one of the following: Root - A string that begins with "r-" followed by from 4 to 32 lowercase letters or digits. Account - A string that consists of exactly 12 digits. Organizational unit (OU) - A string that begins with "ou-" followed by from 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This string is followed by a second "-" dash and from 8 to 32 additional lowercase letters or digits. (pattern: <code>^(r-[0-9a-z]{4,32})|(\d{12})|(ou-[0-9a-z]{4,32}-[a-z0-9]{8,32})$</code>) |
type | string | The type of the policy target. (ACCOUNT, ORGANIZATIONAL_UNIT, ROOT) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_targets_for_policy | select | region | Lists all the roots, organizational units (OUs), and accounts that the specified policy is attached to. When calling List* operations, always check the NextToken response parameter value, even if you receive an empty result set. These operations can occasionally return an empty set of results even when more results are available. Continue making requests until NextToken returns null. A null NextToken value indicates that you have retrieved all available results. You can only call this operation from the management account or a member account that is a delegated administrator. |
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 |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- list_targets_for_policy
Lists all the roots, organizational units (OUs), and accounts that the specified policy is attached to. When calling List* operations, always check the NextToken response parameter value, even if you receive an empty result set. These operations can occasionally return an empty set of results even when more results are available. Continue making requests until NextToken returns null. A null NextToken value indicates that you have retrieved all available results. You can only call this operation from the management account or a member account that is a delegated administrator.
SELECT
arn,
name,
target_id,
type
FROM aws.organizations.targets_for_policies
WHERE region = '{{ region }}' -- required
;