-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(aws-codepipeline): Pipeline now accepts existing IAM role (#2587)
Fixes #2572.
- Loading branch information
1 parent
7cb8e5e
commit eb35807
Showing
2 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { expect, haveResourceLike } from '@aws-cdk/assert'; | ||
import iam = require('@aws-cdk/aws-iam'); | ||
import cdk = require('@aws-cdk/cdk'); | ||
import { Test } from 'nodeunit'; | ||
import codepipeline = require('../lib'); | ||
|
||
// tslint:disable:object-literal-key-quotes | ||
|
||
export = { | ||
'Pipeline': { | ||
'can be passed an IAM role during pipeline creation'(test: Test) { | ||
const stack = new cdk.Stack(); | ||
const role = new iam.Role(stack, 'Role', { | ||
assumedBy: new iam.ServicePrincipal('codepipeline.amazonaws.com') | ||
}); | ||
new codepipeline.Pipeline(stack, 'Pipeline', { | ||
role | ||
}); | ||
|
||
expect(stack, true).to(haveResourceLike('AWS::CodePipeline::Pipeline', { | ||
"RoleArn": { | ||
"Fn::GetAtt": [ | ||
"Role1ABCC5F0", | ||
"Arn", | ||
] | ||
} | ||
})); | ||
|
||
test.done(); | ||
}, | ||
}, | ||
}; |