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 = 'us-east-1' 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 }}';

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 }}';

DELETE example

/*+ delete */
DELETE FROM awscc.securityhub.policy_associations
WHERE
Identifier = '{{ association_identifier }}' AND
region = 'us-east-1';

Permissions

To operate on the policy_associations resource, the following permissions are required:

securityhub:StartConfigurationPolicyAssociation,
securityhub:GetConfigurationPolicyAssociation