Skip to content

Commit

Permalink
Merge
Browse files Browse the repository at this point in the history
  • Loading branch information
spg committed Jun 21, 2019
2 parents a0c71e6 + 9101161 commit 6c10cec
Show file tree
Hide file tree
Showing 581 changed files with 8,124 additions and 5,512 deletions.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: New Issue
labels: needs-triage
---

**Note: for support questions, please first reference our [documentation](https://docs.aws.amazon.com/cdk/api/latest), then use [Stackoverflow](https://stackoverflow.com/questions/ask?tags=aws-cdk)**. This repository's issues are intended for feature requests and bug reports.

* **I'm submitting a ...**
- [ ] :beetle: bug report
- [ ] :rocket: feature request
- [ ] :books: construct library gap
- [ ] :phone: security issue or vulnerability => Please see [policy](https://github.com/awslabs/aws-cdk/security/policy)
- [ ] :question: support request => Please see note at the top of this template.


* **What is the current behavior?**
*If the current behavior is a :beetle:bug:beetle:: Please provide the steps to reproduce*



* **What is the expected behavior (or behavior of feature suggested)?**



* **What is the motivation / use case for changing the behavior or adding this feature?**



* **Please tell us about your environment:**

- CDK CLI Version: xx.xx.xx
- Module Version: xx.xx.xx
- OS: [all | Windows 10 | OSX Mojave | Ubuntu | etc... ]
- Language: [all | TypeScript | Java | Python ]


* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)

22 changes: 0 additions & 22 deletions .github/ISSUE_TEMPLATE/bug_report.md

This file was deleted.

10 changes: 0 additions & 10 deletions .github/ISSUE_TEMPLATE/feature_request.md

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions .github/ISSUE_TEMPLATE/request-sample-or-ask-a-question.md

This file was deleted.

1 change: 1 addition & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
AWS Cloud Development Kit (AWS CDK)
Copyright 2018-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.

Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ export interface PipelineDeployStackActionProps {
* information
*
* @see https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#using-iam-capabilities
* @default AnonymousIAM, unless `adminPermissions` is true
* @default [AnonymousIAM, AutoExpand], unless `adminPermissions` is true
*/
readonly capabilities?: cfn.CloudFormationCapabilities;
readonly capabilities?: cfn.CloudFormationCapabilities[];

/**
* Whether to grant admin permissions to CloudFormation while deploying this template.
Expand Down Expand Up @@ -166,13 +166,13 @@ export class PipelineDeployStackAction extends cdk.Construct {
}
}

function cfnCapabilities(adminPermissions: boolean, capabilities?: cfn.CloudFormationCapabilities): cfn.CloudFormationCapabilities {
function cfnCapabilities(adminPermissions: boolean, capabilities?: cfn.CloudFormationCapabilities[]): cfn.CloudFormationCapabilities[] {
if (adminPermissions && capabilities === undefined) {
// admin true default capability to NamedIAM
return cfn.CloudFormationCapabilities.NamedIAM;
// admin true default capability to NamedIAM and AutoExpand
return [cfn.CloudFormationCapabilities.NamedIAM, cfn.CloudFormationCapabilities.AutoExpand];
} else if (capabilities === undefined) {
// else capabilities are undefined set AnonymousIAM
return cfn.CloudFormationCapabilities.AnonymousIAM;
// else capabilities are undefined set AnonymousIAM and AutoExpand
return [cfn.CloudFormationCapabilities.AnonymousIAM, cfn.CloudFormationCapabilities.AutoExpand];
} else {
// else capabilities are defined use them
return capabilities;
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/app-delivery/test/integ.cicd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ new cicd.PipelineDeployStackAction(stack, 'DeployStack', {
executeChangeSetRunOrder: 999,
input: sourceOutput,
adminPermissions: false,
capabilities: cfn.CloudFormationCapabilities.None,
capabilities: [cfn.CloudFormationCapabilities.None],
});

app.synth();
Original file line number Diff line number Diff line change
Expand Up @@ -86,32 +86,55 @@ export = nodeunit.testCase({
const stackWithAnonymousCapability = new cdk.Stack(undefined, 'AnonymousIAM',
{ env: { account: '123456789012', region: 'us-east-1' } });

const stackWithAutoExpandCapability = new cdk.Stack(undefined, 'AutoExpand',
{ env: { account: '123456789012', region: 'us-east-1' } });

const stackWithAnonymousAndAutoExpandCapability = new cdk.Stack(undefined, 'AnonymousIAMAndAutoExpand',
{ env: { account: '123456789012', region: 'us-east-1' } });

const selfUpdatingStack = createSelfUpdatingStack(pipelineStack);

const pipeline = selfUpdatingStack.pipeline;

const selfUpdateStage1 = pipeline.addStage({ stageName: 'SelfUpdate1' });
const selfUpdateStage2 = pipeline.addStage({ stageName: 'SelfUpdate2' });
const selfUpdateStage3 = pipeline.addStage({ stageName: 'SelfUpdate3' });
const selfUpdateStage4 = pipeline.addStage({ stageName: 'SelfUpdate4' });
const selfUpdateStage5 = pipeline.addStage({ stageName: 'SelfUpdate5' });

new PipelineDeployStackAction(pipelineStack, 'SelfUpdatePipeline', {
stage: selfUpdateStage1,
stack: pipelineStack,
input: selfUpdatingStack.synthesizedApp,
capabilities: cfn.CloudFormationCapabilities.NamedIAM,
capabilities: [cfn.CloudFormationCapabilities.NamedIAM],
adminPermissions: false,
});
new PipelineDeployStackAction(pipelineStack, 'DeployStack', {
stage: selfUpdateStage2,
stack: stackWithNoCapability,
input: selfUpdatingStack.synthesizedApp,
capabilities: cfn.CloudFormationCapabilities.None,
capabilities: [cfn.CloudFormationCapabilities.None],
adminPermissions: false,
});
new PipelineDeployStackAction(pipelineStack, 'DeployStack2', {
stage: selfUpdateStage3,
stack: stackWithAnonymousCapability,
input: selfUpdatingStack.synthesizedApp,
capabilities: cfn.CloudFormationCapabilities.AnonymousIAM,
capabilities: [cfn.CloudFormationCapabilities.AnonymousIAM],
adminPermissions: false,
});
new PipelineDeployStackAction(pipelineStack, 'DeployStack3', {
stage: selfUpdateStage4,
stack: stackWithAutoExpandCapability,
input: selfUpdatingStack.synthesizedApp,
capabilities: [cfn.CloudFormationCapabilities.AutoExpand],
adminPermissions: false,
});
new PipelineDeployStackAction(pipelineStack, 'DeployStack4', {
stage: selfUpdateStage5,
stack: stackWithAnonymousAndAutoExpandCapability,
input: selfUpdatingStack.synthesizedApp,
capabilities: [cfn.CloudFormationCapabilities.AnonymousIAM, cfn.CloudFormationCapabilities.AutoExpand],
adminPermissions: false,
});
expect(pipelineStack).to(haveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({
Expand Down Expand Up @@ -148,6 +171,20 @@ export = nodeunit.testCase({
ActionMode: "CHANGE_SET_REPLACE",
}
})));
expect(pipelineStack).to(haveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({
Configuration: {
StackName: "AutoExpand",
ActionMode: "CHANGE_SET_REPLACE",
Capabilities: "CAPABILITY_AUTO_EXPAND",
}
})));
expect(pipelineStack).to(haveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({
Configuration: {
StackName: "AnonymousIAMAndAutoExpand",
ActionMode: "CHANGE_SET_REPLACE",
Capabilities: "CAPABILITY_IAM,CAPABILITY_AUTO_EXPAND",
}
})));
test.done();
},
'users can use admin permissions'(test: nodeunit.Test) {
Expand Down Expand Up @@ -178,7 +215,7 @@ export = nodeunit.testCase({
Configuration: {
StackName: "TestStack",
ActionMode: "CHANGE_SET_REPLACE",
Capabilities: "CAPABILITY_NAMED_IAM",
Capabilities: "CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND",
}
})));
test.done();
Expand Down Expand Up @@ -307,7 +344,7 @@ class FakeAction extends codepipeline.Action {
super({
actionName,
artifactBounds: { minInputs: 0, maxInputs: 5, minOutputs: 0, maxOutputs: 5 },
category: codepipeline.ActionCategory.Test,
category: codepipeline.ActionCategory.TEST,
provider: 'Test',
});

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/assert/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 0 additions & 17 deletions packages/@aws-cdk/assets-docker/.gitignore

This file was deleted.

Loading

0 comments on commit 6c10cec

Please sign in to comment.