Show / Hide Table of Contents

Class Repository

Define an ECR repository.

Inheritance
System.Object
Construct
Resource
RepositoryBase
Repository
Implements
IRepository
IResource
IConstruct
Constructs.IConstruct
IDependable
Inherited Members
RepositoryBase.Grant(IGrantable, String[])
RepositoryBase.GrantPull(IGrantable)
RepositoryBase.GrantPullPush(IGrantable)
RepositoryBase.OnCloudTrailEvent(String, IOnEventOptions)
RepositoryBase.OnCloudTrailImagePushed(String, IOnCloudTrailImagePushedOptions)
RepositoryBase.OnEvent(String, IOnEventOptions)
RepositoryBase.OnImageScanCompleted(String, IOnImageScanCompletedOptions)
RepositoryBase.RepositoryUriForDigest(String)
RepositoryBase.RepositoryUriForTag(String)
RepositoryBase.RepositoryUriForTagOrDigest(String)
RepositoryBase.RepositoryUri
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(String, IArnComponents)
Resource.GetResourceNameAttribute(String)
Resource.Env
Resource.PhysicalName
Resource.Stack
Construct.IsConstruct(Object)
Construct.OnPrepare()
Construct.OnSynthesize(ISynthesisSession)
Construct.OnValidate()
Construct.Prepare()
Construct.Synthesize(ISynthesisSession)
Construct.Node
Namespace: Amazon.CDK.AWS.ECR
Assembly: Amazon.CDK.AWS.ECR.dll
Syntax (csharp)
public class Repository : RepositoryBase, IRepository, IResource, IConstruct, IDependable
Syntax (vb)
Public Class Repository
    Inherits RepositoryBase
    Implements IRepository, IResource, IConstruct, IDependable
Remarks

ExampleMetadata: infused

Examples
using Amazon.CDK.AWS.ECR;


new Service(this, "Service", new ServiceProps {
    Source = Source.FromEcr(new EcrProps {
        ImageConfiguration = new ImageConfiguration { Port = 80 },
        Repository = Repository.FromRepositoryName(this, "NginxRepository", "nginx"),
        TagOrDigest = "latest"
    })
});

Synopsis

Constructors

Repository(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

Repository(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

Repository(Construct, String, IRepositoryProps)

Properties

RepositoryArn

The ARN of the repository.

RepositoryName

The name of the repository.

Methods

AddLifecycleRule(ILifecycleRule)

Add a life cycle rule to the repository.

AddToResourcePolicy(PolicyStatement)

Add a policy statement to the repository's resource policy.

ArnForLocalRepository(String, IConstruct, String)

Returns an ECR ARN for a repository that resides in the same account/region as the current stack.

FromRepositoryArn(Construct, String, String)
FromRepositoryAttributes(Construct, String, IRepositoryAttributes)

Import a repository.

FromRepositoryName(Construct, String, String)
Validate()

Validate the current construct.

Constructors

Repository(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected Repository(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

Repository(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected Repository(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

Repository(Construct, String, IRepositoryProps)

public Repository(Construct scope, string id, IRepositoryProps props = null)
Parameters
scope Constructs.Construct
id System.String
props IRepositoryProps

Properties

RepositoryArn

The ARN of the repository.

public override string RepositoryArn { get; }
Property Value

System.String

Overrides
RepositoryBase.RepositoryArn

RepositoryName

The name of the repository.

public override string RepositoryName { get; }
Property Value

System.String

Overrides
RepositoryBase.RepositoryName

Methods

AddLifecycleRule(ILifecycleRule)

Add a life cycle rule to the repository.

public virtual void AddLifecycleRule(ILifecycleRule rule)
Parameters
rule ILifecycleRule
Remarks

Life cycle rules automatically expire images from the repository that match certain conditions.

AddToResourcePolicy(PolicyStatement)

Add a policy statement to the repository's resource policy.

public override IAddToResourcePolicyResult AddToResourcePolicy(PolicyStatement statement)
Parameters
statement PolicyStatement
Returns

IAddToResourcePolicyResult

Overrides
RepositoryBase.AddToResourcePolicy(PolicyStatement)

ArnForLocalRepository(String, IConstruct, String)

Returns an ECR ARN for a repository that resides in the same account/region as the current stack.

public static string ArnForLocalRepository(string repositoryName, IConstruct scope, string account = null)
Parameters
repositoryName System.String
scope Constructs.IConstruct
account System.String
Returns

System.String

FromRepositoryArn(Construct, String, String)

public static IRepository FromRepositoryArn(Construct scope, string id, string repositoryArn)
Parameters
scope Constructs.Construct
id System.String
repositoryArn System.String
Returns

IRepository

FromRepositoryAttributes(Construct, String, IRepositoryAttributes)

Import a repository.

public static IRepository FromRepositoryAttributes(Construct scope, string id, IRepositoryAttributes attrs)
Parameters
scope Constructs.Construct
id System.String
attrs IRepositoryAttributes
Returns

IRepository

FromRepositoryName(Construct, String, String)

public static IRepository FromRepositoryName(Construct scope, string id, string repositoryName)
Parameters
scope Constructs.Construct
id System.String
repositoryName System.String
Returns

IRepository

Validate()

Validate the current construct.

protected override string[] Validate()
Returns

System.String[]

Overrides
Construct.Validate()
Remarks

This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

Implements

IRepository
IResource
IConstruct
Constructs.IConstruct
IDependable
Back to top Generated by DocFX