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

Access provider attributes #9221

Closed
joshuaspence opened this issue Oct 4, 2016 · 7 comments
Closed

Access provider attributes #9221

joshuaspence opened this issue Oct 4, 2016 · 7 comments
Labels
enhancement provider/aws waiting-response An issue/pull request is waiting for a response from the community

Comments

@joshuaspence
Copy link
Contributor

Is it possible to access output attributes for a provider? I have made an ec2_ondemand_price module which looks up the current EC2 on-demand price for a given region and instance type. We use this module to set our spot prices equal to the on demand price. The problem I have at the moment is that my ec2_ondemand_price module needs to know the AWS region, but it should be able to query this from the provider rather than needing to be passed in as a variable.

@joshuaspence
Copy link
Contributor Author

An alternative to being able to access provider attributes would be an aws_region data source, I suppose.

@joshuaspence
Copy link
Contributor Author

Given that we currently do this, #5480 would be another solution to my problem.

provider "aws" {
  region = "${var.region}"
}

@apparentlymart
Copy link
Contributor

Hi @joshuaspence!

The patch I've been working on over in #6819 has a potential solution to this, which would work as follows:

data "aws_region" "current" {
  current = true
}

@joshuaspence
Copy link
Contributor Author

Thanks for the pointer

@stack72
Copy link
Contributor

stack72 commented Oct 31, 2016

Hi @joshuaspence

Does #6819 solve your issue?

Paul

@stack72 stack72 added the waiting-response An issue/pull request is waiting for a response from the community label Oct 31, 2016
@joshuaspence
Copy link
Contributor Author

Yes, it does. Thanks!

@ghost
Copy link

ghost commented Apr 20, 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 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement provider/aws waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

No branches or pull requests

3 participants