-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
[WIP]: provider/aws: Add aws_availability_zones data source #6671
Conversation
Official OpenStack clients commonly support specifing a client certificate/key to enable SSL client authentication when communicating with OpenStack services. This patch enables such feature in Terraform with new parameters and environment variables: * 'cert' provider parameter or OS_CERT env variable to specify client certificate file, * 'key' provider parameter or OS_KEY env variable to specify client certificate private key file.
@jen20 my thought was that to start we'd mainly focus on data sources that return single objects... so However, this one I think makes sense because ultimately it's just a list of strings, which Terraform is pretty good at dealing with. And so calling it I was planning to build out |
Provides a list of availability zones which can be used by an AWS account | ||
--- | ||
|
||
# aws\_availability_zones |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this second underscore also need to be escaped, or will Markdown ignore it because there's an odd number of them? (In other files I've seen all the underscores escaped and have been following that pattern, but not sure if that's actually necessary...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably. I hate markdown ;-)
Looks good to me, minor inline niggles aside. 🎺 |
Computed: true, | ||
Elem: &schema.Schema{Type: schema.TypeString}, | ||
Set: schema.HashString, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly doesn't have to be in the first version of this data source, but I was thinking that when mapping Describe*
calls onto data sources we'd map each of the filters onto an Optional
attribute and then include them in the call.
In this case, that could be attributes regions
, which would be a list of regions to constrain to, and states
, allowing to filter by state.
So then I'd use it something like this:
data "aws_availability_zones" "us" {
regions = ["us-west-1", "us-west-2", "us-east-1"]
states = ["available", "information", "impaired"] # don't include "unavailable" AZs
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@apparentlymart I'm not sure that I see the value in this case, since the configured provider will determine which region is valid for use? In general though, I agree with this.
provider/openstack: Support client certificates
provider/openstack: Reassociate FIP on network changes
Don't assume dev platform was built
Data-driven Terraform Configuration
This commit adds a data source with a single set, `available` for the schema which gets populated with the availability zones to which an account has access.
40968e8
to
ad69168
Compare
I have no idea why the diff is so screwed up here - I thought I had rebased onto origin/master. I'll close this one and open a new PR for this soon. |
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. |
This PR adds a data source with a single set,
available
for the schema which gets populated with the availability zones to which an account has access.I implemented it as part of the review process of data sources so thought I would open an additional PR for feedback from @apparentlymart about this implementation.
One area we need to consider is nomenclature (cc @phinze, @catsby, @mitchellh) - many of these sources will return lists, and we should take care to keep naming arity consistent - I am expecting the actual names here to change when we make that decision.
TODO: Acceptance test.