File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
packages/@aws-cdk/aws-codebuild Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,14 @@ export interface S3ArtifactsProps extends ArtifactsProps {
113
113
* @default true - files will be archived
114
114
*/
115
115
readonly packageZip ?: boolean ;
116
+
117
+ /**
118
+ * If this is false, build output will not be encrypted.
119
+ * This is useful if the artifact to publish a static website or sharing content with others
120
+ *
121
+ * @default true - output will be encrypted
122
+ */
123
+ readonly encryption ?: boolean ;
116
124
}
117
125
118
126
/**
@@ -136,6 +144,7 @@ class S3Artifacts extends Artifacts {
136
144
namespaceType : this . props . includeBuildId === false ? 'NONE' : 'BUILD_ID' ,
137
145
name : this . props . name ,
138
146
packaging : this . props . packageZip === false ? 'NONE' : 'ZIP' ,
147
+ encryptionDisabled : this . props . encryption === false ? true : undefined ,
139
148
}
140
149
} ;
141
150
}
Original file line number Diff line number Diff line change @@ -933,6 +933,36 @@ export = {
933
933
934
934
test . done ( ) ;
935
935
} ,
936
+
937
+ 'disabledEncryption is set' ( test : Test ) {
938
+ const stack = new cdk . Stack ( ) ;
939
+ const bucket = new s3 . Bucket ( stack , 'MyBucket' ) ;
940
+ const project = new codebuild . Project ( stack , 'MyProject' , {
941
+ source : codebuild . Source . s3 ( {
942
+ bucket,
943
+ path : 'some/path' ,
944
+ } ) ,
945
+ } ) ;
946
+
947
+ project . addSecondaryArtifact ( codebuild . Artifacts . s3 ( {
948
+ bucket,
949
+ path : 'another/path' ,
950
+ name : 'name' ,
951
+ identifier : 'artifact1' ,
952
+ encryption : false ,
953
+ } ) ) ;
954
+
955
+ expect ( stack ) . to ( haveResourceLike ( 'AWS::CodeBuild::Project' , {
956
+ "SecondaryArtifacts" : [
957
+ {
958
+ "ArtifactIdentifier" : "artifact1" ,
959
+ "EncryptionDisabled" : true ,
960
+ } ,
961
+ ] ,
962
+ } ) ) ;
963
+
964
+ test . done ( ) ;
965
+ } ,
936
966
} ,
937
967
938
968
'artifacts' : {
You can’t perform that action at this time.
0 commit comments