@@ -160,6 +160,84 @@ describe('Linux ARM build image', () => {
160
160
} ) ;
161
161
} ) ;
162
162
163
+ describe ( 'AMAZON_LINUX_2_STANDARD_3_0' , ( ) => {
164
+ test ( 'has type ARM_CONTAINER and default ComputeType LARGE' , ( ) => {
165
+ const stack = new cdk . Stack ( ) ;
166
+ new codebuild . PipelineProject ( stack , 'Project' , {
167
+ environment : {
168
+ buildImage : codebuild . LinuxArmBuildImage . AMAZON_LINUX_2_STANDARD_3_0 ,
169
+ } ,
170
+ } ) ;
171
+
172
+ Template . fromStack ( stack ) . hasResourceProperties ( 'AWS::CodeBuild::Project' , {
173
+ Environment : {
174
+ Type : 'ARM_CONTAINER' ,
175
+ ComputeType : 'BUILD_GENERAL1_LARGE' ,
176
+ } ,
177
+ } ) ;
178
+ } ) ;
179
+
180
+ test ( 'can be used with ComputeType SMALL' , ( ) => {
181
+ const stack = new cdk . Stack ( ) ;
182
+ new codebuild . PipelineProject ( stack , 'Project' , {
183
+ environment : {
184
+ computeType : codebuild . ComputeType . SMALL ,
185
+ buildImage : codebuild . LinuxArmBuildImage . AMAZON_LINUX_2_STANDARD_3_0 ,
186
+ } ,
187
+ } ) ;
188
+
189
+ Template . fromStack ( stack ) . hasResourceProperties ( 'AWS::CodeBuild::Project' , {
190
+ Environment : {
191
+ Type : 'ARM_CONTAINER' ,
192
+ ComputeType : 'BUILD_GENERAL1_SMALL' ,
193
+ } ,
194
+ } ) ;
195
+ } ) ;
196
+
197
+ test ( 'cannot be used in conjunction with ComputeType MEDIUM' , ( ) => {
198
+ const stack = new cdk . Stack ( ) ;
199
+
200
+ expect ( ( ) => {
201
+ new codebuild . PipelineProject ( stack , 'Project' , {
202
+ environment : {
203
+ buildImage : codebuild . LinuxArmBuildImage . AMAZON_LINUX_2_STANDARD_3_0 ,
204
+ computeType : codebuild . ComputeType . MEDIUM ,
205
+ } ,
206
+ } ) ;
207
+ } ) . toThrow ( / A R M i m a g e s o n l y s u p p o r t C o m p u t e T y p e s ' B U I L D _ G E N E R A L 1 _ S M A L L ' a n d ' B U I L D _ G E N E R A L 1 _ L A R G E ' - ' B U I L D _ G E N E R A L 1 _ M E D I U M ' w a s g i v e n / ) ;
208
+ } ) ;
209
+
210
+ test ( 'can be used with ComputeType LARGE' , ( ) => {
211
+ const stack = new cdk . Stack ( ) ;
212
+ new codebuild . PipelineProject ( stack , 'Project' , {
213
+ environment : {
214
+ computeType : codebuild . ComputeType . LARGE ,
215
+ buildImage : codebuild . LinuxArmBuildImage . AMAZON_LINUX_2_STANDARD_3_0 ,
216
+ } ,
217
+ } ) ;
218
+
219
+ Template . fromStack ( stack ) . hasResourceProperties ( 'AWS::CodeBuild::Project' , {
220
+ Environment : {
221
+ Type : 'ARM_CONTAINER' ,
222
+ ComputeType : 'BUILD_GENERAL1_LARGE' ,
223
+ } ,
224
+ } ) ;
225
+ } ) ;
226
+
227
+ test ( 'cannot be used in conjunction with ComputeType X2_LARGE' , ( ) => {
228
+ const stack = new cdk . Stack ( ) ;
229
+
230
+ expect ( ( ) => {
231
+ new codebuild . PipelineProject ( stack , 'Project' , {
232
+ environment : {
233
+ buildImage : codebuild . LinuxArmBuildImage . AMAZON_LINUX_2_STANDARD_3_0 ,
234
+ computeType : codebuild . ComputeType . X2_LARGE ,
235
+ } ,
236
+ } ) ;
237
+ } ) . toThrow ( / A R M i m a g e s o n l y s u p p o r t C o m p u t e T y p e s ' B U I L D _ G E N E R A L 1 _ S M A L L ' a n d ' B U I L D _ G E N E R A L 1 _ L A R G E ' - ' B U I L D _ G E N E R A L 1 _ 2 X L A R G E ' w a s g i v e n / ) ;
238
+ } ) ;
239
+ } ) ;
240
+
163
241
describe ( 'ECR Repository' , ( ) => {
164
242
test ( 'allows creating a build image from a new ECR repository' , ( ) => {
165
243
const stack = new cdk . Stack ( ) ;
0 commit comments