Skip to content

Allow setting default tags on resources managed by the provider #711

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

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

mraerino
Copy link
Contributor

@mraerino mraerino commented Apr 14, 2025

This implements something similar to what the AWS provider offers: https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-1

The idea is to have the ability to add some tags to all resources. This is handy for stuff like marking resources managed through terraform, e.g.

provider "netbox" {
  default_tags = ["terraform-managed"]
}

@mraerino mraerino changed the title Allow setting default tags on all managed resources Allow setting default tags on resources managed by the provider Apr 14, 2025
@mraerino mraerino marked this pull request as ready for review April 14, 2025 21:21
@mraerino
Copy link
Contributor Author

mraerino commented Apr 15, 2025

sorry, the move to providerState is quite a large refactor. do you want me to break this into smaller pieces somehow or is it fine like this?

@mraerino
Copy link
Contributor Author

mraerino commented May 7, 2025

@fbreckle anything against landing this?

@fbreckle
Copy link
Collaborator

fbreckle commented May 7, 2025

Nope, I had a look at it already. Very nice feature indeed!

I did not see a test for the functionality itself, i.e. configure provider with default tags, create a - I don't know - netbox_region or something without dependencies and check if it has the tags. Did I miss it?

@mraerino
Copy link
Contributor Author

mraerino commented May 9, 2025

Very good call on the testing. Uncovered some bugs which lead to some refactoring. Should be good now

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.

2 participants