aws-deployment-framework icon indicating copy to clipboard operation
aws-deployment-framework copied to clipboard

feat: customise CloudFormation tags

Open Nr18 opened this issue 3 years ago • 2 comments

Why

We would like to have all our resources properly tagged. And if you look at the following: (Link to code)

                    Tags=[
                        {
                            'Key': 'createdBy',
                            'Value': 'ADF'
                        }
                    ],

Currently, we are patching ADF with each update to include our tagging structure.

Proposal

Just like the global-iam.yml files (these are not overwritten when you upgrade) we could introduce a file, for example: src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/custom.yml that contains something like:

Tags:
    Owner: ACME Platform Team 
    MyOtherTagName: MyOtherTagValue

And then if the file exists we will read the file and use the tags provided in the custom.yml and add the ADF tags (createdBy = ADF) and use that as tags for the CloudFormation Stacks.

So in this example the rendered tags will look like:

                    Tags=[
                        {
                            'Key': 'createdBy',
                            'Value': 'ADF'
                        },
                        {
                            'Key': 'Owner',
                            'Value': 'ACME Platform Team '
                        },
                        {
                            'Key': 'MyOtherTagName',
                            'Value': 'MyOtherTagValue'
                        }
                    ],

Why custom.yml and not tags.yml? This gives some flexibility to the future so that you have a single place to define things that are used by ADF.

Nr18 avatar Jan 13 '22 15:01 Nr18

Thanks for sharing this idea, that would be a good feature to support. At the moment, we are focused on releasing v3.2.0. Since that is consuming most of our time, this might be on hold until a future release.

Ideally, this feature would support the same behavior as the global-iam.yml. Such that you can define separate tags per OU and the most specific match is applied.

Additionally, I would propose to move the createdBy tag configuration to adfconfig.yml. Such that the format of the tag can be updated to meet the tagging policies if enforced. That should include support for a list of tags, so additional tags can be added if needed. The final tags that are created should be the adfconfig.yml tags + custom.yml tags.

Lets discuss the implementation options here, I am happy to accept a PR if any one wants to pick this up.

sbkok avatar Feb 04 '22 10:02 sbkok

One other thing to consider, should these tags be applied to accounts that are created or not? Maybe we should support configuring both separately in this file structure too.

sbkok avatar Feb 04 '22 10:02 sbkok