Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export class BitBucketSourceAction extends Action {

// the action needs to write the output to the pipeline bucket
options.bucket.grantReadWrite(options.role);
options.bucket.grantPutAcl(options.role);

// if codeBuildCloneOutput is true,
// save the connectionArn in the Artifact instance
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, haveResourceLike } from '@aws-cdk/assert';
import { arrayWith, expect, haveResourceLike, objectLike } from '@aws-cdk/assert';
import * as codebuild from '@aws-cdk/aws-codebuild';
import * as codepipeline from '@aws-cdk/aws-codepipeline';
import { Stack } from '@aws-cdk/core';
Expand Down Expand Up @@ -82,7 +82,37 @@ nodeunitShim({

test.done();
},

'grant s3 putObjectACL to the following CodeBuild Project'(test: Test) {
const stack = new Stack();
createBitBucketAndCodeBuildPipeline(stack, {
codeBuildCloneOutput: true,
});
expect(stack).to(haveResourceLike('AWS::IAM::Policy', {
'PolicyDocument': {
'Statement': arrayWith(
objectLike({
'Action': 's3:PutObjectAcl',
'Effect': 'Allow',
'Resource': {
'Fn::Join': [
'',
[
{
'Fn::GetAtt': [
'PipelineArtifactsBucket22248F97',
'Arn',
],
},
'/*',
],
],
},
}),
),
},
}));
test.done();
},
'setting triggerOnPush=false reflects in the configuration'(test: Test) {
const stack = new Stack();

Expand Down