Skip to content

Commit

Permalink
doc(app-delivery): update the documentation in the ReadMe. (#3111)
Browse files Browse the repository at this point in the history
After the changes introduced with the IAction interface.
  • Loading branch information
skinny85 authored Jun 27, 2019
1 parent f696efc commit 9a38109
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions packages/@aws-cdk/app-delivery/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import codebuild = require('@aws-cdk/aws-codebuild');
import codepipeline = require('@aws-cdk/aws-codepipeline');
import codepipeline_actions = require('@aws-cdk/aws-codepipeline-actions');
import cdk = require('@aws-cdk/core');
import cicd = require('@aws-cdk/cicd');
import cicd = require('@aws-cdk/app-delivery');

const app = new cdk.App();

Expand Down Expand Up @@ -101,42 +101,40 @@ pipeline.addStage({

// Optionally, self-update the pipeline stack
const selfUpdateStage = pipeline.addStage({ stageName: 'SelfUpdate' });
new cicd.PipelineDeployStackAction(pipelineStack, 'SelfUpdatePipeline', {
stage: selfUpdateStage,
selfUpdateStage.addAction(new cicd.PipelineDeployStackAction({
stack: pipelineStack,
input: synthesizedApp,
});
adminPermissions: true,
}));

// Now add our service stacks
const deployStage = pipeline.addStage({ stageName: 'Deploy' });
const serviceStackA = new MyServiceStackA(app, 'ServiceStackA', { /* ... */ });
// Add actions to deploy the stacks in the deploy stage:
const deployServiceAAction = new cicd.PipelineDeployStackAction(pipelineStack, 'DeployServiceStackA', {
stage: deployStage,
const deployServiceAAction = new cicd.PipelineDeployStackAction({
stack: serviceStackA,
input: synthesizedApp,
// See the note below for details about this option.
adminPermissions: false,
});
deployStage.addAction(deployServiceAAction);
// Add the necessary permissions for you service deploy action. This role is
// is passed to CloudFormation and needs the permissions necessary to deploy
// stack. Alternatively you can enable [Administrator](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_job-functions.html#jf_administrator) permissions above,
// users should understand the privileged nature of this role.
deployServiceAAction.addToRolePolicy(
new iam.PolicyStatement()
.addAction('service:SomeAction')
.addResource(myResource.myResourceArn)
deployServiceAAction.addToRolePolicy(new iam.PolicyStatement({
actions: ['service:SomeAction'],
resources: [myResource.myResourceArn],
// add more Action(s) and/or Resource(s) here, as needed
);
}));

const serviceStackB = new MyServiceStackB(app, 'ServiceStackB', { /* ... */ });
new cicd.PipelineDeployStackAction(pipelineStack, 'DeployServiceStackB', {
stage: deployStage,
deployStage.addAction(new cicd.PipelineDeployStackAction({
stack: serviceStackB,
input: synthesizedApp,
createChangeSetRunOrder: 998,
adminPermissions: true, // no need to modify the role with admin
});
}));
```

#### `buildspec.yml`
Expand Down

0 comments on commit 9a38109

Please sign in to comment.