aws cli how to set compute type for code build project?
AWS Console has limited options to pick from:
I want to use new arm CPUs:
How to set with aws CLI?
CodePudding user response:
The aws CLI answer:
aws codebuild update-project --name user-api-production --environment '{"type": "ARM_CONTAINER", "computeType": "BUILD_GENERAL1_SMALL", "image": "aws/codebuild/amazonlinux2-aarch64-standard:2.0"}'
CodePudding user response:
To use arm1.small
in codebuild, you need to set the instance to BUILD_GENERAL1_SMALL
(which is what you currently have selected in the console). In addition to this, you also need to set the environment type to ARM_CONTAINER
. The environment type is what determines if it's x86 Linux, Windows, or ARM Linux.
CodePudding user response:
AWS Console has limited options to pick from
Actually, the console has all the necessary options in order to pick ARM based images.
In order to use the ARM type compute types, you have to select a custom build image in CodeBuild:
This will allow to select ARM build environments. You also can chose between the compute and memory options in the additional configurations:
Now, if you selected a build image which is not managed by AWS, you will have to create you own Docker container used for build environment. AWS provides step-by-step instructions on how to do that: source.