awslabs / aws-deployment-framework

The AWS Deployment Framework (ADF) is an extensive and flexible framework to manage and deploy resources across multiple AWS accounts and regions based on AWS Organizations.
Apache License 2.0
668 stars 226 forks source link

[Feat]: Enhanced Targetting via Tags #688

Open alexevansigg opened 9 months ago

alexevansigg commented 9 months ago

Describe the feature

Deployment Maps Targeting via Tags improvement.
When targeting via tags, I want to target multiple values for the same tag without needing multiple stages and also target via multiple named tags in the same stage

Use Case

All my accounts are tagged with the a key "account-short-name" the value is a short unique name within the organization for the account.

I want to target several such accounts to deploy the same stack too.

Proposed Solution

Add support for List in Tag values such as ...

tags:
   account-short-name:
       - my-account-tag-1
       - my-account-tag-2

Additionally add a conditional operator support for multiple named tags

tags-condition: any # Filter accounts matching either of the below tags.
tags:
   account-short-name: my-test-account-tag-1
   environment: dev
tags-condition: all # Filter accounts which match both of the below tags.
tags:
   account-short-name: my-test-account-tag-1
   environment: dev

Acknowledgements

sbkok commented 8 months ago

That would be a great improvement, thanks for suggesting this and offering to build the feature!

If you could draft the required changes for the schema_validation.py to start with, that would ease the discussion on how this would work.

Ideally this would be backwards compatible with the current implementation. I'm happy to discuss and assist with reviews of your implementation.