Skip to content

Commit bfc1316

Browse files
author
Jerry Kindall
authored
docs: add some missing imports and update some property names in code examples in pipelines README (#9344)
Ran across some of these when preparing the How-To topic for the CDK Dev Guide; backporting to the README. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 419278b commit bfc1316

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

packages/@aws-cdk/pipelines/README.md

+16-4
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,24 @@ same, the *CDK Pipelines* library takes care of the details.
2727
will work, see the section **CDK Environment Bootstrapping** below).
2828

2929
```ts
30-
import { Construct, Stage } from '@aws-cdk/core';
30+
/** The stacks for our app are defined in my-stacks.ts. The internals of these
31+
* stacks aren't important, except that DatabaseStack exposes an attribute
32+
* "table" for a database table it defines, and ComputeStack accepts a reference
33+
* to this table in its properties.
34+
*/
35+
import { DatabaseStack, ComputeStack } from '../lib/my-stacks';
36+
37+
import { Construct, Stage, Stack, StackProps, StageProps } from '@aws-cdk/core';
38+
import { CdkPipeline } from '@aws-cdk/pipelines';
39+
import * as codepipeline from '@aws-cdk/aws-codepipeline';
3140

3241
/**
3342
* Your application
3443
*
35-
* May consist of one or more Stacks
44+
* May consist of one or more Stacks (here, two)
45+
*
46+
* By declaring our DatabaseStack and our ComputeStack inside a Stage,
47+
* we make sure they are deployed together, or not at all.
3648
*/
3749
class MyApplication extends Stage {
3850
constructor(scope: Construct, id: string, props?: StageProps) {
@@ -292,7 +304,7 @@ In its simplest form, adding validation actions looks like this:
292304
const stage = pipeline.addApplicationStage(new MyApplication(/* ... */));
293305

294306
stage.addActions(new ShellScriptAction({
295-
name: 'MyValidation',
307+
actionName: 'MyValidation',
296308
commands: ['curl -Ssf https://my.webservice.com/'],
297309
// ... more configuration ...
298310
}));
@@ -403,7 +415,7 @@ const pipeline = new CdkPipeline(this, 'Pipeline', {
403415
});
404416

405417
const validationAction = new ShellScriptAction({
406-
name: 'TestUsingBuildArtifact',
418+
actionName: 'TestUsingBuildArtifact',
407419
additionalArtifacts: [integTestsArtifact],
408420
// 'test.js' was produced from 'test/test.ts' during the synth step
409421
commands: ['node ./test.js'],

0 commit comments

Comments
 (0)