Class RepositoryBase
- All Implemented Interfaces:
IResource
,IRepository
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
- Direct Known Subclasses:
Repository
Reused between imported repositories and owned repositories.
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.ecr.IRepository
IRepository.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
RepositoryBase
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
RepositoryBase
(software.amazon.jsii.JsiiObjectRef objRef) protected
RepositoryBase
(software.constructs.Construct scope, String id) protected
RepositoryBase
(software.constructs.Construct scope, String id, ResourceProps props) -
Method Summary
Modifier and TypeMethodDescriptionabstract AddToResourcePolicyResult
addToResourcePolicy
(PolicyStatement statement) Add a policy statement to the repository's resource policy.abstract String
The ARN of the repository.abstract String
The name of the repository.The URI of this repository (represents the latest image):.grant
(IGrantable grantee, @NotNull String... actions) Grant the given principal identity permissions to perform the actions on this repository.grantPull
(IGrantable grantee) Grant the given identity permissions to use the images in this repository.grantPullPush
(IGrantable grantee) Grant the given identity permissions to pull and push images to this repository.grantPush
(IGrantable grantee) Grant the given identity permissions to use the images in this repository.grantRead
(IGrantable grantee) Grant the given identity permissions to read the images in this repository.Define a CloudWatch event that triggers when something happens to this repository.onCloudTrailEvent
(String id, OnEventOptions options) Define a CloudWatch event that triggers when something happens to this repository.Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository.onCloudTrailImagePushed
(String id, OnCloudTrailImagePushedOptions options) Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository.Defines a CloudWatch event rule which triggers for repository events.onEvent
(String id, OnEventOptions options) Defines a CloudWatch event rule which triggers for repository events.Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.onImageScanCompleted
(String id, OnImageScanCompletedOptions options) Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.Returns the URL of the repository.repositoryUriForDigest
(String digest) Returns the URL of the repository.Returns the URL of the repository.Returns the URL of the repository.Returns the URL of the repository.repositoryUriForTagOrDigest
(String tagOrDigest) Returns the URL of the repository.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource
Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.awscdk.IResource
applyRemovalPolicy, getEnv, getStack
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
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 interfaceIRepository
- 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 interfaceIRepository
- Parameters:
grantee
- This parameter is required.actions
- This parameter is required.
-
grantPull
Grant the given identity permissions to use the images in this repository.- Specified by:
grantPull
in interfaceIRepository
- Parameters:
grantee
- This parameter is required.
-
grantPullPush
Grant the given identity permissions to pull and push images to this repository.- Specified by:
grantPullPush
in interfaceIRepository
- Parameters:
grantee
- This parameter is required.
-
grantPush
Grant the given identity permissions to use the images in this repository.- Specified by:
grantPush
in interfaceIRepository
- Parameters:
grantee
- This parameter is required.
-
grantRead
Grant the given identity permissions to read the images in this repository.- Specified by:
grantRead
in interfaceIRepository
- 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 interfaceIRepository
- Parameters:
id
- The id of the rule. This parameter is required.options
- Options for adding the rule.
-
onCloudTrailEvent
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 interfaceIRepository
- 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 interfaceIRepository
- Parameters:
id
- The id of the rule. This parameter is required.options
- Options for adding the rule.
-
onCloudTrailImagePushed
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 interfaceIRepository
- 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 interfaceIRepository
- Parameters:
id
- This parameter is required.options
-
-
onEvent
Defines a CloudWatch event rule which triggers for repository events.Use
rule.addEventPattern(pattern)
to specify a filter.- Specified by:
onEvent
in interfaceIRepository
- 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 interfaceIRepository
- Parameters:
id
- The id of the rule. This parameter is required.options
- Options for adding the rule.
-
onImageScanCompleted
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.- Specified by:
onImageScanCompleted
in interfaceIRepository
- Parameters:
id
- The id of the rule. This parameter is required.
-
repositoryUriForDigest
Returns the URL of the repository. Can be used indocker push/pull
.ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
- Specified by:
repositoryUriForDigest
in interfaceIRepository
- Parameters:
digest
- Optional image digest.
-
repositoryUriForDigest
Returns the URL of the repository. Can be used indocker push/pull
.ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
- Specified by:
repositoryUriForDigest
in interfaceIRepository
-
repositoryUriForTag
Returns the URL of the repository. Can be used indocker push/pull
.ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
- Specified by:
repositoryUriForTag
in interfaceIRepository
- Parameters:
tag
- Optional image tag.
-
repositoryUriForTag
Returns the URL of the repository. Can be used indocker push/pull
.ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
- Specified by:
repositoryUriForTag
in interfaceIRepository
-
repositoryUriForTagOrDigest
Returns the URL of the repository. Can be used indocker push/pull
.ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG] ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
- Specified by:
repositoryUriForTagOrDigest
in interfaceIRepository
- Parameters:
tagOrDigest
- Optional image tag or digest (digests must start withsha256:
).
-
repositoryUriForTagOrDigest
Returns the URL of the repository. Can be used indocker push/pull
.ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG] ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
- Specified by:
repositoryUriForTagOrDigest
in interfaceIRepository
-
getRepositoryArn
The ARN of the repository.- Specified by:
getRepositoryArn
in interfaceIRepository
-
getRepositoryName
The name of the repository.- Specified by:
getRepositoryName
in interfaceIRepository
-
getRepositoryUri
The URI of this repository (represents the latest image):.ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
- Specified by:
getRepositoryUri
in interfaceIRepository
-