@Generated(value="jsii-pacmak/1.74.0 (build 6d08790)", date="2023-03-22T19:35:41.479Z") public class Repository extends RepositoryBase
Example:
import software.amazon.awscdk.services.ecr.*; Service.Builder.create(this, "Service") .source(Source.fromEcr(EcrProps.builder() .imageConfiguration(ImageConfiguration.builder().port(80).build()) .repository(Repository.fromRepositoryName(this, "NginxRepository", "nginx")) .tagOrDigest("latest") .build())) .build();
Modifier and Type | Class and Description |
---|---|
static class |
Repository.Builder
A fluent builder for
Repository . |
IRepository.Jsii$Default
Modifier | Constructor and Description |
---|---|
protected |
Repository(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
Repository(software.amazon.jsii.JsiiObjectRef objRef) |
|
Repository(software.constructs.Construct scope,
java.lang.String id) |
|
Repository(software.constructs.Construct scope,
java.lang.String id,
RepositoryProps props) |
Modifier and Type | Method and Description |
---|---|
void |
addLifecycleRule(LifecycleRule rule)
Add a life cycle rule to the repository.
|
AddToResourcePolicyResult |
addToResourcePolicy(PolicyStatement statement)
Add a policy statement to the repository's resource policy.
|
static java.lang.String |
arnForLocalRepository(java.lang.String repositoryName,
software.constructs.IConstruct scope)
Returns an ECR ARN for a repository that resides in the same account/region as the current stack.
|
static java.lang.String |
arnForLocalRepository(java.lang.String repositoryName,
software.constructs.IConstruct scope,
java.lang.String account)
Returns an ECR ARN for a repository that resides in the same account/region as the current stack.
|
static IRepository |
fromRepositoryArn(software.constructs.Construct scope,
java.lang.String id,
java.lang.String repositoryArn) |
static IRepository |
fromRepositoryAttributes(software.constructs.Construct scope,
java.lang.String id,
RepositoryAttributes attrs)
Import a repository.
|
static IRepository |
fromRepositoryName(software.constructs.Construct scope,
java.lang.String id,
java.lang.String repositoryName) |
java.lang.String |
getRepositoryArn()
The ARN of the repository.
|
java.lang.String |
getRepositoryName()
The name of the repository.
|
protected java.util.List<java.lang.String> |
validate()
Validate the current construct.
|
getRepositoryUri, grant, grantPull, grantPullPush, onCloudTrailEvent, onCloudTrailEvent, onCloudTrailImagePushed, onCloudTrailImagePushed, onEvent, onEvent, onImageScanCompleted, onImageScanCompleted, repositoryUriForDigest, repositoryUriForDigest, repositoryUriForTag, repositoryUriForTag, repositoryUriForTagOrDigest, repositoryUriForTagOrDigest
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isResource
getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applyRemovalPolicy, getEnv, getStack
getNode
protected Repository(software.amazon.jsii.JsiiObjectRef objRef)
protected Repository(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public Repository(software.constructs.Construct scope, java.lang.String id, RepositoryProps props)
scope
- This parameter is required.id
- This parameter is required.props
- public Repository(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.public static java.lang.String arnForLocalRepository(java.lang.String repositoryName, software.constructs.IConstruct scope, java.lang.String account)
repositoryName
- This parameter is required.scope
- This parameter is required.account
- public static java.lang.String arnForLocalRepository(java.lang.String repositoryName, software.constructs.IConstruct scope)
repositoryName
- This parameter is required.scope
- This parameter is required.public static IRepository fromRepositoryArn(software.constructs.Construct scope, java.lang.String id, java.lang.String repositoryArn)
scope
- This parameter is required.id
- This parameter is required.repositoryArn
- This parameter is required.public static IRepository fromRepositoryAttributes(software.constructs.Construct scope, java.lang.String id, RepositoryAttributes attrs)
scope
- This parameter is required.id
- This parameter is required.attrs
- This parameter is required.public static IRepository fromRepositoryName(software.constructs.Construct scope, java.lang.String id, java.lang.String repositoryName)
scope
- This parameter is required.id
- This parameter is required.repositoryName
- This parameter is required.public void addLifecycleRule(LifecycleRule rule)
Life cycle rules automatically expire images from the repository that match certain conditions.
rule
- This parameter is required.public AddToResourcePolicyResult addToResourcePolicy(PolicyStatement statement)
addToResourcePolicy
in interface IRepository
addToResourcePolicy
in class RepositoryBase
statement
- This parameter is required.protected java.util.List<java.lang.String> validate()
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.
public java.lang.String getRepositoryArn()
getRepositoryArn
in interface IRepository
getRepositoryArn
in class RepositoryBase
public java.lang.String getRepositoryName()
getRepositoryName
in interface IRepository
getRepositoryName
in class RepositoryBase