boltops-tools / terraspace

Terraspace: The Terraform Framework
https://terraspace.cloud
Apache License 2.0
674 stars 46 forks source link

Not Parsing config.tags From AzureRM Plugin Config File #280

Open biodrone opened 1 year ago

biodrone commented 1 year ago

Checklist

My Environment

Software Version
Operating System WSL Ubuntu 22.04.01 LTS
Terraform 1.3.4
Terraspace 2.2.2
Ruby 3.1.2p20

Expected Behaviour

The below config added to config/plugins/azurerm.rb should result in the listed tags being created for each resource. I've tested this with a fresh project just to make nothing from my current one was causing issues and it seems to be reproducible off the bat.

Relevant docs page: https://terraspace.cloud/docs/plugins/azurerm/

TerraspacePluginAzurerm.configure do |config|
    config.auto_create = true
    config.resource_group.update_existing = true
    config.storage_account.allow_blob_public_access = false
    config.storage_account.is_versioning_enabled = true

    config.tags = {env: Terraspace.env, terraspace: true}
end

Current Behavior

Doesn't add any tags at all. Tested manually adding tags which works as expected but the point of this config is to not have to repeat the tag block for every resource... I've tried a bunch of different formats for the tags, which is how I can tell it is definitely reading the file (when I give it invalid syntax it break as expected) but it just doesn't seem to be adding tags for whatever reason.

Step-by-step reproduction instructions

Code Sample

See expected behavior above

Solution Suggestion

The tags need to be parsed and added to resources when created, as per the docs. I may alternatively just be doing something stupid and missing a compilation step before hand. If that's the case, I didn't see anything relevant anywhere in the docs so something should probably be added to clarify that extra step.

Happy to submit a PR if that documentation needs updating but I'm not fluent in Ruby so it's difficult to dig through and figure out why the tags might not be getting parsed.