Skip to main content

policy_associations

Creates, updates, deletes or gets a policy_association resource or lists policy_associations in a region

Overview

Namepolicy_associations
TypeResource
DescriptionThe AWS::SecurityHub::PolicyAssociation resource represents the AWS Security Hub Central Configuration Policy associations in your Target. Only the AWS Security Hub delegated administrator can create the resouce from the home region.
Idawscc.securityhub.policy_associations

Fields

NameDatatypeDescription
configuration_policy_idstringThe universally unique identifier (UUID) of the configuration policy or a value of SELF_MANAGED_SECURITY_HUB for a self-managed configuration
association_statusstringThe current status of the association between the specified target and the configuration
association_typestringIndicates whether the association between the specified target and the configuration was directly applied by the Security Hub delegated administrator or inherited from a parent
association_status_messagestringAn explanation for a FAILED value for AssociationStatus
target_idstringThe identifier of the target account, organizational unit, or the root
target_typestringIndicates whether the target is an AWS account, organizational unit, or the organization root
updated_atstringThe date and time, in UTC and ISO 8601 format, that the configuration policy association was last updated
association_identifierstringA unique identifier to indicates if the target has an association
regionstringAWS region.

For more information, see AWS::SecurityHub::PolicyAssociation.

Methods

NameResourceAccessible byRequired Params
create_resourcepolicy_associationsINSERTTargetId, TargetType, ConfigurationPolicyId, region
delete_resourcepolicy_associationsDELETEIdentifier, region
update_resourcepolicy_associationsUPDATEIdentifier, PatchDocument, region
list_resourcespolicy_associations_list_onlySELECTregion
get_resourcepolicy_associationsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual policy_association.

SELECT
region,
configuration_policy_id,
association_status,
association_type,
association_status_message,
target_id,
target_type,
updated_at,
association_identifier
FROM awscc.securityhub.policy_associations
WHERE
region = '{{ region }}' AND
Identifier = '{{ association_identifier }}';

INSERT example

Use the following StackQL query and manifest file to create a new policy_association resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.securityhub.policy_associations (
ConfigurationPolicyId,
TargetId,
TargetType,
region
)
SELECT
'{{ configuration_policy_id }}',
'{{ target_id }}',
'{{ target_type }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a policy_association resource, using stack-deploy.

/*+ update */
UPDATE awscc.securityhub.policy_associations
SET PatchDocument = string('{{ {
"ConfigurationPolicyId": configuration_policy_id
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ association_identifier }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.securityhub.policy_associations
WHERE
Identifier = '{{ association_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:

ParameterDescription
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 policy_associations resource, the following permissions are required:

securityhub:StartConfigurationPolicyAssociation,
securityhub:GetConfigurationPolicyAssociation