Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tag resources #31

Closed
brianleroux opened this issue Nov 20, 2017 · 10 comments
Closed

tag resources #31

brianleroux opened this issue Nov 20, 2017 · 10 comments
Assignees

Comments

@brianleroux
Copy link
Member

use @app to tag lambdas, tables, restapis… basically anything generated by arc

@brianleroux
Copy link
Member Author

nice idea for the future so adding to the wiki

@sentience
Copy link

Our organisation has a tagging standard for all its AWS resources, so we could really use this capability. For now, is there any more practical approach than going into the AWS Console and manually tagging the resources created by arc?

@brianleroux
Copy link
Member Author

This is a great use case for opening up access to the cli workflow tool arc-inventory. Basically when you run npx inventory it calls this code which returns a tidy object of all your resources defined by .arc in the current directory.

Can you share more with the tagging standard of your org?

@brianleroux brianleroux reopened this Sep 8, 2018
@brianleroux brianleroux self-assigned this Sep 8, 2018
@sentience
Copy link

Sure! Here's a quick paste of our standard:

Tagging AWS Resources: Sensible Defaults

This is a sensible default. Read the linked article for more information about what a sensible default is and how to read this document.

Tagging AWS resources allows for better cost control, easier auditing and helps new team members understand how stuff works. Tags can declare AWS resources as components of an item in our asset register, making it easier to track risk.

Implementation

Most AWS resources are managed via CloudFormation. When launching a CloudFormation stack, our mandatory tags MUST be specified. This ensures the stack itself is tagged, and that the tags flow into all taggable resources created as a result. AWS CLI supports this via --tags when creating or updating a stack.

Tag keys and values

  • Tags are case sensitive; precise keys and values are required
  • All key names should be lower case e.g. foo
    • Except for Name which AWS treats as special in the web console.
  • There should be no spaces in key names, use hyphen e.g. foo-bar
  • Where possible do not use special characters in tag values.

Mandatory tags

All taggable AWS resources must have the following tags. The examples given would apply to Influx's production RDS database.

We run an AWS Config rule to monitor compliance with mandatory tagging.

Tag Names Example value Summary
asset influx Asset ID which the resource is a component of
workload production The type of workload, representing availability impact
data-classification restricted Classification of the data held by the resource

asset

All AWS resources represent a component of an “asset” in Culture Amp's Asset Register. The asset tag must be set to the ID of the associated asset.

Example values
murmur
influx
aws-infrastructure

workload

The type of workload the resource is supporting. This helps represent the impact to availability if the resource fails. It is also indicative of the classification of data the service can impact.

Value Description
production resource failure has immediate customer impact.
management resource failure prevents us managing our services, e.g. VPN, AD.
delivery resource failure prevents us from delivering new features.
staging resource failure prevents us from demonstrating/testing upcoming features.
development resource failure prevents us from working on new features
sandbox resource failure has negligible impact

data-classification

A data classification from our Data Protection Policy relating to the data held within the resource. Mandatory for all AWS resources, but may be “None” if there is no data.

Value Description
none Resource is not a data repository
internal-use-only The default; not public, but low-impact
public Data intentionally published to the public
confidential Aggregated/anonymised customer data
restricted Raw customer data

Further reading:

@brianleroux
Copy link
Member Author

brianleroux commented Sep 14, 2018

thx for this / super helpful!!!

given that arc generates all sorts of infra but the end user experience is effectively a manifest and a bunch of functions do you think a new section called @tags work for your use case?

@app
myapp

@html
get /

@tags
asset aws-infrastructure
tag2 value-two
etc etc

The example .arc above would apply tags to all resources. Imagining a workflow wherein you can use npx inventory tags to verify/sync the aws resources to the tags in the arc file. We could allow for function level override using .arc-config.

One problem w this approach is I'm not sure how we'd handle tagging the diff between staging and production!

@sentience
Copy link

@brianleroux That looks great except for the need to tag staging/production with a “workload” tag in our case. Could we support tagging from environment variables with some kind of placeholder?

@tags
asset aws-infrastructure
workload %ARC_DEPLOY%

@vala84no
Copy link

+1 for this feature. It would be very helpful to be able to specify tags, though there's some difficulties involving dynamic tags. Static tags as a first step would be great. For dynamic tags, would it be possible to just leverage the fact that the repo will be using node? Something like a .arc-tags.js that exports a function that can be executed for everything generated by arc to determine suitable tags (in addition to the already defined static ones). It would be relatively easy to implement after static tags had been implemented while being very powerful.

@JakeChampion
Copy link

Tagging is also a standard at my workplace. We currently use Serverless Framework and it's stackTags feature, which tags the entire cloudformation stack with the associated tags.

@brianleroux
Copy link
Member Author

YES! I have been dying to build this in. We do now have a macros feature which allows you to modify the generated CFN … if anyone gets a macro going its a very short jump to adding it into architect/package

@brianleroux
Copy link
Member Author

Thank you for your continued patience! Adding to architect/architect distribution as soon as all the tests pass. You can now tag every deploy with arc deploy --name mycustomname --tags key=val my=hello!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants