Class RepositoryBase

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.ecr.RepositoryBase
All Implemented Interfaces:
IResource, IRepository, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable
Direct Known Subclasses:
Repository

@Generated(value="jsii-pacmak/1.99.0 (build 8f757e4)", date="2024-06-13T18:49:18.057Z") @Stability(Stable) public abstract class RepositoryBase extends Resource implements IRepository
Base class for ECR repository.

Reused between imported repositories and owned repositories.

  • Constructor Details

    • RepositoryBase

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

      protected RepositoryBase(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • RepositoryBase

      @Stability(Stable) protected RepositoryBase(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable ResourceProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props -
    • RepositoryBase

      @Stability(Stable) protected RepositoryBase(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details

    • addToResourcePolicy

      @Stability(Stable) @NotNull public abstract AddToResourcePolicyResult addToResourcePolicy(@NotNull PolicyStatement statement)
      Add a policy statement to the repository's resource policy.

      Specified by:
      addToResourcePolicy in interface IRepository
      Parameters:
      statement - This parameter is required.
    • grant

      @Stability(Stable) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull @NotNull String... actions)
      Grant the given principal identity permissions to perform the actions on this repository.

      Specified by:
      grant in interface IRepository
      Parameters:
      grantee - This parameter is required.
      actions - This parameter is required.
    • grantPull

      @Stability(Stable) @NotNull public Grant grantPull(@NotNull IGrantable grantee)
      Grant the given identity permissions to use the images in this repository.

      Specified by:
      grantPull in interface IRepository
      Parameters:
      grantee - This parameter is required.
    • grantPullPush

      @Stability(Stable) @NotNull public Grant grantPullPush(@NotNull IGrantable grantee)
      Grant the given identity permissions to pull and push images to this repository.

      Specified by:
      grantPullPush in interface IRepository
      Parameters:
      grantee - This parameter is required.
    • grantPush

      @Stability(Stable) @NotNull public Grant grantPush(@NotNull IGrantable grantee)
      Grant the given identity permissions to use the images in this repository.

      Specified by:
      grantPush in interface IRepository
      Parameters:
      grantee - This parameter is required.
    • grantRead

      @Stability(Stable) @NotNull public Grant grantRead(@NotNull IGrantable grantee)
      Grant the given identity permissions to read the images in this repository.

      Specified by:
      grantRead in interface IRepository
      Parameters:
      grantee - This parameter is required.
    • onCloudTrailEvent

      @Stability(Stable) @NotNull public Rule onCloudTrailEvent(@NotNull String id, @Nullable OnEventOptions options)
      Define a CloudWatch event that triggers when something happens to this repository.

      Requires that there exists at least one CloudTrail Trail in your account that captures the event. This method will not create the Trail.

      Specified by:
      onCloudTrailEvent in interface IRepository
      Parameters:
      id - The id of the rule. This parameter is required.
      options - Options for adding the rule.
    • onCloudTrailEvent

      @Stability(Stable) @NotNull public Rule onCloudTrailEvent(@NotNull String id)
      Define a CloudWatch event that triggers when something happens to this repository.

      Requires that there exists at least one CloudTrail Trail in your account that captures the event. This method will not create the Trail.

      Specified by:
      onCloudTrailEvent in interface IRepository
      Parameters:
      id - The id of the rule. This parameter is required.
    • onCloudTrailImagePushed

      @Stability(Stable) @NotNull public Rule onCloudTrailImagePushed(@NotNull String id, @Nullable OnCloudTrailImagePushedOptions options)
      Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository.

      Requires that there exists at least one CloudTrail Trail in your account that captures the event. This method will not create the Trail.

      Specified by:
      onCloudTrailImagePushed in interface IRepository
      Parameters:
      id - The id of the rule. This parameter is required.
      options - Options for adding the rule.
    • onCloudTrailImagePushed

      @Stability(Stable) @NotNull public Rule onCloudTrailImagePushed(@NotNull String id)
      Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository.

      Requires that there exists at least one CloudTrail Trail in your account that captures the event. This method will not create the Trail.

      Specified by:
      onCloudTrailImagePushed in interface IRepository
      Parameters:
      id - The id of the rule. This parameter is required.
    • onEvent

      @Stability(Stable) @NotNull public Rule onEvent(@NotNull String id, @Nullable OnEventOptions options)
      Defines a CloudWatch event rule which triggers for repository events.

      Use rule.addEventPattern(pattern) to specify a filter.

      Specified by:
      onEvent in interface IRepository
      Parameters:
      id - This parameter is required.
      options -
    • onEvent

      @Stability(Stable) @NotNull public Rule onEvent(@NotNull String id)
      Defines a CloudWatch event rule which triggers for repository events.

      Use rule.addEventPattern(pattern) to specify a filter.

      Specified by:
      onEvent in interface IRepository
      Parameters:
      id - This parameter is required.
    • onImageScanCompleted

      @Stability(Stable) @NotNull public Rule onImageScanCompleted(@NotNull String id, @Nullable OnImageScanCompletedOptions options)
      Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.

      Specified by:
      onImageScanCompleted in interface IRepository
      Parameters:
      id - The id of the rule. This parameter is required.
      options - Options for adding the rule.
    • onImageScanCompleted

      @Stability(Stable) @NotNull public Rule onImageScanCompleted(@NotNull String id)
      Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.

      Specified by:
      onImageScanCompleted in interface IRepository
      Parameters:
      id - The id of the rule. This parameter is required.
    • repositoryUriForDigest

      @Stability(Stable) @NotNull public String repositoryUriForDigest(@Nullable String digest)
      Returns the URL of the repository. Can be used in docker push/pull.

      ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]

      Specified by:
      repositoryUriForDigest in interface IRepository
      Parameters:
      digest - Optional image digest.
    • repositoryUriForDigest

      @Stability(Stable) @NotNull public String repositoryUriForDigest()
      Returns the URL of the repository. Can be used in docker push/pull.

      ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]

      Specified by:
      repositoryUriForDigest in interface IRepository
    • repositoryUriForTag

      @Stability(Stable) @NotNull public String repositoryUriForTag(@Nullable String tag)
      Returns the URL of the repository. Can be used in docker push/pull.

      ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]

      Specified by:
      repositoryUriForTag in interface IRepository
      Parameters:
      tag - Optional image tag.
    • repositoryUriForTag

      @Stability(Stable) @NotNull public String repositoryUriForTag()
      Returns the URL of the repository. Can be used in docker push/pull.

      ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]

      Specified by:
      repositoryUriForTag in interface IRepository
    • repositoryUriForTagOrDigest

      @Stability(Stable) @NotNull public String repositoryUriForTagOrDigest(@Nullable String tagOrDigest)
      Returns the URL of the repository. Can be used in docker push/pull.

      ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG] ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]

      Specified by:
      repositoryUriForTagOrDigest in interface IRepository
      Parameters:
      tagOrDigest - Optional image tag or digest (digests must start with sha256:).
    • repositoryUriForTagOrDigest

      @Stability(Stable) @NotNull public String repositoryUriForTagOrDigest()
      Returns the URL of the repository. Can be used in docker push/pull.

      ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG] ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]

      Specified by:
      repositoryUriForTagOrDigest in interface IRepository
    • getRepositoryArn

      @Stability(Stable) @NotNull public abstract String getRepositoryArn()
      The ARN of the repository.
      Specified by:
      getRepositoryArn in interface IRepository
    • getRepositoryName

      @Stability(Stable) @NotNull public abstract String getRepositoryName()
      The name of the repository.
      Specified by:
      getRepositoryName in interface IRepository
    • getRepositoryUri

      @Stability(Stable) @NotNull public String getRepositoryUri()
      The URI of this repository (represents the latest image):.

      ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY

      Specified by:
      getRepositoryUri in interface IRepository