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

Add ARN attribute for aws_instance #5425

Closed
tdmalone opened this issue Aug 2, 2018 · 4 comments · Fixed by #5432
Closed

Add ARN attribute for aws_instance #5425

tdmalone opened this issue Aug 2, 2018 · 4 comments · Fixed by #5432
Labels
enhancement Requests to existing resources that expand the functionality or scope. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@tdmalone
Copy link
Contributor

tdmalone commented Aug 2, 2018

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

I'd love to be able to directly access the ARN of an EC2 instance, for example for interpolation into an IAM policy.

New or Affected Resource(s)

Of note, the ARN is already exported for the db_instance resource and data resource.

Potential Terraform Configuration

resource "aws_instance" "main" {
  // ... etc. etc.
}

data "template_file" "iam_policy_template" {
  template = "$(file("my-policy.json")}"

  vars {
    instance_arn = "${aws_instance.main.arn}"
  }
}
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/ec2 Issues and PRs that pertain to the ec2 service. labels Aug 2, 2018
@blckct
Copy link
Contributor

blckct commented Aug 2, 2018

That's probably not the only resource with missing ARN, probably would be a good idea to go over them and check.

blckct added a commit to blckct/terraform-provider-aws that referenced this issue Aug 2, 2018
@bflad bflad added this to the v1.31.0 milestone Aug 6, 2018
bflad added a commit that referenced this issue Aug 6, 2018
Add ARN attribute for aws_instance and data.aws_instance (#5425)
@bflad
Copy link
Contributor

bflad commented Aug 6, 2018

The new arn attribute for the resource and data source has been merged and will release with version 1.31.0 of the AWS provider later this week. 👍

@bflad
Copy link
Contributor

bflad commented Aug 9, 2018

This has been released in version 1.31.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 4, 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 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. good first issue Call to action for new contributors looking for a place to start. Smaller or straightforward issues. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants