Skip to content

Add filterable properties to SSMAssociation #1014

Description

@mike-rsi

Summary

SSMAssociation does not currently expose custom properties through a
Properties() method. As a result, configuration filters cannot match individual
SSM associations by name, document, targets, or tags.

The filter handler also reports that SSMAssociation does not support custom
properties.

Current behavior

SSMAssociation exposes only its association ID through String(). Users who
need to protect a particular association from deletion must exclude the entire
SSMAssociation resource type, which also prevents cleanup of every other
association.

For example, filters like these cannot currently be used:

filters:
  SSMAssociation:
    - property: AssociationName
      type: exact
      value: install-monitoring-agent
    - property: DocumentName
      type: glob
      value: AWS-*
    - property: tag:Environment
      type: exact
      value: production

Proposed change

Implement Properties() types.Properties for SSMAssociation and expose:

  • AssociationId
  • AssociationName
  • DocumentName
  • Legacy target instance ID, when available
  • Association targets and target maps
  • Target instance IDs derived from association targets, when available
  • Resource tags as tag:<Key> properties

Tags should be retrieved while listing associations using
ListTagsForResource with ResourceType=Association.

These properties should support the standard exact, contains, glob, and regex
filter types.

Error handling

Associations without a name, targets, or tags should remain listable and should
not cause nil-pointer errors.

If tag retrieval fails for one association, listing should log a warning and
skip only that association. Returning associations without their tags could
cause tag-based filters to be evaluated incorrectly, while aborting the entire
listing would cause all associations to evade cleanup.

This follows the per-resource enrichment error-handling guidance tracked in
#907.

Expected outcome

Users can protect individual SSM associations while continuing to clean up
unmatched associations, and filtering no longer reports that
SSMAssociation lacks custom-property support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions