Skip to content

Commit

Permalink
Small ReadMe corrections.
Browse files Browse the repository at this point in the history
  • Loading branch information
skinny85 committed Sep 4, 2020
1 parent a72e162 commit ca660e2
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions packages/@aws-cdk/cloudformation-include/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ param.default = 'MyDefault';
You can also provide values for them when including the template:

```typescript
new inc.CfnInclude(stack, 'includeTemplate', {
templateFile: 'path/to/my/template'
new inc.CfnInclude(this, 'includeTemplate', {
templateFile: 'path/to/my/template',
parameters: {
'MyParam': 'my-value',
},
Expand Down Expand Up @@ -229,7 +229,7 @@ import * as core from '@aws-cdk/core';
const hook: core.CfnHook = cfnTemplate.getHook('MyOutput');
```

The `CfnHook` can be mutated,
The `CfnHook` object can be mutated,
and any changes you make to it will be reflected in the resulting template:

```typescript
Expand Down Expand Up @@ -268,10 +268,11 @@ where the child template pointed to by `https://my-s3-template-source.s3.amazona
}
```

You can include both the parent stack and the nested stack in your CDK application as follows:
You can include both the parent stack,
and the nested stack in your CDK application as follows:

```typescript
const parentTemplate = new inc.CfnInclude(stack, 'ParentStack', {
const parentTemplate = new inc.CfnInclude(this, 'ParentStack', {
templateFile: 'path/to/my-parent-template.json',
nestedStacks: {
'ChildStack': {
Expand All @@ -289,7 +290,8 @@ const childStack: core.NestedStack = includedChildStack.stack;
const childTemplate: cfn_inc.CfnInclude = includedChildStack.includedTemplate;
```

Now you can reference resources from `ChildStack` and modify them like any other included template:
Now you can reference resources from `ChildStack`,
and modify them like any other included template:

```typescript
const cfnBucket = childTemplate.getResource('MyBucket') as s3.CfnBucket;
Expand All @@ -314,7 +316,7 @@ role.addToPolicy(new iam.PolicyStatement({
In many cases, there are existing CloudFormation templates that are not entire applications,
but more like specialized fragments, implementing a particular pattern or best practice.
If you have templates like that,
you can use the `CfnInclude` class to vend them as a CDK Constructs:
you can use the `CfnInclude` class to vend them as CDK Constructs:

```ts
import * as path from 'path';
Expand Down

0 comments on commit ca660e2

Please sign in to comment.