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

azurerm_subscription(s) - support for tags #9047

Merged
merged 4 commits into from
Jan 7, 2021

Conversation

magodo
Copy link
Collaborator

@magodo magodo commented Oct 28, 2020

Fixes #8443

Test Result

💤 make testacc TEST=./azurerm/internal/services/subscription/tests TESTARGS='-run TestAccDataSourceAzureRMSubscription'
==> Checking that code complies with gofmt requirements...
==> Checking that Custom Timeouts are used...
==> Checking that acceptance test packages are used...
TF_ACC=1 go test ./azurerm/internal/services/subscription/tests -v -run TestAccDataSourceAzureRMSubscription -timeout 180m -ldflags="-X=github.com/terraform-providers/terraform-provider-azurerm/version.ProviderVersion=acc"
=== RUN   TestAccDataSourceAzureRMSubscription_current
=== PAUSE TestAccDataSourceAzureRMSubscription_current
=== RUN   TestAccDataSourceAzureRMSubscription_specific
=== PAUSE TestAccDataSourceAzureRMSubscription_specific
=== RUN   TestAccDataSourceAzureRMSubscriptions_basic
=== PAUSE TestAccDataSourceAzureRMSubscriptions_basic
=== CONT  TestAccDataSourceAzureRMSubscription_current
=== CONT  TestAccDataSourceAzureRMSubscriptions_basic
=== CONT  TestAccDataSourceAzureRMSubscription_specific
--- PASS: TestAccDataSourceAzureRMSubscription_specific (53.67s)
--- PASS: TestAccDataSourceAzureRMSubscription_current (54.10s)
--- PASS: TestAccDataSourceAzureRMSubscriptions_basic (63.96s)
PASS
ok      github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/subscription/tests  63.994s

Additionally, I tried to run against a subscription which has tags created:

tf_config/azure/subscription via 💠 default 
💤 tf apply -auto-approve
data.azurerm_subscription.current: Refreshing state... [id=/subscriptions/67a9759d-d099-4aa8-8675-e6cfd669c3f4]

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

foo = {
  "a" = "a"
  "b" = "b"
}

tf_config/azure/subscription via 💠 default took 36s 
💤 cat main.tf 
provider "azurerm" {
  features {}
}

data "azurerm_subscription" "current" {}

output "foo" {
  value = data.azurerm_subscription.current.tags
}

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

@magodo, could we change this to use the subscription api like in #8064? thanks!

@ghost ghost added size/XS and removed size/S labels Jan 6, 2021
@magodo
Copy link
Collaborator Author

magodo commented Jan 6, 2021

@katbyte I assume you mean #9456? I've updated accordingly and tested locally. Please take a look!

@katbyte katbyte added this to the v2.42.0 milestone Jan 7, 2021
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks @magodo - this LGTM 👍

@katbyte katbyte merged commit 53e413e into hashicorp:master Jan 7, 2021
katbyte added a commit that referenced this pull request Jan 7, 2021
@ghost
Copy link

ghost commented Jan 8, 2021

This has been released in version 2.42.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.42.0"
}
# ... other configuration ...

@ghost
Copy link

ghost commented Feb 6, 2021

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Feb 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Azure resource tags in each resource's outputs - like Kubernetes "annotations"
3 participants