hashicorp / terraform-provider-azure-classic

Terraform Azure Classic (Service Management) provider
https://www.terraform.io/docs/providers/azure/
Mozilla Public License 2.0
3 stars 11 forks source link

[azure] Parameterised name in 0.6.6 results in a warning about error in version 0.4 for azure_storage_service #16

Closed hashibot closed 6 years ago

hashibot commented 7 years ago

This issue was originally opened by @davehodgson as hashicorp/terraform#4172. It was migrated here as part of the provider split. The original body of the issue is below.


I'm trying to build a scripted environment I can run up several times using a different prefix on the resources.

It appears to work ok, except that I get a warning when I run terraform plan that an error will be generated in terraform 0.4 (and I presume later versions) but no error is generated. Not sure if it should error or the warning shouldn't appear.

I've split the script out into three files, I haven't uploaded the tfvars due it having some sensitive config in it, but I do have the line below in that file:

azure_prefix="CLIENTNAME"

0.3_Terraform.zip.txt

Zip file is giving an error so the file upload has an extension of txt but is a zip.

There message I get when I run terraform plan is:

Warnings:

No errors found. Continuing with 1 warning(s).

However when I look at what would be created the name is interpolated correctly.

hashibot commented 7 years ago

This comment was originally opened by @davehodgson as https://github.com/hashicorp/terraform/issues/4172#issuecomment-162233737. It was migrated here as part of the provider split. The original comment is below.


I note that by design terraform resource names are not meant to be parameterised so when I leave to parameter in the name field of the resource but the resource name itself just changed to store01 it completes fine.

So this issue is only that the warning message is misleading, its either and error or it doesn't need to be displayed given the version is higher than 0.4

hashibot commented 7 years ago

This comment was originally opened by @jen20 as https://github.com/hashicorp/terraform/issues/4172#issuecomment-162233993. It was migrated here as part of the provider split. The original comment is below.


Hi @davehodgson! Thanks for opening the issue. If I'm following correctly, you have something like this:

resource "azure_something" "${var.prefix}_restofresourcename" {
    //arguments
}

Am I following correctly?

hashibot commented 7 years ago

This comment was originally opened by @davehodgson as https://github.com/hashicorp/terraform/issues/4172#issuecomment-162234181. It was migrated here as part of the provider split. The original comment is below.


Hi @jen20 ,

Yep - sorry I realised after I logged it that I had:

1: resource "azure_something" "${var.prefix}_restofresourcename" { 2: name="${var.prefix}_restofname" 3: }

I mistook the error message for being in relation to line 2 rather than the terraform resource name in line 1.

After I realised that I found another issue stating that is a design decision, so the issue is only that it I generates a warning that is misleading and probably should generate an error instead

vancluever commented 6 years ago

Hello!

Thank you for opening this issue and participating in the discussion. Today (December 19, 2017) we’ve announced the deprecation and archival of the Azure Classic Provider. Matching Microsoft’s commitment to gradually remove access to Azure Classic (or Service Management) which is outlined in this blog post, we are closing all open PR's and Issues here. This repository will remain available here on GitHub, but in an archived state, and no longer receiving support or new releases.

The Azure (Resource Manager) Provider remains fully supported and is our recommended approach for managing Azure with Terraform. More information about this process is available in the blog post linked above.

Thanks! The Terraform Team