-
Notifications
You must be signed in to change notification settings - Fork 33
♻️ Standardise mandatory AWS resource tagging across deployments #2283
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
Draft
jasonBirchall
wants to merge
12
commits into
main
Choose a base branch
from
improve-tagging
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3f38280
♻️ Standardise mandatory AWS resource tagging across deployments
e46234c
♻️ Set constant on GitHub environment
bb9306a
✨ Add the GDS Way documentation to offer context
a4fd8ec
♻️ Rename opensearch tag to Chat
60b4c13
♻️ Refactor the release app name
d5d88f8
📝 Remove unwanted doc lines
b0e0cc0
♻️ Change system and service + make lowercase
dd63f01
♻️ Add tags directly into provider
8a1ee18
♻️ Add tags directly to the provider
89301a5
🔥 Remove unwanted and incorrect documentation
7d525e7
♻️ Add tags directly to the provider
0cae716
♻️ Use the mandatory tagging strategy
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| # Terraform Tagging Template | ||
|
|
||
| This template provides the standard tagging configuration for all terraform deployments. | ||
|
|
||
| ## Standard AWS Provider Configuration | ||
|
|
||
| ```hcl | ||
| provider "aws" { | ||
| region = "eu-west-1" | ||
| default_tags { | ||
| tags = local.default_tags | ||
| } | ||
| } | ||
|
|
||
| locals { | ||
| default_tags = { | ||
| Product = "GOV.UK" | ||
| System = "[SYSTEM_NAME]" # Replace with appropriate system name | ||
| Environment = var.govuk_environment | ||
| Owner = "govuk-platform-engineering@digital.cabinet-office.gov.uk" | ||
| repository = "govuk-infrastructure" | ||
| terraform_deployment = basename(abspath(path.root)) | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Standard Google Provider Configuration | ||
|
|
||
| ```hcl | ||
| provider "google" { | ||
| project = var.google_project_id | ||
| region = "europe-west2" | ||
| default_labels = { | ||
| product = "govuk" | ||
| system = "[system-name]" # Replace with lowercase system name | ||
| environment = var.govuk_environment | ||
| owner = "govuk-platform-engineering" | ||
| repository = "govuk-infrastructure" | ||
| terraform_deployment = basename(abspath(path.root)) | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Resource-Specific Tagging | ||
|
|
||
| For resources that need additional tags: | ||
|
|
||
| ```hcl | ||
| resource "aws_example_resource" "example" { | ||
| # ... resource configuration ... | ||
|
|
||
| tags = merge(local.default_tags, { | ||
jasonBirchall marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Name = "example-${var.govuk_environment}" | ||
| Service = "example service" # Optional - describe the function | ||
| }) | ||
| } | ||
| ``` | ||
|
|
||
| ## System Names by Deployment | ||
|
|
||
| | Deployment | System Name | | ||
| |------------|-------------| | ||
| | vpc | VPC | | ||
| | cluster-infrastructure | EKS cluster infrastructure | | ||
| | cluster-services | EKS cluster services | | ||
| | rds | EKS RDS | | ||
| | elasticache | GOVUK ElastiCache | | ||
| | opensearch | OpenSearch | | ||
| | ecr | Elastic Container Registry | | ||
| | govuk-publishing-infrastructure | GOV.UK Publishing | | ||
| | datagovuk-infrastructure | DATA.GOV.UK | | ||
| | logging | Logging | | ||
| | github | GitHub | | ||
| | root-dns | DNS | | ||
| | cloudfront | CloudFront | | ||
| | csp-reporter | CSP Reporter | | ||
| | chat | GOV.UK Chat | | ||
| | mobile-backend | GOV.UK App | | ||
| | release | EKS release assumer | | ||
| | tfc-aws-config | Terraform Cloud | | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.