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

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

Closed
davehodgson opened this issue Dec 5, 2015 · 4 comments

Comments

@davehodgson
Copy link

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:

  • azure_storage_service.${var.azure_prefix}Store01: ${var.azure_prefix}Store01: resource name can only contain letters, numbers, dashes, and underscores.
    This will be an error in Terraform 0.4

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

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

@davehodgson
Copy link
Author

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

@jen20
Copy link
Contributor

jen20 commented Dec 5, 2015

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?

@davehodgson
Copy link
Author

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

@ghost
Copy link

ghost commented Apr 11, 2020

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants