Skip to content

Commit

Permalink
chore: Update READMEs to reflect new cross-stack sharing mechanism (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
rix0rrr authored Jan 17, 2019
1 parent 882b8ff commit 6d0cdc7
Show file tree
Hide file tree
Showing 12 changed files with 794 additions and 102 deletions.
16 changes: 8 additions & 8 deletions packages/@aws-cdk/aws-certificatemanager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ const certificate = new Certificate(this, 'Certificate', {

### Importing

Import a certificate either manually, if you know the ARN:
Import a certificate manually, if you know the ARN:

```ts
const certificate = Certificate.import(this, 'Certificate', {
certificteArn: "arn:aws:..."
});
```

Or use exporting and importing mechanisms between stacks:
### Sharing between Stacks

```ts
const certRef = certStack.certificate.export();
To share the certificate between stacks in the same CDK application, simply
pass the `Certificate` object between the stacks.

const certificate = Certificate.import(this, 'Certificate', certRef);
```

> We should probably also make a Custom Resource that can looks up the certificate ARN
> by domain name by querying ACM.
## TODO

- [ ] Custom Resource that can looks up the certificate ARN by domain name by querying ACM.
- [ ] Custom Resource to automate certificate validation through Route53.
6 changes: 4 additions & 2 deletions packages/@aws-cdk/aws-ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,15 @@ The `VpcNetwork` above will have the exact same subnet definitions as listed
above. However, this time the VPC will have only 1 NAT Gateway and all
Application subnets will route to the NAT Gateway.

#### Sharing VPCs across stacks
#### Sharing VPCs between stacks

If you are creating multiple `Stack`s inside the same CDK application, you
can reuse a VPC defined in one Stack in another by using `export()` and
`import()`:

[sharing VPCs between stacks](test/example.share-vpcs.lit.ts)
[sharing VPCs between stacks](test/integ.share-vpcs.lit.ts)

#### Importing an existing VPC

If your VPC is created outside your CDK app, you can use `importFromContext()`:

Expand Down
Loading

0 comments on commit 6d0cdc7

Please sign in to comment.