Interface IRepository

All Superinterfaces:
software.constructs.IConstruct, software.constructs.IDependable, IResource, software.amazon.jsii.JsiiSerializable
All Known Subinterfaces:
IRepository.Jsii$Default
All Known Implementing Classes:
IRepository.Jsii$Proxy, Repository, RepositoryBase

@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)", date="2024-10-05T03:43:42.485Z") @Stability(Stable) public interface IRepository extends software.amazon.jsii.JsiiSerializable, IResource
Represents an ECR repository.
  • Method Details

    • getRepositoryArn

      @Stability(Stable) @NotNull String getRepositoryArn()
      The ARN of the repository.
    • getRepositoryName

      @Stability(Stable) @NotNull String getRepositoryName()
      The name of the repository.
    • getRepositoryUri

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

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

    • addToResourcePolicy

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

      Parameters:
      statement - This parameter is required.
    • grant

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

      Parameters:
      grantee - This parameter is required.
      actions - This parameter is required.
    • grantPull

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

      Parameters:
      grantee - This parameter is required.
    • grantPullPush

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

      Parameters:
      grantee - This parameter is required.
    • grantPush

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

      Parameters:
      grantee - This parameter is required.
    • grantRead

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

      Parameters:
      grantee - This parameter is required.
    • onCloudTrailEvent

      @Stability(Stable) @NotNull 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.

      Parameters:
      id - The id of the rule. This parameter is required.
      options - Options for adding the rule.
    • onCloudTrailEvent

      @Stability(Stable) @NotNull 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.

      Parameters:
      id - The id of the rule. This parameter is required.
    • onCloudTrailImagePushed

      @Stability(Stable) @NotNull 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.

      Parameters:
      id - The id of the rule. This parameter is required.
      options - Options for adding the rule.
    • onCloudTrailImagePushed

      @Stability(Stable) @NotNull 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.

      Parameters:
      id - The id of the rule. This parameter is required.
    • onEvent

      @Stability(Stable) @NotNull 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.

      Parameters:
      id - This parameter is required.
      options -
    • onEvent

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

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

      Parameters:
      id - This parameter is required.
    • onImageScanCompleted

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

      Parameters:
      id - The id of the rule. This parameter is required.
      options - Options for adding the rule.
    • onImageScanCompleted

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

      Parameters:
      id - The id of the rule. This parameter is required.
    • repositoryUriForDigest

      @Stability(Stable) @NotNull String repositoryUriForDigest(@Nullable String digest)
      Returns the URI of the repository for a certain digest. Can be used in docker push/pull.

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

      Parameters:
      digest - Image digest to use (tools usually default to the image with the "latest" tag if omitted).
    • repositoryUriForDigest

      @Stability(Stable) @NotNull String repositoryUriForDigest()
      Returns the URI of the repository for a certain digest. Can be used in docker push/pull.

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

    • repositoryUriForTag

      @Stability(Stable) @NotNull String repositoryUriForTag(@Nullable String tag)
      Returns the URI of the repository for a certain tag. Can be used in docker push/pull.

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

      Parameters:
      tag - Image tag to use (tools usually default to "latest" if omitted).
    • repositoryUriForTag

      @Stability(Stable) @NotNull String repositoryUriForTag()
      Returns the URI of the repository for a certain tag. Can be used in docker push/pull.

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

    • repositoryUriForTagOrDigest

      @Stability(Stable) @NotNull String repositoryUriForTagOrDigest(@Nullable String tagOrDigest)
      Returns the URI of the repository for a certain tag or digest, inferring based on the syntax of the tag.

      Can be used in docker push/pull.

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

      Parameters:
      tagOrDigest - Image tag or digest to use (tools usually default to the image with the "latest" tag if omitted).
    • repositoryUriForTagOrDigest

      @Stability(Stable) @NotNull String repositoryUriForTagOrDigest()
      Returns the URI of the repository for a certain tag or digest, inferring based on the syntax of the tag.

      Can be used in docker push/pull.

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