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

Create a "How-To Get the Availability Zones in a Region" section in the docs #356

Closed
Doug-AWS opened this issue Jul 17, 2018 · 4 comments
Closed
Labels
guidance Question that needs advice or information. p1

Comments

@Doug-AWS
Copy link
Contributor

No description provided.

@Doug-AWS
Copy link
Contributor Author

Here is what I have so far:

You can get the AZs in the current region by using the
::py:class:_aws-cdk_core.AvailabilityZoneProvider class,
as shown in the following example.

.. code-block:: js

const zones: string[] = new AvailabilityZoneProvider(this).availabilityZones;

for (let zone of zones) {
// do somethning for each zone!
}

@eladb
Copy link
Contributor

eladb commented Jul 18, 2018

Yes, looks right. I think we should add some more details (or reference) here on how contextual providers work.

Also, there's a nuance (pending #227): when this is executed outside of the context of a toolkit synthesis (i.e. in unit test), the provider returns dummy values. This is usually quite fine, but people should be aware and not surprised by this.

@Doug-AWS Doug-AWS added the p1 label Jul 19, 2018
@Doug-AWS
Copy link
Contributor Author

Doug-AWS commented Oct 9, 2018

Done. Since we already had this information in the Environmental Context topic, I re-used that content.

This info is in the "How-To: Get the List of Availibility Zones" section of cookbook.rst in the dougsch/addhowto branch. Once I've finished this round of how-to sections, I'll open a PR and add the PR # to this issue and close it.

@srchase srchase added guidance Question that needs advice or information. and removed how-to labels Jan 3, 2019
@Doug-AWS
Copy link
Contributor Author

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information. p1
Projects
None yet
Development

No branches or pull requests

3 participants