Skip to main content

associations

Creates, updates, deletes or gets an association resource or lists associations in a region

Overview

Nameassociations
TypeResource
DescriptionThe AWS::SSM::Association resource associates an SSM document in AWS Systems Manager with EC2 instances that contain a configuration agent to process the document.
Idaws.ssm.associations

Fields

NameDatatypeDescription
association_namestringThe name of the association.
calendar_namesarray
schedule_expressionstringA Cron or Rate expression that specifies when the association is applied to the target.
max_errorsstring
parametersobjectParameter values that the SSM document uses at runtime.
instance_idstringThe ID of the instance that the SSM document is associated with.
wait_for_success_timeout_secondsinteger
max_concurrencystring
compliance_severitystring
targetsarrayThe targets that the SSM document sends commands to.
sync_compliancestring
output_locationobject
schedule_offsetinteger
namestringThe name of the SSM document.
apply_only_at_cron_intervalboolean
document_versionstringThe version of the SSM document to associate with the target.
association_idstringUnique identifier of the association.
automation_target_parameter_namestring
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTName, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__Identifier, region

SELECT examples

Gets all associations in a region.

SELECT
region,
association_name,
calendar_names,
schedule_expression,
max_errors,
parameters,
instance_id,
wait_for_success_timeout_seconds,
max_concurrency,
compliance_severity,
targets,
sync_compliance,
output_location,
schedule_offset,
name,
apply_only_at_cron_interval,
document_version,
association_id,
automation_target_parameter_name
FROM aws.ssm.associations
WHERE region = 'us-east-1';

Gets all properties from an individual association.

SELECT
region,
association_name,
calendar_names,
schedule_expression,
max_errors,
parameters,
instance_id,
wait_for_success_timeout_seconds,
max_concurrency,
compliance_severity,
targets,
sync_compliance,
output_location,
schedule_offset,
name,
apply_only_at_cron_interval,
document_version,
association_id,
automation_target_parameter_name
FROM aws.ssm.associations
WHERE region = 'us-east-1' AND data__Identifier = '<AssociationId>';

INSERT example

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

/*+ create */
INSERT INTO aws.ssm.associations (
Name,
region
)
SELECT
'{{ Name }}',
'{{ region }}';

DELETE example

/*+ delete */
DELETE FROM aws.ssm.associations
WHERE data__Identifier = '<AssociationId>'
AND region = 'us-east-1';

Permissions

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

Read

ssm:DescribeAssociation,
resource-groups:GetGroupQuery,
resource-groups:ListGroups,
resource-groups:ListGroupResources

Create

ec2:DescribeInstanceStatus,
iam:PassRole,
iam:CreateServiceLinkedRole,
ssm:CreateAssociation,
ssm:DescribeAssociation,
ssm:GetCalendarState

Update

iam:PassRole,
ssm:UpdateAssociation,
ssm:GetCalendarState

List

ssm:ListAssociations

Delete

ssm:DeleteAssociation