class MacBuildImage
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CodeBuild.MacBuildImage |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awscodebuild#MacBuildImage |
Java | software.amazon.awscdk.services.codebuild.MacBuildImage |
Python | aws_cdk.aws_codebuild.MacBuildImage |
TypeScript (source) | aws-cdk-lib » aws_codebuild » MacBuildImage |
Implements
IBuild
A CodeBuild image running ARM MacOS.
This class has a bunch of public constants that represent the most popular images.
You can also specify a custom image using one of the static methods:
- MacBuildImage.fromDockerRegistry(image[, { secretsManagerCredentials }])
- MacBuildImage.fromEcrRepository(repo[, tag])
- MacBuildImage.fromAsset(parent, id, props)
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_codebuild as codebuild } from 'aws-cdk-lib';
import { aws_ecr_assets as ecr_assets } from 'aws-cdk-lib';
declare const networkMode: ecr_assets.NetworkMode;
declare const platform: ecr_assets.Platform;
const macBuildImage = codebuild.MacBuildImage.fromAsset(this, 'MyMacBuildImage', {
directory: 'directory',
// the properties below are optional
assetName: 'assetName',
buildArgs: {
buildArgsKey: 'buildArgs',
},
buildSecrets: {
buildSecretsKey: 'buildSecrets',
},
buildSsh: 'buildSsh',
cacheDisabled: false,
cacheFrom: [{
type: 'type',
// the properties below are optional
params: {
paramsKey: 'params',
},
}],
cacheTo: {
type: 'type',
// the properties below are optional
params: {
paramsKey: 'params',
},
},
exclude: ['exclude'],
extraHash: 'extraHash',
file: 'file',
followSymlinks: cdk.SymlinkFollowMode.NEVER,
ignoreMode: cdk.IgnoreMode.GLOB,
invalidation: {
buildArgs: false,
buildSecrets: false,
buildSsh: false,
extraHash: false,
file: false,
networkMode: false,
outputs: false,
platform: false,
repositoryName: false,
target: false,
},
networkMode: networkMode,
outputs: ['outputs'],
platform: platform,
target: 'target',
});
Properties
Name | Type | Description |
---|---|---|
default | Compute | The default ComputeType to use with this image, if one was not specified in BuildEnvironment#computeType explicitly. |
image | string | The Docker image identifier that the build environment uses. |
type | string | The type of build environment. |
image | Image | The type of principal that CodeBuild will use to pull this build Docker image. |
repository? | IRepository | An optional ECR repository that the image is hosted in. |
secrets | ISecret | The secretsManagerCredentials for access to a private registry. |
static BASE_14 | IBuild | Corresponds to the standard CodeBuild image aws/codebuild/macos-arm-base:14 . |
defaultComputeType
Type:
Compute
The default ComputeType
to use with this image, if one was not specified in BuildEnvironment#computeType
explicitly.
imageId
Type:
string
The Docker image identifier that the build environment uses.
type
Type:
string
The type of build environment.
imagePullPrincipalType?
Type:
Image
(optional)
The type of principal that CodeBuild will use to pull this build Docker image.
repository?
Type:
IRepository
(optional)
An optional ECR repository that the image is hosted in.
secretsManagerCredentials?
Type:
ISecret
(optional)
The secretsManagerCredentials for access to a private registry.
static BASE_14
Type:
IBuild
Corresponds to the standard CodeBuild image aws/codebuild/macos-arm-base:14
.
Methods
Name | Description |
---|---|
run | Make a buildspec to run the indicated script. |
validate(buildEnvironment) | Allows the image a chance to validate whether the passed configuration is correct. |
static from | Uses an Docker image asset as a ARM MacOS build image. |
static from | Makes an ARM MacOS build image from a Docker Hub image. |
static from | Makes an ARM MacOS build image from an ECR repository. |
ScriptBuildspec(entrypoint)
runpublic runScriptBuildspec(entrypoint: string): BuildSpec
Parameters
- entrypoint
string
Returns
Make a buildspec to run the indicated script.
validate(buildEnvironment)
public validate(buildEnvironment: BuildEnvironment): string[]
Parameters
- buildEnvironment
Build
Environment
Returns
string[]
Allows the image a chance to validate whether the passed configuration is correct.
Asset(scope, id, props)
static frompublic static fromAsset(scope: Construct, id: string, props: DockerImageAssetProps): IBuildImage
Parameters
- scope
Construct
- id
string
- props
Docker
Image Asset Props
Returns
Uses an Docker image asset as a ARM MacOS build image.
DockerRegistry(name, options?)
static frompublic static fromDockerRegistry(name: string, options?: DockerImageOptions): IBuildImage
Parameters
- name
string
- options
Docker
Image Options
Returns
Makes an ARM MacOS build image from a Docker Hub image.
EcrRepository(repository, tagOrDigest?)
static frompublic static fromEcrRepository(repository: IRepository, tagOrDigest?: string): IBuildImage
Parameters
- repository
IRepository
- tagOrDigest
string
Returns
Makes an ARM MacOS build image from an ECR repository.