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

feat: Ignore tags #6823

Merged
merged 1 commit into from
Oct 31, 2023
Merged

feat: Ignore tags #6823

merged 1 commit into from
Oct 31, 2023

Conversation

alismx
Copy link
Collaborator

@alismx alismx commented Oct 23, 2023

DEVOPS PULL REQUEST

Related Issue

Changes Proposed

  • This Pull Request changes the resource_group tag to be based on data.azurerm_resource_group.dev.name instead of "${local.project}-${local.name}-${local.env_level}" or "${local.project}-${local.name}-${local.env}". This brings consistency across all environment configs as some were using local.env which would tag dev(2,3,4,5...) incorrectly. By making this update, we can reduce some future mental overhead when reading through the code to understand which resource group a resource belongs to. I'll call out an example inline on a dev3 file where this caused an inconsistency.
  • This PR also introduces lifecycle blocks to several resources to eliminate needless tag updates. The CDC is pretty much in charge of our tags and we don't use them for any meaningful purpose, we don't need to track or update the values of them.

Testing

  • Reviewers should verify that the addition of the lifecycle block correctly ignores tag changes to avoid unnecessary updates, these tags do not affect the functionality of the resources.

Checklist for Primary Reviewer

Infrastructure

  • Consult the results of the terraform-plan job inside the "Terraform Checks" workflow run for this PR. Confirm that there are no unexpected changes!

Security

  • Changes with security implications have been approved by a security engineer (changes to authentication, encryption, handling of PII, etc.)
  • Any dependencies introduced have been vetted and discussed

Cloud

  • Oncall has been notified if this change is going in after-hours
  • If there are changes that cannot be tested locally, this has been deployed to our Azure test, dev, or pentest environment for verification

Documentation

  • Any changes to the startup configuration have been documented in the README

@alismx alismx changed the title feat: add cdc_tags feat: Ignore tags Oct 23, 2023
@@ -10,7 +10,7 @@ locals {
management_tags = {
prime-app = "simple-report"
environment = local.env
resource_group = "${local.project}-${local.name}-${local.env}"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was incorrectly tagged. "${local.project}-${local.name}-${local.env}" resolves to prime-simple-report-dev3 when it should have been prime-simple-report-dev.

@alismx alismx force-pushed the alis/cdc_tags branch 3 times, most recently from 6be9d03 to c84b1d8 Compare October 23, 2023 22:57
@alismx alismx marked this pull request as ready for review October 23, 2023 23:21
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@alismx alismx requested review from emyl3, DanielSass and BobanL October 24, 2023 15:45
Copy link
Collaborator

@rin-skylight rin-skylight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏷️ 💥 ❗

@DanielSass
Copy link
Collaborator

This PR also introduces lifecycle blocks to several resources to eliminate needless tag updates. The CDC is pretty much in charge of our tags and we don't use them for any meaningful purpose, we don't need to track or update the values of them.

Is the cdc tagging our resources outside of terraform / source control?

Copy link
Collaborator

@DanielSass DanielSass left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🏷️ ➡️ 🗑️

Copy link
Collaborator

@emyl3 emyl3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@alismx alismx added this pull request to the merge queue Oct 31, 2023
Merged via the queue into main with commit 792f35b Oct 31, 2023
33 checks passed
@alismx alismx deleted the alis/cdc_tags branch October 31, 2023 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update terraform to ignore tags
4 participants