Interface EcrBuildAndPublishActionProps

All Superinterfaces:
CommonActionProps, CommonAwsActionProps, software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
EcrBuildAndPublishActionProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.112.0 (build de1bc80)", date="2025-07-16T11:43:11.807Z") @Stability(Stable) public interface EcrBuildAndPublishActionProps extends software.amazon.jsii.JsiiSerializable, CommonAwsActionProps
Construction properties of the EcrBuildAndPublishAction.

Example:

 import software.amazon.awscdk.services.ecr.*;
 Pipeline pipeline;
 IRepository repository;
 Artifact sourceOutput = new Artifact();
 // your source repository
 CodeStarConnectionsSourceAction sourceAction = CodeStarConnectionsSourceAction.Builder.create()
         .actionName("CodeStarConnectionsSourceAction")
         .output(sourceOutput)
         .connectionArn("your-connection-arn")
         .owner("your-owner")
         .repo("your-repo")
         .build();
 EcrBuildAndPublishAction buildAction = EcrBuildAndPublishAction.Builder.create()
         .actionName("EcrBuildAndPublishAction")
         .repositoryName(repository.getRepositoryName())
         .registryType(RegistryType.PRIVATE)
         .dockerfileDirectoryPath("./my-dir") // The path indicates ./my-dir/Dockerfile in the source repository
         .imageTags(List.of("my-tag-1", "my-tag-2"))
         .input(sourceOutput)
         .build();
 pipeline.addStage(StageOptions.builder()
         .stageName("Source")
         .actions(List.of(sourceAction))
         .build());
 pipeline.addStage(StageOptions.builder()
         .stageName("Build")
         .actions(List.of(buildAction))
         .build());
 
  • Method Details

    • getInput

      @Stability(Stable) @NotNull Artifact getInput()
      The artifact produced by the source action that contains the Dockerfile needed to build the image.
    • getRepositoryName

      @Stability(Stable) @NotNull String getRepositoryName()
      The name of the ECR repository where the image is pushed.
    • getDockerfileDirectoryPath

      @Stability(Stable) @Nullable default String getDockerfileDirectoryPath()
      The directory path of Dockerfile used to build the image.

      Optionally, you can provide an alternate directory path if Dockerfile is not at the root level.

      Default: - the source repository root level

    • getImageTags

      @Stability(Stable) @Nullable default List<String> getImageTags()
      The tags used for the image.

      Default: - latest

    • getRegistryType

      @Stability(Stable) @Nullable default RegistryType getRegistryType()
      Specifies whether the repository is public or private.

      Default: - RegistryType.PRIVATE

    • builder

      @Stability(Stable) static EcrBuildAndPublishActionProps.Builder builder()
      Returns:
      a EcrBuildAndPublishActionProps.Builder of EcrBuildAndPublishActionProps