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

Make Vpc's asynchronous, and remove all usages of deasync library. #470

Merged
merged 242 commits into from
Dec 21, 2019

Conversation

CyrusNajmabadi
Copy link
Contributor

@CyrusNajmabadi CyrusNajmabadi commented Dec 12, 2019

This should be reviewed with whitespace changes off.

Due the necessity to perform many async operations during creation, many parts of an
[awsx.ec2.Vpc] have become asynchronous. This is encoded using the normal Output<awsx.ec2.Vpc>
type. However, for convenience, many parts are also available as Promises, making it easy to use
from async code. Specifically:

  1. awsx.ec2.Vpc.vpc has changed from an aws.ec2.Vpc to an Output<aws.ec2.Vpc>.
  2. The properties and methods exposed off of awsx.ec2.Vpc (like publicSubnetIds) are now
    async (i.e. Promise<Output<string>[]>).

These changes should not impact most code. Code that creates and passes around a Vpc or accesses
properties off of the Vpc should continue to work. If there is code that needs to access the raw
values (for example, to iterate over the subnets of a Vpc) that can be written like so:

const vpc = new awsx.ec2.Vpc(...);
const ids = await vpc.publicSubnetIds;
for (const id of ids) {
    ...
}

@@ -10,6 +10,7 @@ TESTPARALLELISM := 10

build::
yarn install
tsc --version
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was helpful when tracking down some issues. i'd like to keep it.

@CyrusNajmabadi CyrusNajmabadi merged commit b515c09 into master Dec 21, 2019
@pulumi-bot pulumi-bot deleted the features/dedeasync6 branch December 21, 2019 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants