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

Plan failing due to aws_ecs_cluster no longer outputs arn (v0.10.8 -> v0.11.0) #2539

Closed
hashibot opened this issue Dec 5, 2017 · 5 comments · Fixed by #2552
Closed

Plan failing due to aws_ecs_cluster no longer outputs arn (v0.10.8 -> v0.11.0) #2539

hashibot opened this issue Dec 5, 2017 · 5 comments · Fixed by #2552
Labels
bug Addresses a defect in current functionality.

Comments

@hashibot
Copy link

hashibot commented Dec 5, 2017

This issue was originally opened by @vladimirf7 as hashicorp/terraform#16819. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.11.0

Terraform Configuration Files

# main.tf

resource "aws_ecs_cluster" "cluster" {
  name = "cluster"
}

output "arn" {
  value = "${aws_ecs_cluster.cluster.arn}"
}

Debug Output

Crash Output

Expected Behavior

Running with Terraform v0.10.8 is OK:

Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.


------------------------------------------------------------------------

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  + aws_ecs_cluster.cluster
      id:   <computed>
      name: "cluster"


Plan: 1 to add, 0 to change, 0 to destroy.

Actual Behavior

Running with Terraform v0.11.0 FAILS:

Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.


------------------------------------------------------------------------

Error: Error running plan: 1 error(s) occurred:

* output.arn: Resource 'aws_ecs_cluster.cluster' does not have attribute 'arn' for variable 'aws_ecs_cluster.cluster.arn'

Steps to Reproduce

Important Factoids

According to docs, aws_ecs_cluster does NOT expose arn as an output, but it worked until v0.11.0

References

@Ninir
Copy link
Contributor

Ninir commented Dec 5, 2017

Hi @vladimirf7

This is something annoying that happens when switching to Terraform 0.11, but is however expected.

Until then, outputs with invalid values were simply ignored, so it "worked", but it was in fact just silently failing. Now, invalid values in outputs throw errors, as you saw it.

I assume this output never showed up previously.
The easiest fix would be to use the ID attribute, as in aws_ecs_cluster.cluster.id, which contains the ARN.

We can't do more on that since this was expected. For this reason, I'm going to close it if you don't mind.

Tell us if this fixed your issue! :)

Happy Terraforming!

@Ninir Ninir closed this as completed Dec 5, 2017
@vladimirf7
Copy link

It's not a big deal, though I haven't seen this mentioned anywhere. Change to aws_ecs_cluster.cluster.id definitely fixes the problem.
Thank you!

@bflad
Copy link
Contributor

bflad commented Dec 5, 2017

@vladimirf7 As a workaround for now you can pull the ARN via the resource ID ${aws_ecs_service.example.id}. Since we provide the ARN attribute for a large portion of other resources (resource IDs aren't consistently ARNs), I have submitted #2552 to add it.

@vladimirf7
Copy link

@bflad great stuff, thanks!

@ghost
Copy link

ghost commented Apr 10, 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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants