Class MacBuildImage

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.codebuild.MacBuildImage
All Implemented Interfaces:
IBuildImage, software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-15T10:24:56.402Z") @Stability(Stable) public class MacBuildImage extends software.amazon.jsii.JsiiObject implements IBuildImage
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 software.amazon.awscdk.*;
 import software.amazon.awscdk.services.codebuild.*;
 import software.amazon.awscdk.services.ecr.assets.*;
 NetworkMode networkMode;
 Platform platform;
 IBuildImage macBuildImage = MacBuildImage.fromAsset(this, "MyMacBuildImage", DockerImageAssetProps.builder()
         .directory("directory")
         // the properties below are optional
         .assetName("assetName")
         .buildArgs(Map.of(
                 "buildArgsKey", "buildArgs"))
         .buildSecrets(Map.of(
                 "buildSecretsKey", "buildSecrets"))
         .buildSsh("buildSsh")
         .cacheDisabled(false)
         .cacheFrom(List.of(DockerCacheOption.builder()
                 .type("type")
                 // the properties below are optional
                 .params(Map.of(
                         "paramsKey", "params"))
                 .build()))
         .cacheTo(DockerCacheOption.builder()
                 .type("type")
                 // the properties below are optional
                 .params(Map.of(
                         "paramsKey", "params"))
                 .build())
         .exclude(List.of("exclude"))
         .extraHash("extraHash")
         .file("file")
         .followSymlinks(SymlinkFollowMode.NEVER)
         .ignoreMode(IgnoreMode.GLOB)
         .invalidation(DockerImageAssetInvalidationOptions.builder()
                 .buildArgs(false)
                 .buildSecrets(false)
                 .buildSsh(false)
                 .extraHash(false)
                 .file(false)
                 .networkMode(false)
                 .outputs(false)
                 .platform(false)
                 .repositoryName(false)
                 .target(false)
                 .build())
         .networkMode(networkMode)
         .outputs(List.of("outputs"))
         .platform(platform)
         .target("target")
         .build());
 

See Also:
  • Field Details

    • BASE_14

      @Stability(Stable) public static final IBuildImage BASE_14
      Corresponds to the standard CodeBuild image aws/codebuild/macos-arm-base:14.
  • Constructor Details

    • MacBuildImage

      protected MacBuildImage(software.amazon.jsii.JsiiObjectRef objRef)
    • MacBuildImage

      protected MacBuildImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • fromAsset

      @Stability(Stable) @NotNull public static IBuildImage fromAsset(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DockerImageAssetProps props)
      Uses an Docker image asset as a ARM MacOS build image.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
    • fromDockerRegistry

      @Stability(Stable) @NotNull public static IBuildImage fromDockerRegistry(@NotNull String name, @Nullable DockerImageOptions options)
      Makes an ARM MacOS build image from a Docker Hub image.

      Parameters:
      name - This parameter is required.
      options -
    • fromDockerRegistry

      @Stability(Stable) @NotNull public static IBuildImage fromDockerRegistry(@NotNull String name)
      Makes an ARM MacOS build image from a Docker Hub image.

      Parameters:
      name - This parameter is required.
    • fromEcrRepository

      @Stability(Stable) @NotNull public static IBuildImage fromEcrRepository(@NotNull IRepository repository, @Nullable String tagOrDigest)
      Makes an ARM MacOS build image from an ECR repository.

      Parameters:
      repository - This parameter is required.
      tagOrDigest -
    • fromEcrRepository

      @Stability(Stable) @NotNull public static IBuildImage fromEcrRepository(@NotNull IRepository repository)
      Makes an ARM MacOS build image from an ECR repository.

      Parameters:
      repository - This parameter is required.
    • runScriptBuildspec

      @Stability(Stable) @NotNull public BuildSpec runScriptBuildspec(@NotNull String entrypoint)
      Make a buildspec to run the indicated script.

      Specified by:
      runScriptBuildspec in interface IBuildImage
      Parameters:
      entrypoint - This parameter is required.
    • validate

      @Stability(Stable) @NotNull public List<String> validate(@NotNull BuildEnvironment buildEnvironment)
      Allows the image a chance to validate whether the passed configuration is correct.

      Specified by:
      validate in interface IBuildImage
      Parameters:
      buildEnvironment - This parameter is required.
    • getDefaultComputeType

      @Stability(Stable) @NotNull public ComputeType getDefaultComputeType()
      The default ComputeType to use with this image, if one was not specified in BuildEnvironment#computeType explicitly.
      Specified by:
      getDefaultComputeType in interface IBuildImage
    • getImageId

      @Stability(Stable) @NotNull public String getImageId()
      The Docker image identifier that the build environment uses.
      Specified by:
      getImageId in interface IBuildImage
      See Also:
    • getType

      @Stability(Stable) @NotNull public String getType()
      The type of build environment.
      Specified by:
      getType in interface IBuildImage
    • getImagePullPrincipalType

      @Stability(Stable) @Nullable public ImagePullPrincipalType getImagePullPrincipalType()
      The type of principal that CodeBuild will use to pull this build Docker image.
      Specified by:
      getImagePullPrincipalType in interface IBuildImage
    • getRepository

      @Stability(Stable) @Nullable public IRepository getRepository()
      An optional ECR repository that the image is hosted in.
      Specified by:
      getRepository in interface IBuildImage
    • getSecretsManagerCredentials

      @Stability(Stable) @Nullable public ISecret getSecretsManagerCredentials()
      The secretsManagerCredentials for access to a private registry.
      Specified by:
      getSecretsManagerCredentials in interface IBuildImage