// Jest Snapshot v1, https://goo.gl/fbAQLP exports[`complex link formatter - aws-solutions-constructs java snapshot 1`] = ` "# aws-lambda-sqs module ---  --- | **Reference Documentation**:| https://docs.aws.amazon.com/solutions/latest/constructs/| |:-------------|:-------------|
| **Language** | **Package** | |:-------------|-----------------| | Python|\`aws_solutions_constructs.aws_lambda_sqs\`| | Typescript|\`@aws-solutions-constructs/aws-lambda-sqs\`| | Java|\`software.amazon.awsconstructs.services.lambdasqs\`| This AWS Solutions Construct implements an AWS Lambda function connected to an Amazon SQS queue. Here is a minimal deployable pattern definition in Typescript: \`\`\`java // Example automatically generated from non-compiling source. May contain errors. import software.amazon.awsconstructs.services.lambdasqs.LambdaToSqs; import software.amazon.awsconstructs.services.lambdasqs.LambdaToSqsProps; LambdaToSqs.Builder.create(this, "LambdaToSqsPattern") .lambdaFunctionProps(FunctionProps.builder() .runtime(lambda.getRuntime().getNODEJS_12_X()) .handler("index.handler") .code(lambda.Code.fromAsset(String.format("%s/lambda", __dirname))) .build()) .build(); \`\`\` ## Initializer \`\`\`text new LambdaToSqs(scope: Construct, id: string, props: LambdaToSqsProps); \`\`\` *Parameters* * scope [\`Construct\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_core.Construct.html) * id \`string\` * props [\`LambdaToSqsProps\`](#pattern-construct-props) ## Pattern Construct Props | **Name** | **Type** | **Description** | |:-------------|:----------------|-----------------| |existingLambdaObj?|[\`lambda.Function\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.Function.html)|An optional, existing Lambda function to be used instead of the default function. Providing both this and \`lambdaFunctionProps\` will cause an error.| |lambdaFunctionProps?|[\`lambda.FunctionProps\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.FunctionProps.html)|Optional user-provided properties to override the default properties for the Lambda function. | |existingQueueObj?|[\`sqs.Queue\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-sqs.Queue.html)|An optional, existing SQS queue to be used instead of the default queue. Providing both this and \`queueProps\` will cause an error.| |queueProps?|[\`sqs.QueueProps\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-sqs.QueueProps.html)|Optional user-provided properties to override the default properties for the SQS queue.| |enableQueuePurging?|\`boolean\`|Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue. Defaults to \`false\`.| |deployDeadLetterQueue?|\`boolean\`|Whether to create a secondary queue to be used as a dead letter queue. Defaults to \`true\`.| |deadLetterQueueProps?|[\`sqs.QueueProps\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-sqs.QueueProps.html)|Optional user-provided props to override the default props for the dead letter queue. Only used if the \`deployDeadLetterQueue\` property is set to true.| |maxReceiveCount?|\`number\`|The number of times a message can be unsuccessfully dequeued before being moved to the dead letter queue. Defaults to \`15\`.| |existingVpc?|[\`ec2.IVpc\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.IVpc.html)|An optional, existing VPC into which this pattern should be deployed. When deployed in a VPC, the Lambda function will use ENIs in the VPC to access network resources and an Interface Endpoint will be created in the VPC for Amazon SQS. If an existing VPC is provided, the \`deployVpc\` property cannot be \`true\`. This uses \`ec2.IVpc\` to allow clients to supply VPCs that exist outside the stack using the [\`ec2.Vpc.fromLookup()\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.Vpc.html#static-fromwbrlookupscope-id-options) method.| |vpcProps?|[\`ec2.VpcProps\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.VpcProps.html)|Optional user-provided properties to override the default properties for the new VPC. \`enableDnsHostnames\`, \`enableDnsSupport\`, \`natGateways\` and \`subnetConfiguration\` are set by the pattern, so any values for those properties supplied here will be overrriden. If \`deployVpc\` is not \`true\` then this property will be ignored.| |deployVpc?|\`boolean\`|Whether to create a new VPC based on \`vpcProps\` into which to deploy this pattern. Setting this to true will deploy the minimal, most private VPC to run the pattern:scope
| Construct
| - represents the scope for all the resources. |
| id
| java.lang.String
| - this is a a scope-unique id. |
| deadLetterQueueProps
| QueueProps
| Optional user provided properties for the dead letter queue. |
| deployDeadLetterQueue
| java.lang.Boolean
| Whether to deploy a secondary queue to be used as a dead letter queue. |
| deployVpc
| java.lang.Boolean
| Whether to deploy a new VPC. |
| enableQueuePurging
| java.lang.Boolean
| Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue. |
| existingLambdaObj
| Function
| Existing instance of Lambda Function object, providing both this and \`lambdaFunctionProps\` will cause an error. |
| existingQueueObj
| Queue
| Existing instance of SQS queue object, Providing both this and queueProps will cause an error. |
| existingVpc
| IVpc
| An existing VPC for the construct to use (construct will NOT create a new VPC in this case). |
| lambdaFunctionProps
| FunctionProps
| User provided props to override the default props for the Lambda function. |
| maxReceiveCount
| java.lang.Number
| The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue. |
| queueEnvironmentVariableName
| java.lang.String
| Optional Name for the SQS queue URL environment variable set for the Lambda function. |
| queueProps
| QueueProps
| Optional user-provided props to override the default props for the SQS queue. |
| vpcProps
| VpcProps
| Properties to override default properties if deployVpc is true. |
---
##### \`scope\`Required
- *Type:* Construct
represents the scope for all the resources.
---
##### \`id\`Required
- *Type:* java.lang.String
this is a a scope-unique id.
---
##### \`deadLetterQueueProps\`Optional
- *Type:* QueueProps
- *Default:* Default props are used
Optional user provided properties for the dead letter queue.
---
##### \`deployDeadLetterQueue\`Optional
- *Type:* java.lang.Boolean
- *Default:* true.
Whether to deploy a secondary queue to be used as a dead letter queue.
---
##### \`deployVpc\`Optional
- *Type:* java.lang.Boolean
- *Default:* false
Whether to deploy a new VPC.
---
##### \`enableQueuePurging\`Optional
- *Type:* java.lang.Boolean
- *Default:* "false", disabled by default.
Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue.
---
##### \`existingLambdaObj\`Optional
- *Type:* Function
- *Default:* None
Existing instance of Lambda Function object, providing both this and \`lambdaFunctionProps\` will cause an error.
---
##### \`existingQueueObj\`Optional
- *Type:* Queue
- *Default:* Default props are used
Existing instance of SQS queue object, Providing both this and queueProps will cause an error.
---
##### \`existingVpc\`Optional
- *Type:* IVpc
An existing VPC for the construct to use (construct will NOT create a new VPC in this case).
---
##### \`lambdaFunctionProps\`Optional
- *Type:* FunctionProps
- *Default:* Default properties are used.
User provided props to override the default props for the Lambda function.
---
##### \`maxReceiveCount\`Optional
- *Type:* java.lang.Number
- *Default:* required field if deployDeadLetterQueue=true.
The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue.
---
##### \`queueEnvironmentVariableName\`Optional
- *Type:* java.lang.String
- *Default:* None
Optional Name for the SQS queue URL environment variable set for the Lambda function.
---
##### \`queueProps\`Optional
- *Type:* QueueProps
- *Default:* Default props are used
Optional user-provided props to override the default props for the SQS queue.
---
##### \`vpcProps\`Optional
- *Type:* VpcProps
Properties to override default properties if deployVpc is true.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
---
##### \`toString\`
\`\`\`java
public java.lang.String toString()
\`\`\`
Returns a string representation of this construct.
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Checks if \`x\` is a construct. |
---
##### \`isConstruct\`
\`\`\`java
import software.amazon.awsconstructs.services.lambdasqs.LambdaToSqs;
LambdaToSqs.isConstruct(java.lang.Object x)
\`\`\`
Checks if \`x\` is a construct.
Use this method instead of \`instanceof\` to properly detect \`Construct\`
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the \`constructs\` library on
disk are seen as independent, completely different libraries. As a
consequence, the class \`Construct\` in each copy of the \`constructs\` library
is seen as a different class, and an instance of one class will not test as
\`instanceof\` the other class. \`npm install\` will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the \`constructs\`
library can be accidentally installed, and \`instanceof\` will behave
unpredictably. It is safest to avoid using \`instanceof\`, and using
this type-testing method instead.
###### \`x\`Required
- *Type:* java.lang.Object
Any object.
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| Node
| The tree node. |
| lambdaFunction
| Function
| *No description.* |
| sqsQueue
| Queue
| *No description.* |
| deadLetterQueue
| DeadLetterQueue
| *No description.* |
| vpc
| IVpc
| *No description.* |
---
##### \`node\`Required
\`\`\`java
public Node getNode();
\`\`\`
- *Type:* Node
The tree node.
---
##### \`lambdaFunction\`Required
\`\`\`java
public Function getLambdaFunction();
\`\`\`
- *Type:* Function
---
##### \`sqsQueue\`Required
\`\`\`java
public Queue getSqsQueue();
\`\`\`
- *Type:* Queue
---
##### \`deadLetterQueue\`Optional
\`\`\`java
public DeadLetterQueue getDeadLetterQueue();
\`\`\`
- *Type:* DeadLetterQueue
---
##### \`vpc\`Optional
\`\`\`java
public IVpc getVpc();
\`\`\`
- *Type:* IVpc
---
## Structs
### LambdaToSqsProps
#### Initializer
\`\`\`java
import software.amazon.awsconstructs.services.lambdasqs.LambdaToSqsProps;
LambdaToSqsProps.builder()
// .deadLetterQueueProps(QueueProps)
// .deployDeadLetterQueue(java.lang.Boolean)
// .deployVpc(java.lang.Boolean)
// .enableQueuePurging(java.lang.Boolean)
// .existingLambdaObj(Function)
// .existingQueueObj(Queue)
// .existingVpc(IVpc)
// .lambdaFunctionProps(FunctionProps)
// .maxReceiveCount(java.lang.Number)
// .queueEnvironmentVariableName(java.lang.String)
// .queueProps(QueueProps)
// .vpcProps(VpcProps)
.build();
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| deadLetterQueueProps
| QueueProps
| Optional user provided properties for the dead letter queue. |
| deployDeadLetterQueue
| java.lang.Boolean
| Whether to deploy a secondary queue to be used as a dead letter queue. |
| deployVpc
| java.lang.Boolean
| Whether to deploy a new VPC. |
| enableQueuePurging
| java.lang.Boolean
| Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue. |
| existingLambdaObj
| Function
| Existing instance of Lambda Function object, providing both this and \`lambdaFunctionProps\` will cause an error. |
| existingQueueObj
| Queue
| Existing instance of SQS queue object, Providing both this and queueProps will cause an error. |
| existingVpc
| IVpc
| An existing VPC for the construct to use (construct will NOT create a new VPC in this case). |
| lambdaFunctionProps
| FunctionProps
| User provided props to override the default props for the Lambda function. |
| maxReceiveCount
| java.lang.Number
| The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue. |
| queueEnvironmentVariableName
| java.lang.String
| Optional Name for the SQS queue URL environment variable set for the Lambda function. |
| queueProps
| QueueProps
| Optional user-provided props to override the default props for the SQS queue. |
| vpcProps
| VpcProps
| Properties to override default properties if deployVpc is true. |
---
##### \`deadLetterQueueProps\`Optional
\`\`\`java
public QueueProps getDeadLetterQueueProps();
\`\`\`
- *Type:* QueueProps
- *Default:* Default props are used
Optional user provided properties for the dead letter queue.
---
##### \`deployDeadLetterQueue\`Optional
\`\`\`java
public java.lang.Boolean getDeployDeadLetterQueue();
\`\`\`
- *Type:* java.lang.Boolean
- *Default:* true.
Whether to deploy a secondary queue to be used as a dead letter queue.
---
##### \`deployVpc\`Optional
\`\`\`java
public java.lang.Boolean getDeployVpc();
\`\`\`
- *Type:* java.lang.Boolean
- *Default:* false
Whether to deploy a new VPC.
---
##### \`enableQueuePurging\`Optional
\`\`\`java
public java.lang.Boolean getEnableQueuePurging();
\`\`\`
- *Type:* java.lang.Boolean
- *Default:* "false", disabled by default.
Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue.
---
##### \`existingLambdaObj\`Optional
\`\`\`java
public Function getExistingLambdaObj();
\`\`\`
- *Type:* Function
- *Default:* None
Existing instance of Lambda Function object, providing both this and \`lambdaFunctionProps\` will cause an error.
---
##### \`existingQueueObj\`Optional
\`\`\`java
public Queue getExistingQueueObj();
\`\`\`
- *Type:* Queue
- *Default:* Default props are used
Existing instance of SQS queue object, Providing both this and queueProps will cause an error.
---
##### \`existingVpc\`Optional
\`\`\`java
public IVpc getExistingVpc();
\`\`\`
- *Type:* IVpc
An existing VPC for the construct to use (construct will NOT create a new VPC in this case).
---
##### \`lambdaFunctionProps\`Optional
\`\`\`java
public FunctionProps getLambdaFunctionProps();
\`\`\`
- *Type:* FunctionProps
- *Default:* Default properties are used.
User provided props to override the default props for the Lambda function.
---
##### \`maxReceiveCount\`Optional
\`\`\`java
public java.lang.Number getMaxReceiveCount();
\`\`\`
- *Type:* java.lang.Number
- *Default:* required field if deployDeadLetterQueue=true.
The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue.
---
##### \`queueEnvironmentVariableName\`Optional
\`\`\`java
public java.lang.String getQueueEnvironmentVariableName();
\`\`\`
- *Type:* java.lang.String
- *Default:* None
Optional Name for the SQS queue URL environment variable set for the Lambda function.
---
##### \`queueProps\`Optional
\`\`\`java
public QueueProps getQueueProps();
\`\`\`
- *Type:* QueueProps
- *Default:* Default props are used
Optional user-provided props to override the default props for the SQS queue.
---
##### \`vpcProps\`Optional
\`\`\`java
public VpcProps getVpcProps();
\`\`\`
- *Type:* VpcProps
Properties to override default properties if deployVpc is true.
---
"
`;
exports[`complex link formatter - aws-solutions-constructs python snapshot 1`] = `
"# aws-lambda-sqs module
---

---
| **Reference Documentation**:| https://docs.aws.amazon.com/solutions/latest/constructs/|
|:-------------|:-------------|
| **Language** | **Package** |
|:-------------|-----------------|
| Python|\`aws_solutions_constructs.aws_lambda_sqs\`|
| Typescript|\`@aws-solutions-constructs/aws-lambda-sqs\`|
| Java|\`software.amazon.awsconstructs.services.lambdasqs\`|
This AWS Solutions Construct implements an AWS Lambda function connected to an Amazon SQS queue.
Here is a minimal deployable pattern definition in Typescript:
\`\`\`python
# Example automatically generated from non-compiling source. May contain errors.
from aws_cdk.aws_lambda import FunctionProps
from aws_solutions_constructs.aws_lambda_sqs import LambdaToSqs, LambdaToSqsProps
LambdaToSqs(self, "LambdaToSqsPattern",
lambda_function_props=FunctionProps(
runtime=lambda_.Runtime.NODEJS_12_X,
handler="index.handler",
code=lambda_.Code.from_asset(f"{__dirname}/lambda")
)
)
\`\`\`
## Initializer
\`\`\`text
new LambdaToSqs(scope: Construct, id: string, props: LambdaToSqsProps);
\`\`\`
*Parameters*
* scope [\`Construct\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_core.Construct.html)
* id \`string\`
* props [\`LambdaToSqsProps\`](#pattern-construct-props)
## Pattern Construct Props
| **Name** | **Type** | **Description** |
|:-------------|:----------------|-----------------|
|existingLambdaObj?|[\`lambda.Function\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.Function.html)|An optional, existing Lambda function to be used instead of the default function. Providing both this and \`lambdaFunctionProps\` will cause an error.|
|lambdaFunctionProps?|[\`lambda.FunctionProps\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.FunctionProps.html)|Optional user-provided properties to override the default properties for the Lambda function. |
|existingQueueObj?|[\`sqs.Queue\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-sqs.Queue.html)|An optional, existing SQS queue to be used instead of the default queue. Providing both this and \`queueProps\` will cause an error.|
|queueProps?|[\`sqs.QueueProps\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-sqs.QueueProps.html)|Optional user-provided properties to override the default properties for the SQS queue.|
|enableQueuePurging?|\`boolean\`|Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue. Defaults to \`false\`.|
|deployDeadLetterQueue?|\`boolean\`|Whether to create a secondary queue to be used as a dead letter queue. Defaults to \`true\`.|
|deadLetterQueueProps?|[\`sqs.QueueProps\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-sqs.QueueProps.html)|Optional user-provided props to override the default props for the dead letter queue. Only used if the \`deployDeadLetterQueue\` property is set to true.|
|maxReceiveCount?|\`number\`|The number of times a message can be unsuccessfully dequeued before being moved to the dead letter queue. Defaults to \`15\`.|
|existingVpc?|[\`ec2.IVpc\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.IVpc.html)|An optional, existing VPC into which this pattern should be deployed. When deployed in a VPC, the Lambda function will use ENIs in the VPC to access network resources and an Interface Endpoint will be created in the VPC for Amazon SQS. If an existing VPC is provided, the \`deployVpc\` property cannot be \`true\`. This uses \`ec2.IVpc\` to allow clients to supply VPCs that exist outside the stack using the [\`ec2.Vpc.fromLookup()\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.Vpc.html#static-fromwbrlookupscope-id-options) method.|
|vpcProps?|[\`ec2.VpcProps\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.VpcProps.html)|Optional user-provided properties to override the default properties for the new VPC. \`enableDnsHostnames\`, \`enableDnsSupport\`, \`natGateways\` and \`subnetConfiguration\` are set by the pattern, so any values for those properties supplied here will be overrriden. If \`deployVpc\` is not \`true\` then this property will be ignored.|
|deployVpc?|\`boolean\`|Whether to create a new VPC based on \`vpcProps\` into which to deploy this pattern. Setting this to true will deploy the minimal, most private VPC to run the pattern:scope
| Construct
| - represents the scope for all the resources. |
| id
| str
| - this is a a scope-unique id. |
| dead_letter_queue_props
| QueueProps
| Optional user provided properties for the dead letter queue. |
| deploy_dead_letter_queue
| bool
| Whether to deploy a secondary queue to be used as a dead letter queue. |
| deploy_vpc
| bool
| Whether to deploy a new VPC. |
| enable_queue_purging
| bool
| Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue. |
| existing_lambda_obj
| Function
| Existing instance of Lambda Function object, providing both this and \`lambdaFunctionProps\` will cause an error. |
| existing_queue_obj
| Queue
| Existing instance of SQS queue object, Providing both this and queueProps will cause an error. |
| existing_vpc
| IVpc
| An existing VPC for the construct to use (construct will NOT create a new VPC in this case). |
| lambda_function_props
| FunctionProps
| User provided props to override the default props for the Lambda function. |
| max_receive_count
| typing.Union[int, float]
| The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue. |
| queue_environment_variable_name
| str
| Optional Name for the SQS queue URL environment variable set for the Lambda function. |
| queue_props
| QueueProps
| Optional user-provided props to override the default props for the SQS queue. |
| vpc_props
| VpcProps
| Properties to override default properties if deployVpc is true. |
---
##### \`scope\`Required
- *Type:* Construct
represents the scope for all the resources.
---
##### \`id\`Required
- *Type:* str
this is a a scope-unique id.
---
##### \`dead_letter_queue_props\`Optional
- *Type:* QueueProps
- *Default:* Default props are used
Optional user provided properties for the dead letter queue.
---
##### \`deploy_dead_letter_queue\`Optional
- *Type:* bool
- *Default:* true.
Whether to deploy a secondary queue to be used as a dead letter queue.
---
##### \`deploy_vpc\`Optional
- *Type:* bool
- *Default:* false
Whether to deploy a new VPC.
---
##### \`enable_queue_purging\`Optional
- *Type:* bool
- *Default:* "false", disabled by default.
Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue.
---
##### \`existing_lambda_obj\`Optional
- *Type:* Function
- *Default:* None
Existing instance of Lambda Function object, providing both this and \`lambdaFunctionProps\` will cause an error.
---
##### \`existing_queue_obj\`Optional
- *Type:* Queue
- *Default:* Default props are used
Existing instance of SQS queue object, Providing both this and queueProps will cause an error.
---
##### \`existing_vpc\`Optional
- *Type:* IVpc
An existing VPC for the construct to use (construct will NOT create a new VPC in this case).
---
##### \`lambda_function_props\`Optional
- *Type:* FunctionProps
- *Default:* Default properties are used.
User provided props to override the default props for the Lambda function.
---
##### \`max_receive_count\`Optional
- *Type:* typing.Union[int, float]
- *Default:* required field if deployDeadLetterQueue=true.
The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue.
---
##### \`queue_environment_variable_name\`Optional
- *Type:* str
- *Default:* None
Optional Name for the SQS queue URL environment variable set for the Lambda function.
---
##### \`queue_props\`Optional
- *Type:* QueueProps
- *Default:* Default props are used
Optional user-provided props to override the default props for the SQS queue.
---
##### \`vpc_props\`Optional
- *Type:* VpcProps
Properties to override default properties if deployVpc is true.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| to_string
| Returns a string representation of this construct. |
---
##### \`to_string\`
\`\`\`python
def to_string() -> str
\`\`\`
Returns a string representation of this construct.
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| is_construct
| Checks if \`x\` is a construct. |
---
##### \`is_construct\`
\`\`\`python
import aws_solutions_constructs.aws_lambda_sqs
aws_solutions_constructs.aws_lambda_sqs.LambdaToSqs.is_construct(
x: typing.Any
)
\`\`\`
Checks if \`x\` is a construct.
Use this method instead of \`instanceof\` to properly detect \`Construct\`
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the \`constructs\` library on
disk are seen as independent, completely different libraries. As a
consequence, the class \`Construct\` in each copy of the \`constructs\` library
is seen as a different class, and an instance of one class will not test as
\`instanceof\` the other class. \`npm install\` will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the \`constructs\`
library can be accidentally installed, and \`instanceof\` will behave
unpredictably. It is safest to avoid using \`instanceof\`, and using
this type-testing method instead.
###### \`x\`Required
- *Type:* typing.Any
Any object.
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| Node
| The tree node. |
| lambda_function
| Function
| *No description.* |
| sqs_queue
| Queue
| *No description.* |
| dead_letter_queue
| DeadLetterQueue
| *No description.* |
| vpc
| IVpc
| *No description.* |
---
##### \`node\`Required
\`\`\`python
node: Node
\`\`\`
- *Type:* Node
The tree node.
---
##### \`lambda_function\`Required
\`\`\`python
lambda_function: Function
\`\`\`
- *Type:* Function
---
##### \`sqs_queue\`Required
\`\`\`python
sqs_queue: Queue
\`\`\`
- *Type:* Queue
---
##### \`dead_letter_queue\`Optional
\`\`\`python
dead_letter_queue: DeadLetterQueue
\`\`\`
- *Type:* DeadLetterQueue
---
##### \`vpc\`Optional
\`\`\`python
vpc: IVpc
\`\`\`
- *Type:* IVpc
---
## Structs
### LambdaToSqsProps
#### Initializer
\`\`\`python
import aws_solutions_constructs.aws_lambda_sqs
aws_solutions_constructs.aws_lambda_sqs.LambdaToSqsProps(
dead_letter_queue_props: QueueProps = None,
deploy_dead_letter_queue: bool = None,
deploy_vpc: bool = None,
enable_queue_purging: bool = None,
existing_lambda_obj: Function = None,
existing_queue_obj: Queue = None,
existing_vpc: IVpc = None,
lambda_function_props: FunctionProps = None,
max_receive_count: typing.Union[int, float] = None,
queue_environment_variable_name: str = None,
queue_props: QueueProps = None,
vpc_props: VpcProps = None
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| dead_letter_queue_props
| QueueProps
| Optional user provided properties for the dead letter queue. |
| deploy_dead_letter_queue
| bool
| Whether to deploy a secondary queue to be used as a dead letter queue. |
| deploy_vpc
| bool
| Whether to deploy a new VPC. |
| enable_queue_purging
| bool
| Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue. |
| existing_lambda_obj
| Function
| Existing instance of Lambda Function object, providing both this and \`lambdaFunctionProps\` will cause an error. |
| existing_queue_obj
| Queue
| Existing instance of SQS queue object, Providing both this and queueProps will cause an error. |
| existing_vpc
| IVpc
| An existing VPC for the construct to use (construct will NOT create a new VPC in this case). |
| lambda_function_props
| FunctionProps
| User provided props to override the default props for the Lambda function. |
| max_receive_count
| typing.Union[int, float]
| The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue. |
| queue_environment_variable_name
| str
| Optional Name for the SQS queue URL environment variable set for the Lambda function. |
| queue_props
| QueueProps
| Optional user-provided props to override the default props for the SQS queue. |
| vpc_props
| VpcProps
| Properties to override default properties if deployVpc is true. |
---
##### \`dead_letter_queue_props\`Optional
\`\`\`python
dead_letter_queue_props: QueueProps
\`\`\`
- *Type:* QueueProps
- *Default:* Default props are used
Optional user provided properties for the dead letter queue.
---
##### \`deploy_dead_letter_queue\`Optional
\`\`\`python
deploy_dead_letter_queue: bool
\`\`\`
- *Type:* bool
- *Default:* true.
Whether to deploy a secondary queue to be used as a dead letter queue.
---
##### \`deploy_vpc\`Optional
\`\`\`python
deploy_vpc: bool
\`\`\`
- *Type:* bool
- *Default:* false
Whether to deploy a new VPC.
---
##### \`enable_queue_purging\`Optional
\`\`\`python
enable_queue_purging: bool
\`\`\`
- *Type:* bool
- *Default:* "false", disabled by default.
Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue.
---
##### \`existing_lambda_obj\`Optional
\`\`\`python
existing_lambda_obj: Function
\`\`\`
- *Type:* Function
- *Default:* None
Existing instance of Lambda Function object, providing both this and \`lambdaFunctionProps\` will cause an error.
---
##### \`existing_queue_obj\`Optional
\`\`\`python
existing_queue_obj: Queue
\`\`\`
- *Type:* Queue
- *Default:* Default props are used
Existing instance of SQS queue object, Providing both this and queueProps will cause an error.
---
##### \`existing_vpc\`Optional
\`\`\`python
existing_vpc: IVpc
\`\`\`
- *Type:* IVpc
An existing VPC for the construct to use (construct will NOT create a new VPC in this case).
---
##### \`lambda_function_props\`Optional
\`\`\`python
lambda_function_props: FunctionProps
\`\`\`
- *Type:* FunctionProps
- *Default:* Default properties are used.
User provided props to override the default props for the Lambda function.
---
##### \`max_receive_count\`Optional
\`\`\`python
max_receive_count: typing.Union[int, float]
\`\`\`
- *Type:* typing.Union[int, float]
- *Default:* required field if deployDeadLetterQueue=true.
The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue.
---
##### \`queue_environment_variable_name\`Optional
\`\`\`python
queue_environment_variable_name: str
\`\`\`
- *Type:* str
- *Default:* None
Optional Name for the SQS queue URL environment variable set for the Lambda function.
---
##### \`queue_props\`Optional
\`\`\`python
queue_props: QueueProps
\`\`\`
- *Type:* QueueProps
- *Default:* Default props are used
Optional user-provided props to override the default props for the SQS queue.
---
##### \`vpc_props\`Optional
\`\`\`python
vpc_props: VpcProps
\`\`\`
- *Type:* VpcProps
Properties to override default properties if deployVpc is true.
---
"
`;
exports[`complex link formatter - aws-solutions-constructs typescript snapshot 1`] = `
"# aws-lambda-sqs module
---

---
| **Reference Documentation**:| https://docs.aws.amazon.com/solutions/latest/constructs/|
|:-------------|:-------------|
| **Language** | **Package** |
|:-------------|-----------------|
| Python|\`aws_solutions_constructs.aws_lambda_sqs\`|
| Typescript|\`@aws-solutions-constructs/aws-lambda-sqs\`|
| Java|\`software.amazon.awsconstructs.services.lambdasqs\`|
This AWS Solutions Construct implements an AWS Lambda function connected to an Amazon SQS queue.
Here is a minimal deployable pattern definition in Typescript:
\`\`\` typescript
import { LambdaToSqs, LambdaToSqsProps } from "@aws-solutions-constructs/aws-lambda-sqs";
new LambdaToSqs(this, 'LambdaToSqsPattern', {
lambdaFunctionProps: {
runtime: lambda.Runtime.NODEJS_12_X,
handler: 'index.handler',
code: lambda.Code.fromAsset(\`\${__dirname}/lambda\`)
}
});
\`\`\`
## Initializer
\`\`\` text
new LambdaToSqs(scope: Construct, id: string, props: LambdaToSqsProps);
\`\`\`
_Parameters_
* scope [\`Construct\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_core.Construct.html)
* id \`string\`
* props [\`LambdaToSqsProps\`](#pattern-construct-props)
## Pattern Construct Props
| **Name** | **Type** | **Description** |
|:-------------|:----------------|-----------------|
|existingLambdaObj?|[\`lambda.Function\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.Function.html)|An optional, existing Lambda function to be used instead of the default function. Providing both this and \`lambdaFunctionProps\` will cause an error.|
|lambdaFunctionProps?|[\`lambda.FunctionProps\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-lambda.FunctionProps.html)|Optional user-provided properties to override the default properties for the Lambda function. |
|existingQueueObj?|[\`sqs.Queue\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-sqs.Queue.html)|An optional, existing SQS queue to be used instead of the default queue. Providing both this and \`queueProps\` will cause an error.|
|queueProps?|[\`sqs.QueueProps\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-sqs.QueueProps.html)|Optional user-provided properties to override the default properties for the SQS queue.|
|enableQueuePurging?|\`boolean\`|Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue. Defaults to \`false\`.|
|deployDeadLetterQueue?|\`boolean\`|Whether to create a secondary queue to be used as a dead letter queue. Defaults to \`true\`.|
|deadLetterQueueProps?|[\`sqs.QueueProps\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-sqs.QueueProps.html)|Optional user-provided props to override the default props for the dead letter queue. Only used if the \`deployDeadLetterQueue\` property is set to true.|
|maxReceiveCount?|\`number\`|The number of times a message can be unsuccessfully dequeued before being moved to the dead letter queue. Defaults to \`15\`.|
|existingVpc?|[\`ec2.IVpc\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.IVpc.html)|An optional, existing VPC into which this pattern should be deployed. When deployed in a VPC, the Lambda function will use ENIs in the VPC to access network resources and an Interface Endpoint will be created in the VPC for Amazon SQS. If an existing VPC is provided, the \`deployVpc\` property cannot be \`true\`. This uses \`ec2.IVpc\` to allow clients to supply VPCs that exist outside the stack using the [\`ec2.Vpc.fromLookup()\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.Vpc.html#static-fromwbrlookupscope-id-options) method.|
|vpcProps?|[\`ec2.VpcProps\`](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-ec2.VpcProps.html)|Optional user-provided properties to override the default properties for the new VPC. \`enableDnsHostnames\`, \`enableDnsSupport\`, \`natGateways\` and \`subnetConfiguration\` are set by the pattern, so any values for those properties supplied here will be overrriden. If \`deployVpc\` is not \`true\` then this property will be ignored.|
|deployVpc?|\`boolean\`|Whether to create a new VPC based on \`vpcProps\` into which to deploy this pattern. Setting this to true will deploy the minimal, most private VPC to run the pattern:scope
| Construct
| - represents the scope for all the resources. |
| id
| string
| - this is a a scope-unique id. |
| props
| LambdaToSqsProps
| - user provided props for the construct. |
---
##### \`scope\`Required
- *Type:* Construct
represents the scope for all the resources.
---
##### \`id\`Required
- *Type:* string
this is a a scope-unique id.
---
##### \`props\`Required
- *Type:* LambdaToSqsProps
user provided props for the construct.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
---
##### \`toString\`
\`\`\`typescript
public toString(): string
\`\`\`
Returns a string representation of this construct.
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Checks if \`x\` is a construct. |
---
##### \`isConstruct\`
\`\`\`typescript
import { LambdaToSqs } from '@aws-solutions-constructs/aws-lambda-sqs'
LambdaToSqs.isConstruct(x: any)
\`\`\`
Checks if \`x\` is a construct.
Use this method instead of \`instanceof\` to properly detect \`Construct\`
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the \`constructs\` library on
disk are seen as independent, completely different libraries. As a
consequence, the class \`Construct\` in each copy of the \`constructs\` library
is seen as a different class, and an instance of one class will not test as
\`instanceof\` the other class. \`npm install\` will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the \`constructs\`
library can be accidentally installed, and \`instanceof\` will behave
unpredictably. It is safest to avoid using \`instanceof\`, and using
this type-testing method instead.
###### \`x\`Required
- *Type:* any
Any object.
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| Node
| The tree node. |
| lambdaFunction
| Function
| *No description.* |
| sqsQueue
| Queue
| *No description.* |
| deadLetterQueue
| DeadLetterQueue
| *No description.* |
| vpc
| IVpc
| *No description.* |
---
##### \`node\`Required
\`\`\`typescript
public readonly node: Node;
\`\`\`
- *Type:* Node
The tree node.
---
##### \`lambdaFunction\`Required
\`\`\`typescript
public readonly lambdaFunction: Function;
\`\`\`
- *Type:* Function
---
##### \`sqsQueue\`Required
\`\`\`typescript
public readonly sqsQueue: Queue;
\`\`\`
- *Type:* Queue
---
##### \`deadLetterQueue\`Optional
\`\`\`typescript
public readonly deadLetterQueue: DeadLetterQueue;
\`\`\`
- *Type:* DeadLetterQueue
---
##### \`vpc\`Optional
\`\`\`typescript
public readonly vpc: IVpc;
\`\`\`
- *Type:* IVpc
---
## Structs
### LambdaToSqsProps
#### Initializer
\`\`\`typescript
import { LambdaToSqsProps } from '@aws-solutions-constructs/aws-lambda-sqs'
const lambdaToSqsProps: LambdaToSqsProps = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| deadLetterQueueProps
| QueueProps
| Optional user provided properties for the dead letter queue. |
| deployDeadLetterQueue
| boolean
| Whether to deploy a secondary queue to be used as a dead letter queue. |
| deployVpc
| boolean
| Whether to deploy a new VPC. |
| enableQueuePurging
| boolean
| Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue. |
| existingLambdaObj
| Function
| Existing instance of Lambda Function object, providing both this and \`lambdaFunctionProps\` will cause an error. |
| existingQueueObj
| Queue
| Existing instance of SQS queue object, Providing both this and queueProps will cause an error. |
| existingVpc
| IVpc
| An existing VPC for the construct to use (construct will NOT create a new VPC in this case). |
| lambdaFunctionProps
| FunctionProps
| User provided props to override the default props for the Lambda function. |
| maxReceiveCount
| number
| The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue. |
| queueEnvironmentVariableName
| string
| Optional Name for the SQS queue URL environment variable set for the Lambda function. |
| queueProps
| QueueProps
| Optional user-provided props to override the default props for the SQS queue. |
| vpcProps
| VpcProps
| Properties to override default properties if deployVpc is true. |
---
##### \`deadLetterQueueProps\`Optional
\`\`\`typescript
public readonly deadLetterQueueProps: QueueProps;
\`\`\`
- *Type:* QueueProps
- *Default:* Default props are used
Optional user provided properties for the dead letter queue.
---
##### \`deployDeadLetterQueue\`Optional
\`\`\`typescript
public readonly deployDeadLetterQueue: boolean;
\`\`\`
- *Type:* boolean
- *Default:* true.
Whether to deploy a secondary queue to be used as a dead letter queue.
---
##### \`deployVpc\`Optional
\`\`\`typescript
public readonly deployVpc: boolean;
\`\`\`
- *Type:* boolean
- *Default:* false
Whether to deploy a new VPC.
---
##### \`enableQueuePurging\`Optional
\`\`\`typescript
public readonly enableQueuePurging: boolean;
\`\`\`
- *Type:* boolean
- *Default:* "false", disabled by default.
Whether to grant additional permissions to the Lambda function enabling it to purge the SQS queue.
---
##### \`existingLambdaObj\`Optional
\`\`\`typescript
public readonly existingLambdaObj: Function;
\`\`\`
- *Type:* Function
- *Default:* None
Existing instance of Lambda Function object, providing both this and \`lambdaFunctionProps\` will cause an error.
---
##### \`existingQueueObj\`Optional
\`\`\`typescript
public readonly existingQueueObj: Queue;
\`\`\`
- *Type:* Queue
- *Default:* Default props are used
Existing instance of SQS queue object, Providing both this and queueProps will cause an error.
---
##### \`existingVpc\`Optional
\`\`\`typescript
public readonly existingVpc: IVpc;
\`\`\`
- *Type:* IVpc
An existing VPC for the construct to use (construct will NOT create a new VPC in this case).
---
##### \`lambdaFunctionProps\`Optional
\`\`\`typescript
public readonly lambdaFunctionProps: FunctionProps;
\`\`\`
- *Type:* FunctionProps
- *Default:* Default properties are used.
User provided props to override the default props for the Lambda function.
---
##### \`maxReceiveCount\`Optional
\`\`\`typescript
public readonly maxReceiveCount: number;
\`\`\`
- *Type:* number
- *Default:* required field if deployDeadLetterQueue=true.
The number of times a message can be unsuccessfully dequeued before being moved to the dead-letter queue.
---
##### \`queueEnvironmentVariableName\`Optional
\`\`\`typescript
public readonly queueEnvironmentVariableName: string;
\`\`\`
- *Type:* string
- *Default:* None
Optional Name for the SQS queue URL environment variable set for the Lambda function.
---
##### \`queueProps\`Optional
\`\`\`typescript
public readonly queueProps: QueueProps;
\`\`\`
- *Type:* QueueProps
- *Default:* Default props are used
Optional user-provided props to override the default props for the SQS queue.
---
##### \`vpcProps\`Optional
\`\`\`typescript
public readonly vpcProps: VpcProps;
\`\`\`
- *Type:* VpcProps
Properties to override default properties if deployVpc is true.
---
"
`;
exports[`complex link formatter csharp snapshot 1`] = `
"# Amazon ECR Construct Library
---


---
This package contains constructs for working with Amazon Elastic Container Registry.
## Repositories
Define a repository by creating a new instance of \`Repository\`. A repository
holds multiple verions of a single container image.
\`\`\`csharp
// Example automatically generated from non-compiling source. May contain errors.
var repository = new ecr.Repository(this, "Repository");
\`\`\`
## Image scanning
Amazon ECR image scanning helps in identifying software vulnerabilities in your container images. You can manually scan container images stored in Amazon ECR, or you can configure your repositories to scan images when you push them to a repository. To create a new repository to scan on push, simply enable \`imageScanOnPush\` in the properties
\`\`\`csharp
// Example automatically generated from non-compiling source. May contain errors.
var repository = new ecr.Repository(stack, "Repo", new Struct {
ImageScanOnPush = true
});
\`\`\`
To create an \`onImageScanCompleted\` event rule and trigger the event target
\`\`\`csharp
// Example automatically generated from non-compiling source. May contain errors.
repository.OnImageScanCompleted("ImageScanComplete").AddTarget(...);
\`\`\`
### Authorization Token
Besides the Amazon ECR APIs, ECR also allows the Docker CLI or a language-specific Docker library to push and pull
images from an ECR repository. However, the Docker CLI does not support native IAM authentication methods and
additional steps must be taken so that Amazon ECR can authenticate and authorize Docker push and pull requests.
More information can be found at at [Registry Authentication](https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html#registry_auth).
A Docker authorization token can be obtained using the \`GetAuthorizationToken\` ECR API. The following code snippets
grants an IAM user access to call this API.
\`\`\`csharp
// Example automatically generated from non-compiling source. May contain errors.
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.ECR;
var user = new User(this, "User", new UserProps { ... });
AuthorizationToken.GrantRead(user);
\`\`\`
If you access images in the [Public ECR Gallery](https://gallery.ecr.aws/) as well, it is recommended you authenticate to the registry to benefit from
higher rate and bandwidth limits.
> See \`Pricing\` in https://aws.amazon.com/blogs/aws/amazon-ecr-public-a-new-public-container-registry/ and [Service quotas](https://docs.aws.amazon.com/AmazonECR/latest/public/public-service-quotas.html).
The following code snippet grants an IAM user access to retrieve an authorization token for the public gallery.
\`\`\`csharp
// Example automatically generated from non-compiling source. May contain errors.
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.ECR;
var user = new User(this, "User", new UserProps { ... });
PublicGalleryAuthorizationToken.GrantRead(user);
\`\`\`
This user can then proceed to login to the registry using one of the [authentication methods](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth).
### Image tag immutability
You can set tag immutability on images in our repository using the \`imageTagMutability\` construct prop.
\`\`\`csharp
// Example automatically generated from non-compiling source. May contain errors.
new ecr.Repository(stack, "Repo", new Struct { ImageTagMutability = ecr.TagMutability.IMMUTABLE });
\`\`\`
## Automatically clean up repositories
You can set life cycle rules to automatically clean up old images from your
repository. The first life cycle rule that matches an image will be applied
against that image. For example, the following deletes images older than
30 days, while keeping all images tagged with prod (note that the order
is important here):
\`\`\`csharp
// Example automatically generated from non-compiling source. May contain errors.
repository.AddLifecycleRule(new Struct { TagPrefixList = new [] { "prod" }, MaxImageCount = 9999 });
repository.AddLifecycleRule(new Struct { MaxImageAge = cdk.Duration.Days(30) });
\`\`\`
# API Reference
## Constructs
### CfnPublicRepository
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::PublicRepository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
#### Initializers
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new CfnPublicRepository(Construct Scope, string Id, CfnPublicRepositoryProps Props = null);
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Scope
| Construct
| - scope in which this resource is defined. |
| Id
| string
| - scoped id of the resource. |
| Props
| CfnPublicRepositoryProps
| - resource properties. |
---
##### \`Scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`Id\`Required
- *Type:* string
scoped id of the resource.
---
##### \`Props\`Optional
- *Type:* CfnPublicRepositoryProps
resource properties.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| ToString
| Returns a string representation of this construct. |
| OverrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| AddDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| AddDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| AddMetadata
| Add a value to the CloudFormation Resource Metadata. |
| AddOverride
| Adds an override to the synthesized CloudFormation resource. |
| AddPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| AddPropertyOverride
| Adds an override to a resource property. |
| ApplyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| GetAtt
| Returns a token for an runtime attribute of this resource. |
| GetMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| Inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`ToString\`
\`\`\`csharp
private string ToString()
\`\`\`
Returns a string representation of this construct.
##### \`OverrideLogicalId\`
\`\`\`csharp
private void OverrideLogicalId(string NewLogicalId)
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`NewLogicalId\`Required
- *Type:* string
The new logical ID to use for this stack element.
---
##### \`AddDeletionOverride\`
\`\`\`csharp
private void AddDeletionOverride(string Path)
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`Path\`Required
- *Type:* string
The path of the value to delete.
---
##### \`AddDependsOn\`
\`\`\`csharp
private void AddDependsOn(CfnResource Target)
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`Target\`Required
- *Type:* CfnResource
---
##### \`AddMetadata\`
\`\`\`csharp
private void AddMetadata(string Key, object Value)
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`Key\`Required
- *Type:* string
---
###### \`Value\`Required
- *Type:* object
---
##### \`AddOverride\`
\`\`\`csharp
private void AddOverride(string Path, object Value)
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`Path\`Required
- *Type:* string
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`Value\`Required
- *Type:* object
The value.
Could be primitive or complex.
---
##### \`AddPropertyDeletionOverride\`
\`\`\`csharp
private void AddPropertyDeletionOverride(string PropertyPath)
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`PropertyPath\`Required
- *Type:* string
The path to the property.
---
##### \`AddPropertyOverride\`
\`\`\`csharp
private void AddPropertyOverride(string PropertyPath, object Value)
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`PropertyPath\`Required
- *Type:* string
The path of the property.
---
###### \`Value\`Required
- *Type:* object
The value.
---
##### \`ApplyRemovalPolicy\`
\`\`\`csharp
private void ApplyRemovalPolicy(RemovalPolicy Policy = null, RemovalPolicyOptions Options = null)
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`Policy\`Optional
- *Type:* RemovalPolicy
---
###### \`Options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`GetAtt\`
\`\`\`csharp
private Reference GetAtt(string AttributeName)
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`AttributeName\`Required
- *Type:* string
The name of the attribute.
---
##### \`GetMetadata\`
\`\`\`csharp
private object GetMetadata(string Key)
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`Key\`Required
- *Type:* string
---
##### \`Inspect\`
\`\`\`csharp
private void Inspect(TreeInspector Inspector)
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`Inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| IsConstruct
| Return whether the given object is a Construct. |
| IsCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| IsCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`IsConstruct\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnPublicRepository.IsConstruct(object X);
\`\`\`
Return whether the given object is a Construct.
###### \`X\`Required
- *Type:* object
---
##### \`IsCfnElement\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnPublicRepository.IsCfnElement(object X);
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`X\`Required
- *Type:* object
---
##### \`IsCfnResource\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnPublicRepository.IsCfnResource(IConstruct Construct);
\`\`\`
Check whether the given construct is a CfnResource.
###### \`Construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| ConstructNode
| The construct tree node associated with this construct. |
| CreationStack
| string[]
| *No description.* |
| LogicalId
| string
| The logical ID for this CloudFormation stack element. |
| Stack
| Stack
| The stack in which this element is defined. |
| Ref
| string
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| CfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| CfnResourceType
| string
| AWS resource type. |
| AttrArn
| string
| *No description.* |
| Tags
| TagManager
| \`AWS::ECR::PublicRepository.Tags\`. |
| RepositoryCatalogData
| object
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| RepositoryPolicyText
| object
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| RepositoryName
| string
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
---
##### \`Node\`Required
\`\`\`csharp
public ConstructNode Node { get; }
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`CreationStack\`Required
\`\`\`csharp
public string[] CreationStack { get; }
\`\`\`
- *Type:* string[]
---
##### \`LogicalId\`Required
\`\`\`csharp
public string LogicalId { get; }
\`\`\`
- *Type:* string
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`Stack\`Required
\`\`\`csharp
public Stack Stack { get; }
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`Ref\`Required
\`\`\`csharp
public string Ref { get; }
\`\`\`
- *Type:* string
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`CfnOptions\`Required
\`\`\`csharp
public ICfnResourceOptions CfnOptions { get; }
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`CfnResourceType\`Required
\`\`\`csharp
public string CfnResourceType { get; }
\`\`\`
- *Type:* string
AWS resource type.
---
##### \`AttrArn\`Required
\`\`\`csharp
public string AttrArn { get; }
\`\`\`
- *Type:* string
---
##### \`Tags\`Required
\`\`\`csharp
public TagManager Tags { get; }
\`\`\`
- *Type:* TagManager
\`AWS::ECR::PublicRepository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
---
##### \`RepositoryCatalogData\`Required
\`\`\`csharp
public object RepositoryCatalogData { get; }
\`\`\`
- *Type:* object
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`RepositoryPolicyText\`Required
\`\`\`csharp
public object RepositoryPolicyText { get; }
\`\`\`
- *Type:* object
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`RepositoryName\`Optional
\`\`\`csharp
public string RepositoryName { get; }
\`\`\`
- *Type:* string
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CfnResourceTypeName
| string
| The CloudFormation resource type name for this resource class. |
---
##### \`CfnResourceTypeName\`Required
\`\`\`csharp
public string CfnResourceTypeName { get; }
\`\`\`
- *Type:* string
The CloudFormation resource type name for this resource class.
---
### CfnRegistryPolicy
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::RegistryPolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html)
#### Initializers
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new CfnRegistryPolicy(Construct Scope, string Id, CfnRegistryPolicyProps Props);
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Scope
| Construct
| - scope in which this resource is defined. |
| Id
| string
| - scoped id of the resource. |
| Props
| CfnRegistryPolicyProps
| - resource properties. |
---
##### \`Scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`Id\`Required
- *Type:* string
scoped id of the resource.
---
##### \`Props\`Required
- *Type:* CfnRegistryPolicyProps
resource properties.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| ToString
| Returns a string representation of this construct. |
| OverrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| AddDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| AddDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| AddMetadata
| Add a value to the CloudFormation Resource Metadata. |
| AddOverride
| Adds an override to the synthesized CloudFormation resource. |
| AddPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| AddPropertyOverride
| Adds an override to a resource property. |
| ApplyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| GetAtt
| Returns a token for an runtime attribute of this resource. |
| GetMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| Inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`ToString\`
\`\`\`csharp
private string ToString()
\`\`\`
Returns a string representation of this construct.
##### \`OverrideLogicalId\`
\`\`\`csharp
private void OverrideLogicalId(string NewLogicalId)
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`NewLogicalId\`Required
- *Type:* string
The new logical ID to use for this stack element.
---
##### \`AddDeletionOverride\`
\`\`\`csharp
private void AddDeletionOverride(string Path)
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`Path\`Required
- *Type:* string
The path of the value to delete.
---
##### \`AddDependsOn\`
\`\`\`csharp
private void AddDependsOn(CfnResource Target)
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`Target\`Required
- *Type:* CfnResource
---
##### \`AddMetadata\`
\`\`\`csharp
private void AddMetadata(string Key, object Value)
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`Key\`Required
- *Type:* string
---
###### \`Value\`Required
- *Type:* object
---
##### \`AddOverride\`
\`\`\`csharp
private void AddOverride(string Path, object Value)
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`Path\`Required
- *Type:* string
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`Value\`Required
- *Type:* object
The value.
Could be primitive or complex.
---
##### \`AddPropertyDeletionOverride\`
\`\`\`csharp
private void AddPropertyDeletionOverride(string PropertyPath)
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`PropertyPath\`Required
- *Type:* string
The path to the property.
---
##### \`AddPropertyOverride\`
\`\`\`csharp
private void AddPropertyOverride(string PropertyPath, object Value)
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`PropertyPath\`Required
- *Type:* string
The path of the property.
---
###### \`Value\`Required
- *Type:* object
The value.
---
##### \`ApplyRemovalPolicy\`
\`\`\`csharp
private void ApplyRemovalPolicy(RemovalPolicy Policy = null, RemovalPolicyOptions Options = null)
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`Policy\`Optional
- *Type:* RemovalPolicy
---
###### \`Options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`GetAtt\`
\`\`\`csharp
private Reference GetAtt(string AttributeName)
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`AttributeName\`Required
- *Type:* string
The name of the attribute.
---
##### \`GetMetadata\`
\`\`\`csharp
private object GetMetadata(string Key)
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`Key\`Required
- *Type:* string
---
##### \`Inspect\`
\`\`\`csharp
private void Inspect(TreeInspector Inspector)
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`Inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| IsConstruct
| Return whether the given object is a Construct. |
| IsCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| IsCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`IsConstruct\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnRegistryPolicy.IsConstruct(object X);
\`\`\`
Return whether the given object is a Construct.
###### \`X\`Required
- *Type:* object
---
##### \`IsCfnElement\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnRegistryPolicy.IsCfnElement(object X);
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`X\`Required
- *Type:* object
---
##### \`IsCfnResource\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnRegistryPolicy.IsCfnResource(IConstruct Construct);
\`\`\`
Check whether the given construct is a CfnResource.
###### \`Construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| ConstructNode
| The construct tree node associated with this construct. |
| CreationStack
| string[]
| *No description.* |
| LogicalId
| string
| The logical ID for this CloudFormation stack element. |
| Stack
| Stack
| The stack in which this element is defined. |
| Ref
| string
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| CfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| CfnResourceType
| string
| AWS resource type. |
| AttrRegistryId
| string
| *No description.* |
| PolicyText
| object
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`Node\`Required
\`\`\`csharp
public ConstructNode Node { get; }
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`CreationStack\`Required
\`\`\`csharp
public string[] CreationStack { get; }
\`\`\`
- *Type:* string[]
---
##### \`LogicalId\`Required
\`\`\`csharp
public string LogicalId { get; }
\`\`\`
- *Type:* string
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`Stack\`Required
\`\`\`csharp
public Stack Stack { get; }
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`Ref\`Required
\`\`\`csharp
public string Ref { get; }
\`\`\`
- *Type:* string
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`CfnOptions\`Required
\`\`\`csharp
public ICfnResourceOptions CfnOptions { get; }
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`CfnResourceType\`Required
\`\`\`csharp
public string CfnResourceType { get; }
\`\`\`
- *Type:* string
AWS resource type.
---
##### \`AttrRegistryId\`Required
\`\`\`csharp
public string AttrRegistryId { get; }
\`\`\`
- *Type:* string
---
##### \`PolicyText\`Required
\`\`\`csharp
public object PolicyText { get; }
\`\`\`
- *Type:* object
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CfnResourceTypeName
| string
| The CloudFormation resource type name for this resource class. |
---
##### \`CfnResourceTypeName\`Required
\`\`\`csharp
public string CfnResourceTypeName { get; }
\`\`\`
- *Type:* string
The CloudFormation resource type name for this resource class.
---
### CfnReplicationConfiguration
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
#### Initializers
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new CfnReplicationConfiguration(Construct Scope, string Id, CfnReplicationConfigurationProps Props);
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Scope
| Construct
| - scope in which this resource is defined. |
| Id
| string
| - scoped id of the resource. |
| Props
| CfnReplicationConfigurationProps
| - resource properties. |
---
##### \`Scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`Id\`Required
- *Type:* string
scoped id of the resource.
---
##### \`Props\`Required
- *Type:* CfnReplicationConfigurationProps
resource properties.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| ToString
| Returns a string representation of this construct. |
| OverrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| AddDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| AddDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| AddMetadata
| Add a value to the CloudFormation Resource Metadata. |
| AddOverride
| Adds an override to the synthesized CloudFormation resource. |
| AddPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| AddPropertyOverride
| Adds an override to a resource property. |
| ApplyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| GetAtt
| Returns a token for an runtime attribute of this resource. |
| GetMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| Inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`ToString\`
\`\`\`csharp
private string ToString()
\`\`\`
Returns a string representation of this construct.
##### \`OverrideLogicalId\`
\`\`\`csharp
private void OverrideLogicalId(string NewLogicalId)
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`NewLogicalId\`Required
- *Type:* string
The new logical ID to use for this stack element.
---
##### \`AddDeletionOverride\`
\`\`\`csharp
private void AddDeletionOverride(string Path)
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`Path\`Required
- *Type:* string
The path of the value to delete.
---
##### \`AddDependsOn\`
\`\`\`csharp
private void AddDependsOn(CfnResource Target)
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`Target\`Required
- *Type:* CfnResource
---
##### \`AddMetadata\`
\`\`\`csharp
private void AddMetadata(string Key, object Value)
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`Key\`Required
- *Type:* string
---
###### \`Value\`Required
- *Type:* object
---
##### \`AddOverride\`
\`\`\`csharp
private void AddOverride(string Path, object Value)
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`Path\`Required
- *Type:* string
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`Value\`Required
- *Type:* object
The value.
Could be primitive or complex.
---
##### \`AddPropertyDeletionOverride\`
\`\`\`csharp
private void AddPropertyDeletionOverride(string PropertyPath)
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`PropertyPath\`Required
- *Type:* string
The path to the property.
---
##### \`AddPropertyOverride\`
\`\`\`csharp
private void AddPropertyOverride(string PropertyPath, object Value)
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`PropertyPath\`Required
- *Type:* string
The path of the property.
---
###### \`Value\`Required
- *Type:* object
The value.
---
##### \`ApplyRemovalPolicy\`
\`\`\`csharp
private void ApplyRemovalPolicy(RemovalPolicy Policy = null, RemovalPolicyOptions Options = null)
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`Policy\`Optional
- *Type:* RemovalPolicy
---
###### \`Options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`GetAtt\`
\`\`\`csharp
private Reference GetAtt(string AttributeName)
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`AttributeName\`Required
- *Type:* string
The name of the attribute.
---
##### \`GetMetadata\`
\`\`\`csharp
private object GetMetadata(string Key)
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`Key\`Required
- *Type:* string
---
##### \`Inspect\`
\`\`\`csharp
private void Inspect(TreeInspector Inspector)
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`Inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| IsConstruct
| Return whether the given object is a Construct. |
| IsCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| IsCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`IsConstruct\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnReplicationConfiguration.IsConstruct(object X);
\`\`\`
Return whether the given object is a Construct.
###### \`X\`Required
- *Type:* object
---
##### \`IsCfnElement\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnReplicationConfiguration.IsCfnElement(object X);
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`X\`Required
- *Type:* object
---
##### \`IsCfnResource\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnReplicationConfiguration.IsCfnResource(IConstruct Construct);
\`\`\`
Check whether the given construct is a CfnResource.
###### \`Construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| ConstructNode
| The construct tree node associated with this construct. |
| CreationStack
| string[]
| *No description.* |
| LogicalId
| string
| The logical ID for this CloudFormation stack element. |
| Stack
| Stack
| The stack in which this element is defined. |
| Ref
| string
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| CfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| CfnResourceType
| string
| AWS resource type. |
| AttrRegistryId
| string
| *No description.* |
| ReplicationConfiguration
| object
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`Node\`Required
\`\`\`csharp
public ConstructNode Node { get; }
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`CreationStack\`Required
\`\`\`csharp
public string[] CreationStack { get; }
\`\`\`
- *Type:* string[]
---
##### \`LogicalId\`Required
\`\`\`csharp
public string LogicalId { get; }
\`\`\`
- *Type:* string
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`Stack\`Required
\`\`\`csharp
public Stack Stack { get; }
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`Ref\`Required
\`\`\`csharp
public string Ref { get; }
\`\`\`
- *Type:* string
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`CfnOptions\`Required
\`\`\`csharp
public ICfnResourceOptions CfnOptions { get; }
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`CfnResourceType\`Required
\`\`\`csharp
public string CfnResourceType { get; }
\`\`\`
- *Type:* string
AWS resource type.
---
##### \`AttrRegistryId\`Required
\`\`\`csharp
public string AttrRegistryId { get; }
\`\`\`
- *Type:* string
---
##### \`ReplicationConfiguration\`Required
\`\`\`csharp
public object ReplicationConfiguration { get; }
\`\`\`
- *Type:* object
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CfnResourceTypeName
| string
| The CloudFormation resource type name for this resource class. |
---
##### \`CfnResourceTypeName\`Required
\`\`\`csharp
public string CfnResourceTypeName { get; }
\`\`\`
- *Type:* string
The CloudFormation resource type name for this resource class.
---
### CfnRepository
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::Repository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
#### Initializers
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new CfnRepository(Construct Scope, string Id, CfnRepositoryProps Props = null);
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Scope
| Construct
| - scope in which this resource is defined. |
| Id
| string
| - scoped id of the resource. |
| Props
| CfnRepositoryProps
| - resource properties. |
---
##### \`Scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`Id\`Required
- *Type:* string
scoped id of the resource.
---
##### \`Props\`Optional
- *Type:* CfnRepositoryProps
resource properties.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| ToString
| Returns a string representation of this construct. |
| OverrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| AddDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| AddDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| AddMetadata
| Add a value to the CloudFormation Resource Metadata. |
| AddOverride
| Adds an override to the synthesized CloudFormation resource. |
| AddPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| AddPropertyOverride
| Adds an override to a resource property. |
| ApplyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| GetAtt
| Returns a token for an runtime attribute of this resource. |
| GetMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| Inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`ToString\`
\`\`\`csharp
private string ToString()
\`\`\`
Returns a string representation of this construct.
##### \`OverrideLogicalId\`
\`\`\`csharp
private void OverrideLogicalId(string NewLogicalId)
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`NewLogicalId\`Required
- *Type:* string
The new logical ID to use for this stack element.
---
##### \`AddDeletionOverride\`
\`\`\`csharp
private void AddDeletionOverride(string Path)
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`Path\`Required
- *Type:* string
The path of the value to delete.
---
##### \`AddDependsOn\`
\`\`\`csharp
private void AddDependsOn(CfnResource Target)
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`Target\`Required
- *Type:* CfnResource
---
##### \`AddMetadata\`
\`\`\`csharp
private void AddMetadata(string Key, object Value)
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`Key\`Required
- *Type:* string
---
###### \`Value\`Required
- *Type:* object
---
##### \`AddOverride\`
\`\`\`csharp
private void AddOverride(string Path, object Value)
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`Path\`Required
- *Type:* string
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`Value\`Required
- *Type:* object
The value.
Could be primitive or complex.
---
##### \`AddPropertyDeletionOverride\`
\`\`\`csharp
private void AddPropertyDeletionOverride(string PropertyPath)
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`PropertyPath\`Required
- *Type:* string
The path to the property.
---
##### \`AddPropertyOverride\`
\`\`\`csharp
private void AddPropertyOverride(string PropertyPath, object Value)
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`PropertyPath\`Required
- *Type:* string
The path of the property.
---
###### \`Value\`Required
- *Type:* object
The value.
---
##### \`ApplyRemovalPolicy\`
\`\`\`csharp
private void ApplyRemovalPolicy(RemovalPolicy Policy = null, RemovalPolicyOptions Options = null)
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`Policy\`Optional
- *Type:* RemovalPolicy
---
###### \`Options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`GetAtt\`
\`\`\`csharp
private Reference GetAtt(string AttributeName)
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`AttributeName\`Required
- *Type:* string
The name of the attribute.
---
##### \`GetMetadata\`
\`\`\`csharp
private object GetMetadata(string Key)
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`Key\`Required
- *Type:* string
---
##### \`Inspect\`
\`\`\`csharp
private void Inspect(TreeInspector Inspector)
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`Inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| IsConstruct
| Return whether the given object is a Construct. |
| IsCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| IsCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`IsConstruct\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnRepository.IsConstruct(object X);
\`\`\`
Return whether the given object is a Construct.
###### \`X\`Required
- *Type:* object
---
##### \`IsCfnElement\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnRepository.IsCfnElement(object X);
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`X\`Required
- *Type:* object
---
##### \`IsCfnResource\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnRepository.IsCfnResource(IConstruct Construct);
\`\`\`
Check whether the given construct is a CfnResource.
###### \`Construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| ConstructNode
| The construct tree node associated with this construct. |
| CreationStack
| string[]
| *No description.* |
| LogicalId
| string
| The logical ID for this CloudFormation stack element. |
| Stack
| Stack
| The stack in which this element is defined. |
| Ref
| string
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| CfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| CfnResourceType
| string
| AWS resource type. |
| AttrArn
| string
| *No description.* |
| AttrRepositoryUri
| string
| *No description.* |
| Tags
| TagManager
| \`AWS::ECR::Repository.Tags\`. |
| EncryptionConfiguration
| object
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| ImageScanningConfiguration
| object
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| RepositoryPolicyText
| object
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| ImageTagMutability
| string
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| LifecyclePolicy
| object
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| RepositoryName
| string
| \`AWS::ECR::Repository.RepositoryName\`. |
---
##### \`Node\`Required
\`\`\`csharp
public ConstructNode Node { get; }
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`CreationStack\`Required
\`\`\`csharp
public string[] CreationStack { get; }
\`\`\`
- *Type:* string[]
---
##### \`LogicalId\`Required
\`\`\`csharp
public string LogicalId { get; }
\`\`\`
- *Type:* string
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`Stack\`Required
\`\`\`csharp
public Stack Stack { get; }
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`Ref\`Required
\`\`\`csharp
public string Ref { get; }
\`\`\`
- *Type:* string
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`CfnOptions\`Required
\`\`\`csharp
public ICfnResourceOptions CfnOptions { get; }
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`CfnResourceType\`Required
\`\`\`csharp
public string CfnResourceType { get; }
\`\`\`
- *Type:* string
AWS resource type.
---
##### \`AttrArn\`Required
\`\`\`csharp
public string AttrArn { get; }
\`\`\`
- *Type:* string
---
##### \`AttrRepositoryUri\`Required
\`\`\`csharp
public string AttrRepositoryUri { get; }
\`\`\`
- *Type:* string
---
##### \`Tags\`Required
\`\`\`csharp
public TagManager Tags { get; }
\`\`\`
- *Type:* TagManager
\`AWS::ECR::Repository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
---
##### \`EncryptionConfiguration\`Required
\`\`\`csharp
public object EncryptionConfiguration { get; }
\`\`\`
- *Type:* object
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`ImageScanningConfiguration\`Required
\`\`\`csharp
public object ImageScanningConfiguration { get; }
\`\`\`
- *Type:* object
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`RepositoryPolicyText\`Required
\`\`\`csharp
public object RepositoryPolicyText { get; }
\`\`\`
- *Type:* object
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`ImageTagMutability\`Optional
\`\`\`csharp
public string ImageTagMutability { get; }
\`\`\`
- *Type:* string
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`LifecyclePolicy\`Optional
\`\`\`csharp
public object LifecyclePolicy { get; }
\`\`\`
- *Type:* object
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`RepositoryName\`Optional
\`\`\`csharp
public string RepositoryName { get; }
\`\`\`
- *Type:* string
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CfnResourceTypeName
| string
| The CloudFormation resource type name for this resource class. |
---
##### \`CfnResourceTypeName\`Required
\`\`\`csharp
public string CfnResourceTypeName { get; }
\`\`\`
- *Type:* string
The CloudFormation resource type name for this resource class.
---
### Repository
Define an ECR repository.
#### Initializers
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new Repository(Construct Scope, string Id, RepositoryProps Props = null);
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Scope
| Construct
| *No description.* |
| Id
| string
| *No description.* |
| Props
| RepositoryProps
| *No description.* |
---
##### \`Scope\`Required
- *Type:* Construct
---
##### \`Id\`Required
- *Type:* string
---
##### \`Props\`Optional
- *Type:* RepositoryProps
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| ToString
| Returns a string representation of this construct. |
| ApplyRemovalPolicy
| Apply the given removal policy to this resource. |
| AddToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| Grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| GrantPull
| Grant the given identity permissions to use the images in this repository. |
| GrantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| OnCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| OnCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| OnEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| OnImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed. |
| RepositoryUriForDigest
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| RepositoryUriForTag
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| AddLifecycleRule
| Add a life cycle rule to the repository. |
---
##### \`ToString\`
\`\`\`csharp
private string ToString()
\`\`\`
Returns a string representation of this construct.
##### \`ApplyRemovalPolicy\`
\`\`\`csharp
private void ApplyRemovalPolicy(RemovalPolicy Policy)
\`\`\`
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (\`RemovalPolicy.DELETE\`), or left in your AWS
account for data recovery and cleanup later (\`RemovalPolicy.RETAIN\`).
###### \`Policy\`Required
- *Type:* RemovalPolicy
---
##### \`AddToResourcePolicy\`
\`\`\`csharp
private AddToResourcePolicyResult AddToResourcePolicy(PolicyStatement Statement)
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`Statement\`Required
- *Type:* PolicyStatement
---
##### \`Grant\`
\`\`\`csharp
private Grant Grant(IGrantable Grantee, string Actions)
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
###### \`Actions\`Required
- *Type:* string
---
##### \`GrantPull\`
\`\`\`csharp
private Grant GrantPull(IGrantable Grantee)
\`\`\`
Grant the given identity permissions to use the images in this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
##### \`GrantPullPush\`
\`\`\`csharp
private Grant GrantPullPush(IGrantable Grantee)
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
##### \`OnCloudTrailEvent\`
\`\`\`csharp
private Rule OnCloudTrailEvent(string Id, OnEventOptions Options = null)
\`\`\`
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.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`OnCloudTrailImagePushed\`
\`\`\`csharp
private Rule OnCloudTrailImagePushed(string Id, OnCloudTrailImagePushedOptions Options = null)
\`\`\`
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.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`OnEvent\`
\`\`\`csharp
private Rule OnEvent(string Id, OnEventOptions Options = null)
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`Id\`Required
- *Type:* string
---
###### \`Options\`Optional
- *Type:* OnEventOptions
---
##### \`OnImageScanCompleted\`
\`\`\`csharp
private Rule OnImageScanCompleted(string Id, OnImageScanCompletedOptions Options = null)
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`RepositoryUriForDigest\`
\`\`\`csharp
private string RepositoryUriForDigest(string Digest = null)
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`Digest\`Optional
- *Type:* string
Optional image digest.
---
##### \`RepositoryUriForTag\`
\`\`\`csharp
private string RepositoryUriForTag(string Tag = null)
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
###### \`Tag\`Optional
- *Type:* string
Optional image tag.
---
##### \`AddLifecycleRule\`
\`\`\`csharp
private void AddLifecycleRule(LifecycleRule Rule)
\`\`\`
Add a life cycle rule to the repository.
Life cycle rules automatically expire images from the repository that match
certain conditions.
###### \`Rule\`Required
- *Type:* LifecycleRule
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| IsConstruct
| Return whether the given object is a Construct. |
| IsResource
| Check whether the given construct is a Resource. |
| ArnForLocalRepository
| Returns an ECR ARN for a repository that resides in the same account/region as the current stack. |
| FromRepositoryArn
| *No description.* |
| FromRepositoryAttributes
| Import a repository. |
| FromRepositoryName
| *No description.* |
---
##### \`IsConstruct\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
Repository.IsConstruct(object X);
\`\`\`
Return whether the given object is a Construct.
###### \`X\`Required
- *Type:* object
---
##### \`IsResource\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
Repository.IsResource(IConstruct Construct);
\`\`\`
Check whether the given construct is a Resource.
###### \`Construct\`Required
- *Type:* IConstruct
---
##### \`ArnForLocalRepository\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
Repository.ArnForLocalRepository(string RepositoryName, IConstruct Scope, string Account = null);
\`\`\`
Returns an ECR ARN for a repository that resides in the same account/region as the current stack.
###### \`RepositoryName\`Required
- *Type:* string
---
###### \`Scope\`Required
- *Type:* IConstruct
---
###### \`Account\`Optional
- *Type:* string
---
##### \`FromRepositoryArn\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
Repository.FromRepositoryArn(Construct Scope, string Id, string RepositoryArn);
\`\`\`
###### \`Scope\`Required
- *Type:* Construct
---
###### \`Id\`Required
- *Type:* string
---
###### \`RepositoryArn\`Required
- *Type:* string
---
##### \`FromRepositoryAttributes\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
Repository.FromRepositoryAttributes(Construct Scope, string Id, RepositoryAttributes Attrs);
\`\`\`
Import a repository.
###### \`Scope\`Required
- *Type:* Construct
---
###### \`Id\`Required
- *Type:* string
---
###### \`Attrs\`Required
- *Type:* RepositoryAttributes
---
##### \`FromRepositoryName\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
Repository.FromRepositoryName(Construct Scope, string Id, string RepositoryName);
\`\`\`
###### \`Scope\`Required
- *Type:* Construct
---
###### \`Id\`Required
- *Type:* string
---
###### \`RepositoryName\`Required
- *Type:* string
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| ConstructNode
| The construct tree node associated with this construct. |
| Env
| ResourceEnvironment
| The environment this resource belongs to. |
| Stack
| Stack
| The stack in which this resource is defined. |
| RepositoryArn
| string
| The ARN of the repository. |
| RepositoryName
| string
| The name of the repository. |
| RepositoryUri
| string
| The URI of this repository (represents the latest image):. |
---
##### \`Node\`Required
\`\`\`csharp
public ConstructNode Node { get; }
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`Env\`Required
\`\`\`csharp
public ResourceEnvironment Env { get; }
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`Stack\`Required
\`\`\`csharp
public Stack Stack { get; }
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`RepositoryArn\`Required
\`\`\`csharp
public string RepositoryArn { get; }
\`\`\`
- *Type:* string
The ARN of the repository.
---
##### \`RepositoryName\`Required
\`\`\`csharp
public string RepositoryName { get; }
\`\`\`
- *Type:* string
The name of the repository.
---
##### \`RepositoryUri\`Required
\`\`\`csharp
public string RepositoryUri { get; }
\`\`\`
- *Type:* string
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
### RepositoryBase
- *Implements:* IRepository
Base class for ECR repository.
Reused between imported repositories and owned repositories.
#### Initializers
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new RepositoryBase(Construct Scope, string Id, ResourceProps Props = null);
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Scope
| Construct
| *No description.* |
| Id
| string
| *No description.* |
| Props
| ResourceProps
| *No description.* |
---
##### \`Scope\`Required
- *Type:* Construct
---
##### \`Id\`Required
- *Type:* string
---
##### \`Props\`Optional
- *Type:* ResourceProps
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| ToString
| Returns a string representation of this construct. |
| ApplyRemovalPolicy
| Apply the given removal policy to this resource. |
| AddToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| Grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| GrantPull
| Grant the given identity permissions to use the images in this repository. |
| GrantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| OnCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| OnCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| OnEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| OnImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed. |
| RepositoryUriForDigest
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| RepositoryUriForTag
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
---
##### \`ToString\`
\`\`\`csharp
private string ToString()
\`\`\`
Returns a string representation of this construct.
##### \`ApplyRemovalPolicy\`
\`\`\`csharp
private void ApplyRemovalPolicy(RemovalPolicy Policy)
\`\`\`
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (\`RemovalPolicy.DELETE\`), or left in your AWS
account for data recovery and cleanup later (\`RemovalPolicy.RETAIN\`).
###### \`Policy\`Required
- *Type:* RemovalPolicy
---
##### \`AddToResourcePolicy\`
\`\`\`csharp
private AddToResourcePolicyResult AddToResourcePolicy(PolicyStatement Statement)
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`Statement\`Required
- *Type:* PolicyStatement
---
##### \`Grant\`
\`\`\`csharp
private Grant Grant(IGrantable Grantee, string Actions)
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
###### \`Actions\`Required
- *Type:* string
---
##### \`GrantPull\`
\`\`\`csharp
private Grant GrantPull(IGrantable Grantee)
\`\`\`
Grant the given identity permissions to use the images in this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
##### \`GrantPullPush\`
\`\`\`csharp
private Grant GrantPullPush(IGrantable Grantee)
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
##### \`OnCloudTrailEvent\`
\`\`\`csharp
private Rule OnCloudTrailEvent(string Id, OnEventOptions Options = null)
\`\`\`
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.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`OnCloudTrailImagePushed\`
\`\`\`csharp
private Rule OnCloudTrailImagePushed(string Id, OnCloudTrailImagePushedOptions Options = null)
\`\`\`
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.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`OnEvent\`
\`\`\`csharp
private Rule OnEvent(string Id, OnEventOptions Options = null)
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`Id\`Required
- *Type:* string
---
###### \`Options\`Optional
- *Type:* OnEventOptions
---
##### \`OnImageScanCompleted\`
\`\`\`csharp
private Rule OnImageScanCompleted(string Id, OnImageScanCompletedOptions Options = null)
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`RepositoryUriForDigest\`
\`\`\`csharp
private string RepositoryUriForDigest(string Digest = null)
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`Digest\`Optional
- *Type:* string
Optional image digest.
---
##### \`RepositoryUriForTag\`
\`\`\`csharp
private string RepositoryUriForTag(string Tag = null)
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
###### \`Tag\`Optional
- *Type:* string
Optional image tag.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| IsConstruct
| Return whether the given object is a Construct. |
| IsResource
| Check whether the given construct is a Resource. |
---
##### \`IsConstruct\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
RepositoryBase.IsConstruct(object X);
\`\`\`
Return whether the given object is a Construct.
###### \`X\`Required
- *Type:* object
---
##### \`IsResource\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
RepositoryBase.IsResource(IConstruct Construct);
\`\`\`
Check whether the given construct is a Resource.
###### \`Construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| ConstructNode
| The construct tree node associated with this construct. |
| Env
| ResourceEnvironment
| The environment this resource belongs to. |
| Stack
| Stack
| The stack in which this resource is defined. |
| RepositoryArn
| string
| The ARN of the repository. |
| RepositoryName
| string
| The name of the repository. |
| RepositoryUri
| string
| The URI of this repository (represents the latest image):. |
---
##### \`Node\`Required
\`\`\`csharp
public ConstructNode Node { get; }
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`Env\`Required
\`\`\`csharp
public ResourceEnvironment Env { get; }
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`Stack\`Required
\`\`\`csharp
public Stack Stack { get; }
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`RepositoryArn\`Required
\`\`\`csharp
public string RepositoryArn { get; }
\`\`\`
- *Type:* string
The ARN of the repository.
---
##### \`RepositoryName\`Required
\`\`\`csharp
public string RepositoryName { get; }
\`\`\`
- *Type:* string
The name of the repository.
---
##### \`RepositoryUri\`Required
\`\`\`csharp
public string RepositoryUri { get; }
\`\`\`
- *Type:* string
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
## Structs
### CfnPublicRepositoryProps
Properties for defining a \`AWS::ECR::PublicRepository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new CfnPublicRepositoryProps {
object RepositoryCatalogData = null,
string RepositoryName = null,
object RepositoryPolicyText = null,
CfnTag[] Tags = null
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| RepositoryCatalogData
| object
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| RepositoryName
| string
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
| RepositoryPolicyText
| object
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| Tags
| CfnTag[]
| \`AWS::ECR::PublicRepository.Tags\`. |
---
##### \`RepositoryCatalogData\`Optional
\`\`\`csharp
public object RepositoryCatalogData { get; set; }
\`\`\`
- *Type:* object
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`RepositoryName\`Optional
\`\`\`csharp
public string RepositoryName { get; set; }
\`\`\`
- *Type:* string
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
##### \`RepositoryPolicyText\`Optional
\`\`\`csharp
public object RepositoryPolicyText { get; set; }
\`\`\`
- *Type:* object
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`Tags\`Optional
\`\`\`csharp
public CfnTag[] Tags { get; set; }
\`\`\`
- *Type:* CfnTag[]
\`AWS::ECR::PublicRepository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
---
### CfnRegistryPolicyProps
Properties for defining a \`AWS::ECR::RegistryPolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html)
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new CfnRegistryPolicyProps {
object PolicyText
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| PolicyText
| object
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`PolicyText\`Required
\`\`\`csharp
public object PolicyText { get; set; }
\`\`\`
- *Type:* object
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
### CfnReplicationConfigurationProps
Properties for defining a \`AWS::ECR::ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new CfnReplicationConfigurationProps {
object ReplicationConfiguration
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| ReplicationConfiguration
| object
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`ReplicationConfiguration\`Required
\`\`\`csharp
public object ReplicationConfiguration { get; set; }
\`\`\`
- *Type:* object
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
### CfnRepositoryProps
Properties for defining a \`AWS::ECR::Repository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new CfnRepositoryProps {
object EncryptionConfiguration = null,
object ImageScanningConfiguration = null,
string ImageTagMutability = null,
object LifecyclePolicy = null,
string RepositoryName = null,
object RepositoryPolicyText = null,
CfnTag[] Tags = null
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| EncryptionConfiguration
| object
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| ImageScanningConfiguration
| object
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| ImageTagMutability
| string
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| LifecyclePolicy
| object
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| RepositoryName
| string
| \`AWS::ECR::Repository.RepositoryName\`. |
| RepositoryPolicyText
| object
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| Tags
| CfnTag[]
| \`AWS::ECR::Repository.Tags\`. |
---
##### \`EncryptionConfiguration\`Optional
\`\`\`csharp
public object EncryptionConfiguration { get; set; }
\`\`\`
- *Type:* object
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`ImageScanningConfiguration\`Optional
\`\`\`csharp
public object ImageScanningConfiguration { get; set; }
\`\`\`
- *Type:* object
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`ImageTagMutability\`Optional
\`\`\`csharp
public string ImageTagMutability { get; set; }
\`\`\`
- *Type:* string
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`LifecyclePolicy\`Optional
\`\`\`csharp
public object LifecyclePolicy { get; set; }
\`\`\`
- *Type:* object
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`RepositoryName\`Optional
\`\`\`csharp
public string RepositoryName { get; set; }
\`\`\`
- *Type:* string
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
##### \`RepositoryPolicyText\`Optional
\`\`\`csharp
public object RepositoryPolicyText { get; set; }
\`\`\`
- *Type:* object
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`Tags\`Optional
\`\`\`csharp
public CfnTag[] Tags { get; set; }
\`\`\`
- *Type:* CfnTag[]
\`AWS::ECR::Repository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
---
### LifecyclePolicyProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html)
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new LifecyclePolicyProperty {
string LifecyclePolicyText = null,
string RegistryId = null
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| LifecyclePolicyText
| string
| \`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`. |
| RegistryId
| string
| \`CfnRepository.LifecyclePolicyProperty.RegistryId\`. |
---
##### \`LifecyclePolicyText\`Optional
\`\`\`csharp
public string LifecyclePolicyText { get; set; }
\`\`\`
- *Type:* string
\`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext)
---
##### \`RegistryId\`Optional
\`\`\`csharp
public string RegistryId { get; set; }
\`\`\`
- *Type:* string
\`CfnRepository.LifecyclePolicyProperty.RegistryId\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid)
---
### LifecycleRule
An ECR life cycle rule.
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new LifecycleRule {
string Description = null,
Duration MaxImageAge = null,
double MaxImageCount = null,
double RulePriority = null,
string[] TagPrefixList = null,
TagStatus TagStatus = null
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Description
| string
| Describes the purpose of the rule. |
| MaxImageAge
| Duration
| The maximum age of images to retain. The value must represent a number of days. |
| MaxImageCount
| double
| The maximum number of images to retain. |
| RulePriority
| double
| Controls the order in which rules are evaluated (low to high). |
| TagPrefixList
| string[]
| Select images that have ALL the given prefixes in their tag. |
| TagStatus
| TagStatus
| Select images based on tags. |
---
##### \`Description\`Optional
\`\`\`csharp
public string Description { get; set; }
\`\`\`
- *Type:* string
- *Default:* No description
Describes the purpose of the rule.
---
##### \`MaxImageAge\`Optional
\`\`\`csharp
public Duration MaxImageAge { get; set; }
\`\`\`
- *Type:* Duration
The maximum age of images to retain. The value must represent a number of days.
Specify exactly one of maxImageCount and maxImageAge.
---
##### \`MaxImageCount\`Optional
\`\`\`csharp
public double MaxImageCount { get; set; }
\`\`\`
- *Type:* double
The maximum number of images to retain.
Specify exactly one of maxImageCount and maxImageAge.
---
##### \`RulePriority\`Optional
\`\`\`csharp
public double RulePriority { get; set; }
\`\`\`
- *Type:* double
- *Default:* Automatically assigned
Controls the order in which rules are evaluated (low to high).
All rules must have a unique priority, where lower numbers have
higher precedence. The first rule that matches is applied to an image.
There can only be one rule with a tagStatus of Any, and it must have
the highest rulePriority.
All rules without a specified priority will have incrementing priorities
automatically assigned to them, higher than any rules that DO have priorities.
---
##### \`TagPrefixList\`Optional
\`\`\`csharp
public string[] TagPrefixList { get; set; }
\`\`\`
- *Type:* string[]
Select images that have ALL the given prefixes in their tag.
Only if tagStatus == TagStatus.Tagged
---
##### \`TagStatus\`Optional
\`\`\`csharp
public TagStatus TagStatus { get; set; }
\`\`\`
- *Type:* TagStatus
- *Default:* TagStatus.Tagged if tagPrefixList is given, TagStatus.Any otherwise
Select images based on tags.
Only one rule is allowed to select untagged images, and it must
have the highest rulePriority.
---
### OnCloudTrailImagePushedOptions
Options for the onCloudTrailImagePushed method.
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new OnCloudTrailImagePushedOptions {
string Description = null,
EventPattern EventPattern = null,
string RuleName = null,
IRuleTarget Target = null,
string ImageTag = null
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Description
| string
| A description of the rule's purpose. |
| EventPattern
| EventPattern
| Additional restrictions for the event to route to the specified target. |
| RuleName
| string
| A name for the rule. |
| Target
| IRuleTarget
| The target to register for the event. |
| ImageTag
| string
| Only watch changes to this image tag. |
---
##### \`Description\`Optional
\`\`\`csharp
public string Description { get; set; }
\`\`\`
- *Type:* string
- *Default:* No description
A description of the rule's purpose.
---
##### \`EventPattern\`Optional
\`\`\`csharp
public EventPattern EventPattern { get; set; }
\`\`\`
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
##### \`RuleName\`Optional
\`\`\`csharp
public string RuleName { get; set; }
\`\`\`
- *Type:* string
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
##### \`Target\`Optional
\`\`\`csharp
public IRuleTarget Target { get; set; }
\`\`\`
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`ImageTag\`Optional
\`\`\`csharp
public string ImageTag { get; set; }
\`\`\`
- *Type:* string
- *Default:* Watch changes to all tags
Only watch changes to this image tag.
---
### OnImageScanCompletedOptions
Options for the OnImageScanCompleted method.
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new OnImageScanCompletedOptions {
string Description = null,
EventPattern EventPattern = null,
string RuleName = null,
IRuleTarget Target = null,
string[] ImageTags = null
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Description
| string
| A description of the rule's purpose. |
| EventPattern
| EventPattern
| Additional restrictions for the event to route to the specified target. |
| RuleName
| string
| A name for the rule. |
| Target
| IRuleTarget
| The target to register for the event. |
| ImageTags
| string[]
| Only watch changes to the image tags spedified. |
---
##### \`Description\`Optional
\`\`\`csharp
public string Description { get; set; }
\`\`\`
- *Type:* string
- *Default:* No description
A description of the rule's purpose.
---
##### \`EventPattern\`Optional
\`\`\`csharp
public EventPattern EventPattern { get; set; }
\`\`\`
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
##### \`RuleName\`Optional
\`\`\`csharp
public string RuleName { get; set; }
\`\`\`
- *Type:* string
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
##### \`Target\`Optional
\`\`\`csharp
public IRuleTarget Target { get; set; }
\`\`\`
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`ImageTags\`Optional
\`\`\`csharp
public string[] ImageTags { get; set; }
\`\`\`
- *Type:* string[]
- *Default:* Watch the changes to the repository with all image tags
Only watch changes to the image tags spedified.
Leave it undefined to watch the full repository.
---
### ReplicationConfigurationProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html)
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new ReplicationConfigurationProperty {
object Rules
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Rules
| object
| \`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`. |
---
##### \`Rules\`Required
\`\`\`csharp
public object Rules { get; set; }
\`\`\`
- *Type:* object
\`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules)
---
### ReplicationDestinationProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html)
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new ReplicationDestinationProperty {
string Region,
string RegistryId
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Region
| string
| \`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`. |
| RegistryId
| string
| \`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`. |
---
##### \`Region\`Required
\`\`\`csharp
public string Region { get; set; }
\`\`\`
- *Type:* string
\`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region)
---
##### \`RegistryId\`Required
\`\`\`csharp
public string RegistryId { get; set; }
\`\`\`
- *Type:* string
\`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid)
---
### ReplicationRuleProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html)
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new ReplicationRuleProperty {
object Destinations
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Destinations
| object
| \`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`. |
---
##### \`Destinations\`Required
\`\`\`csharp
public object Destinations { get; set; }
\`\`\`
- *Type:* object
\`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations)
---
### RepositoryAttributes
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new RepositoryAttributes {
string RepositoryArn,
string RepositoryName
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| RepositoryArn
| string
| *No description.* |
| RepositoryName
| string
| *No description.* |
---
##### \`RepositoryArn\`Required
\`\`\`csharp
public string RepositoryArn { get; set; }
\`\`\`
- *Type:* string
---
##### \`RepositoryName\`Required
\`\`\`csharp
public string RepositoryName { get; set; }
\`\`\`
- *Type:* string
---
### RepositoryProps
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new RepositoryProps {
bool ImageScanOnPush = null,
TagMutability ImageTagMutability = null,
string LifecycleRegistryId = null,
LifecycleRule[] LifecycleRules = null,
RemovalPolicy RemovalPolicy = null,
string RepositoryName = null
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| ImageScanOnPush
| bool
| Enable the scan on push when creating the repository. |
| ImageTagMutability
| TagMutability
| The tag mutability setting for the repository. |
| LifecycleRegistryId
| string
| The AWS account ID associated with the registry that contains the repository. |
| LifecycleRules
| LifecycleRule[]
| Life cycle rules to apply to this registry. |
| RemovalPolicy
| RemovalPolicy
| Determine what happens to the repository when the resource/stack is deleted. |
| RepositoryName
| string
| Name for this repository. |
---
##### \`ImageScanOnPush\`Optional
\`\`\`csharp
public bool ImageScanOnPush { get; set; }
\`\`\`
- *Type:* bool
- *Default:* false
Enable the scan on push when creating the repository.
---
##### \`ImageTagMutability\`Optional
\`\`\`csharp
public TagMutability ImageTagMutability { get; set; }
\`\`\`
- *Type:* TagMutability
- *Default:* TagMutability.MUTABLE
The tag mutability setting for the repository.
If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten.
---
##### \`LifecycleRegistryId\`Optional
\`\`\`csharp
public string LifecycleRegistryId { get; set; }
\`\`\`
- *Type:* string
- *Default:* The default registry is assumed.
The AWS account ID associated with the registry that contains the repository.
> [https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html](https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html)
---
##### \`LifecycleRules\`Optional
\`\`\`csharp
public LifecycleRule[] LifecycleRules { get; set; }
\`\`\`
- *Type:* LifecycleRule[]
- *Default:* No life cycle rules
Life cycle rules to apply to this registry.
---
##### \`RemovalPolicy\`Optional
\`\`\`csharp
public RemovalPolicy RemovalPolicy { get; set; }
\`\`\`
- *Type:* RemovalPolicy
- *Default:* RemovalPolicy.Retain
Determine what happens to the repository when the resource/stack is deleted.
---
##### \`RepositoryName\`Optional
\`\`\`csharp
public string RepositoryName { get; set; }
\`\`\`
- *Type:* string
- *Default:* Automatically generated name.
Name for this repository.
---
## Classes
### AuthorizationToken
Authorization token to access private ECR repositories in the current environment via Docker CLI.
> [https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html](https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html)
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| GrantRead
| Grant access to retrieve an authorization token. |
---
##### \`GrantRead\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
AuthorizationToken.GrantRead(IGrantable Grantee);
\`\`\`
Grant access to retrieve an authorization token.
###### \`Grantee\`Required
- *Type:* IGrantable
---
### PublicGalleryAuthorizationToken
Authorization token to access the global public ECR Gallery via Docker CLI.
> [https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth)
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| GrantRead
| Grant access to retrieve an authorization token. |
---
##### \`GrantRead\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
PublicGalleryAuthorizationToken.GrantRead(IGrantable Grantee);
\`\`\`
Grant access to retrieve an authorization token.
###### \`Grantee\`Required
- *Type:* IGrantable
---
## Protocols
### IRepository
- *Extends:* IResource
- *Implemented By:* Repository, RepositoryBase, IRepository
Represents an ECR repository.
#### Methods
| **Name** | **Description** |
| --- | --- |
| AddToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| Grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| GrantPull
| Grant the given identity permissions to pull images in this repository. |
| GrantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| OnCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| OnCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| OnEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| OnImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed. |
| RepositoryUriForDigest
| Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`. |
| RepositoryUriForTag
| Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`. |
---
##### \`AddToResourcePolicy\`
\`\`\`csharp
private AddToResourcePolicyResult AddToResourcePolicy(PolicyStatement Statement)
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`Statement\`Required
- *Type:* PolicyStatement
---
##### \`Grant\`
\`\`\`csharp
private Grant Grant(IGrantable Grantee, string Actions)
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
###### \`Actions\`Required
- *Type:* string
---
##### \`GrantPull\`
\`\`\`csharp
private Grant GrantPull(IGrantable Grantee)
\`\`\`
Grant the given identity permissions to pull images in this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
##### \`GrantPullPush\`
\`\`\`csharp
private Grant GrantPullPush(IGrantable Grantee)
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
##### \`OnCloudTrailEvent\`
\`\`\`csharp
private Rule OnCloudTrailEvent(string Id, OnEventOptions Options = null)
\`\`\`
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.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`OnCloudTrailImagePushed\`
\`\`\`csharp
private Rule OnCloudTrailImagePushed(string Id, OnCloudTrailImagePushedOptions Options = null)
\`\`\`
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.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`OnEvent\`
\`\`\`csharp
private Rule OnEvent(string Id, OnEventOptions Options = null)
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`Id\`Required
- *Type:* string
---
###### \`Options\`Optional
- *Type:* OnEventOptions
---
##### \`OnImageScanCompleted\`
\`\`\`csharp
private Rule OnImageScanCompleted(string Id, OnImageScanCompletedOptions Options = null)
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`RepositoryUriForDigest\`
\`\`\`csharp
private string RepositoryUriForDigest(string Digest = null)
\`\`\`
Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`Digest\`Optional
- *Type:* string
Image digest to use (tools usually default to the image with the "latest" tag if omitted).
---
##### \`RepositoryUriForTag\`
\`\`\`csharp
private string RepositoryUriForTag(string Tag = null)
\`\`\`
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]
###### \`Tag\`Optional
- *Type:* string
Image tag to use (tools usually default to "latest" if omitted).
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| ConstructNode
| The construct tree node for this construct. |
| Env
| ResourceEnvironment
| The environment this resource belongs to. |
| Stack
| Stack
| The stack in which this resource is defined. |
| RepositoryArn
| string
| The ARN of the repository. |
| RepositoryName
| string
| The name of the repository. |
| RepositoryUri
| string
| The URI of this repository (represents the latest image):. |
---
##### \`Node\`Required
\`\`\`csharp
public ConstructNode Node { get; }
\`\`\`
- *Type:* ConstructNode
The construct tree node for this construct.
---
##### \`Env\`Required
\`\`\`csharp
public ResourceEnvironment Env { get; }
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`Stack\`Required
\`\`\`csharp
public Stack Stack { get; }
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`RepositoryArn\`Required
\`\`\`csharp
public string RepositoryArn { get; }
\`\`\`
- *Type:* string
The ARN of the repository.
---
##### \`RepositoryName\`Required
\`\`\`csharp
public string RepositoryName { get; }
\`\`\`
- *Type:* string
The name of the repository.
---
##### \`RepositoryUri\`Required
\`\`\`csharp
public string RepositoryUri { get; }
\`\`\`
- *Type:* string
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
## Enums
### TagMutability
The tag mutability setting for your repository.
#### Members
| **Name** | **Description** |
| --- | --- |
| MUTABLE
| allow image tags to be overwritten. |
| IMMUTABLE
| all image tags within the repository will be immutable which will prevent them from being overwritten. |
---
##### \`MUTABLE\`
allow image tags to be overwritten.
---
##### \`IMMUTABLE\`
all image tags within the repository will be immutable which will prevent them from being overwritten.
---
### TagStatus
Select images based on tags.
#### Members
| **Name** | **Description** |
| --- | --- |
| ANY
| Rule applies to all images. |
| TAGGED
| Rule applies to tagged images. |
| UNTAGGED
| Rule applies to untagged images. |
---
##### \`ANY\`
Rule applies to all images.
---
##### \`TAGGED\`
Rule applies to tagged images.
---
##### \`UNTAGGED\`
Rule applies to untagged images.
---
"
`;
exports[`complex link formatter go snapshot 1`] = `
"# Constructs
> Software-defined persistent state

[](https://badge.fury.io/js/constructs)
[](https://badge.fury.io/py/constructs)
[](https://badge.fury.io/nu/Constructs)
[](https://maven-badges.herokuapp.com/maven-central/software.constructs/constructs)
## What are constructs?
Constructs are classes which define a "piece of system state". Constructs can be composed together to form higher-level building blocks which represent more complex state.
Constructs are often used to represent the *desired state* of cloud applications. For example, in the AWS CDK, which is used to define the desired state for AWS infrastructure using CloudFormation, the lowest-level construct represents a *resource definition* in a CloudFormation template. These resources are composed to represent higher-level logical units of a cloud application, etc.
## Contributing
This project has adopted the [Amazon Open Source Code of
Conduct](https://aws.github.io/code-of-conduct).
We welcome community contributions and pull requests. See our [contribution
guide](./CONTRIBUTING.md) for more information on how to report issues, set up a
development environment and submit code.
## License
This project is distributed under the [Apache License, Version 2.0](./LICENSE).
# API Reference
## Constructs
### Construct
- *Implements:* IConstruct
Represents the building block of the construct graph.
All constructs besides the root construct must be created within the scope of
another construct.
#### Initializers
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.NewConstruct(scope Construct, id *string) Construct
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| The scope in which to define this construct. |
| id
| *string
| The scoped construct ID. |
---
##### \`scope\`Required
- *Type:* Construct
The scope in which to define this construct.
---
##### \`id\`Required
- *Type:* *string
The scoped construct ID.
Must be unique amongst siblings. If
the ID includes a path separator (\`/\`), then it will be replaced by double
dash \`--\`.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| ToString
| Returns a string representation of this construct. |
---
##### \`ToString\`
\`\`\`go
func ToString() *string
\`\`\`
Returns a string representation of this construct.
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| IsConstruct
| Checks if \`x\` is a construct. |
---
##### ~~\`IsConstruct\`~~
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.Construct_IsConstruct(x interface{}) *bool
\`\`\`
Checks if \`x\` is a construct.
###### \`x\`Required
- *Type:* interface{}
Any object.
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| Node
| The tree node. |
---
##### \`Node\`Required
\`\`\`go
func Node() Node
\`\`\`
- *Type:* Node
The tree node.
---
## Structs
### MetadataEntry
An entry in the construct metadata table.
#### Initializer
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
&constructs.MetadataEntry {
Data: interface{},
Type: *string,
Trace: *[]*string,
}
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Data
| interface{}
| The data. |
| Type
| *string
| The metadata entry type. |
| Trace
| *[]*string
| Stack trace at the point of adding the metadata. |
---
##### \`Data\`Required
\`\`\`go
Data interface{}
\`\`\`
- *Type:* interface{}
The data.
---
##### \`Type\`Required
\`\`\`go
Type *string
\`\`\`
- *Type:* *string
The metadata entry type.
---
##### \`Trace\`Optional
\`\`\`go
Trace *[]*string
\`\`\`
- *Type:* *[]*string
- *Default:* no trace information
Stack trace at the point of adding the metadata.
Only available if \`addMetadata()\` is called with \`stackTrace: true\`.
---
### MetadataOptions
Options for \`construct.addMetadata()\`.
#### Initializer
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
&constructs.MetadataOptions {
StackTrace: *bool,
TraceFromFunction: interface{},
}
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| StackTrace
| *bool
| Include stack trace with metadata entry. |
| TraceFromFunction
| interface{}
| A JavaScript function to begin tracing from. |
---
##### \`StackTrace\`Optional
\`\`\`go
StackTrace *bool
\`\`\`
- *Type:* *bool
- *Default:* false
Include stack trace with metadata entry.
---
##### \`TraceFromFunction\`Optional
\`\`\`go
TraceFromFunction interface{}
\`\`\`
- *Type:* interface{}
- *Default:* addMetadata()
A JavaScript function to begin tracing from.
This option is ignored unless \`stackTrace\` is \`true\`.
---
## Classes
### Dependable
Trait for IDependable.
Traits are interfaces that are privately implemented by objects. Instead of
showing up in the public interface of a class, they need to be queried
explicitly. This is used to implement certain framework features that are
not intended to be used by Construct consumers, and so should be hidden
from accidental use.
*Example*
\`\`\`go
// Example automatically generated from non-compiling source. May contain errors.
// Usage
roots := dependableTrait_Get(construct).dependencyRoots
// Definition
dependableTrait_Implement(construct, map[string]interface{}{
get dependencyRoots() { return []; },
})
\`\`\`
#### Initializers
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.NewDependable() Dependable
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| Get
| Return the matching Dependable for the given class instance. |
| Implement
| Turn any object into an IDependable. |
| Of
| Return the matching Dependable for the given class instance. |
---
##### ~~\`Get\`~~
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.Dependable_Get(instance IDependable) Dependable
\`\`\`
Return the matching Dependable for the given class instance.
###### \`instance\`Required
- *Type:* IDependable
---
##### \`Implement\`
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.Dependable_Implement(instance IDependable, trait Dependable)
\`\`\`
Turn any object into an IDependable.
###### \`instance\`Required
- *Type:* IDependable
---
###### \`trait\`Required
- *Type:* Dependable
---
##### \`Of\`
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.Dependable_Of(instance IDependable) Dependable
\`\`\`
Return the matching Dependable for the given class instance.
###### \`instance\`Required
- *Type:* IDependable
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| DependencyRoots
| *[]IConstruct
| The set of constructs that form the root of this dependable. |
---
##### \`DependencyRoots\`Required
\`\`\`go
func DependencyRoots() *[]IConstruct
\`\`\`
- *Type:* *[]IConstruct
The set of constructs that form the root of this dependable.
All resources under all returned constructs are included in the ordering
dependency.
---
### DependencyGroup
- *Implements:* IDependable
A set of constructs to be used as a dependable.
This class can be used when a set of constructs which are disjoint in the
construct tree needs to be combined to be used as a single dependable.
#### Initializers
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.NewDependencyGroup(deps IDependable) DependencyGroup
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| deps
| IDependable
| *No description.* |
---
##### \`deps\`Required
- *Type:* IDependable
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| Add
| Add a construct to the dependency roots. |
---
##### \`Add\`
\`\`\`go
func Add(scopes IDependable)
\`\`\`
Add a construct to the dependency roots.
###### \`scopes\`Required
- *Type:* IDependable
---
### Node
Represents the construct node in the scope tree.
#### Initializers
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.NewNode(host Construct, scope IConstruct, id *string) Node
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| host
| Construct
| *No description.* |
| scope
| IConstruct
| *No description.* |
| id
| *string
| *No description.* |
---
##### \`host\`Required
- *Type:* Construct
---
##### \`scope\`Required
- *Type:* IConstruct
---
##### \`id\`Required
- *Type:* *string
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| AddDependency
| Add an ordering dependency on another construct. |
| AddMetadata
| Adds a metadata entry to this construct. |
| AddValidation
| Adds a validation to this construct. |
| FindAll
| Return this construct and all of its children in the given order. |
| FindChild
| Return a direct child by id. |
| Lock
| Locks this construct from allowing more children to be added. |
| SetContext
| This can be used to set contextual values. |
| TryFindChild
| Return a direct child by id, or undefined. |
| TryGetContext
| Retrieves a value from tree context. |
| TryRemoveChild
| Remove the child with the given name, if present. |
| Validate
| Validates this construct. |
---
##### \`AddDependency\`
\`\`\`go
func AddDependency(deps IDependable)
\`\`\`
Add an ordering dependency on another construct.
An \`IDependable\`
###### \`deps\`Required
- *Type:* IDependable
---
##### \`AddMetadata\`
\`\`\`go
func AddMetadata(type *string, data interface{}, options MetadataOptions)
\`\`\`
Adds a metadata entry to this construct.
Entries are arbitrary values and will also include a stack trace to allow tracing back to
the code location for when the entry was added. It can be used, for example, to include source
mapping in CloudFormation templates to improve diagnostics.
###### \`type\`Required
- *Type:* *string
a string denoting the type of metadata.
---
###### \`data\`Required
- *Type:* interface{}
the value of the metadata (can be a Token).
If null/undefined, metadata will not be added.
---
###### \`options\`Optional
- *Type:* MetadataOptions
options.
---
##### \`AddValidation\`
\`\`\`go
func AddValidation(validation IValidation)
\`\`\`
Adds a validation to this construct.
When \`node.validate()\` is called, the \`validate()\` method will be called on
all validations and all errors will be returned.
###### \`validation\`Required
- *Type:* IValidation
The validation object.
---
##### \`FindAll\`
\`\`\`go
func FindAll(order ConstructOrder) *[]IConstruct
\`\`\`
Return this construct and all of its children in the given order.
###### \`order\`Optional
- *Type:* ConstructOrder
---
##### \`FindChild\`
\`\`\`go
func FindChild(id *string) IConstruct
\`\`\`
Return a direct child by id.
Throws an error if the child is not found.
###### \`id\`Required
- *Type:* *string
Identifier of direct child.
---
##### \`Lock\`
\`\`\`go
func Lock()
\`\`\`
Locks this construct from allowing more children to be added.
After this
call, no more children can be added to this construct or to any children.
##### \`SetContext\`
\`\`\`go
func SetContext(key *string, value interface{})
\`\`\`
This can be used to set contextual values.
Context must be set before any children are added, since children may consult context info during construction.
If the key already exists, it will be overridden.
###### \`key\`Required
- *Type:* *string
The context key.
---
###### \`value\`Required
- *Type:* interface{}
The context value.
---
##### \`TryFindChild\`
\`\`\`go
func TryFindChild(id *string) IConstruct
\`\`\`
Return a direct child by id, or undefined.
###### \`id\`Required
- *Type:* *string
Identifier of direct child.
---
##### \`TryGetContext\`
\`\`\`go
func TryGetContext(key *string) interface{}
\`\`\`
Retrieves a value from tree context.
Context is usually initialized at the root, but can be overridden at any point in the tree.
###### \`key\`Required
- *Type:* *string
The context key.
---
##### \`TryRemoveChild\`
\`\`\`go
func TryRemoveChild(childName *string) *bool
\`\`\`
Remove the child with the given name, if present.
###### \`childName\`Required
- *Type:* *string
---
##### \`Validate\`
\`\`\`go
func Validate() *[]*string
\`\`\`
Validates this construct.
Invokes the \`validate()\` method on all validations added through
\`addValidation()\`.
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| Of
| Returns the node associated with a construct. |
---
##### ~~\`Of\`~~
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.Node_Of(construct IConstruct) Node
\`\`\`
Returns the node associated with a construct.
###### \`construct\`Required
- *Type:* IConstruct
the construct.
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Addr
| *string
| Returns an opaque tree-unique address for this construct. |
| Children
| *[]IConstruct
| All direct children of this construct. |
| Dependencies
| *[]IConstruct
| Return all dependencies registered on this node (non-recursive). |
| Id
| *string
| The id of this construct within the current scope. |
| Locked
| *bool
| Returns true if this construct or the scopes in which it is defined are locked. |
| Metadata
| *[]MetadataEntry
| An immutable array of metadata objects associated with this construct. |
| Path
| *string
| The full, absolute path of this construct in the tree. |
| Root
| IConstruct
| Returns the root of the construct tree. |
| Scopes
| *[]IConstruct
| All parent scopes of this construct. |
| Scope
| IConstruct
| Returns the scope in which this construct is defined. |
| DefaultChild
| IConstruct
| Returns the child construct that has the id \`Default\` or \`Resource"\`. |
---
##### \`Addr\`Required
\`\`\`go
func Addr() *string
\`\`\`
- *Type:* *string
Returns an opaque tree-unique address for this construct.
Addresses are 42 characters hexadecimal strings. They begin with "c8"
followed by 40 lowercase hexadecimal characters (0-9a-f).
Addresses are calculated using a SHA-1 of the components of the construct
path.
To enable refactorings of construct trees, constructs with the ID \`Default\`
will be excluded from the calculation. In those cases constructs in the
same tree may have the same addreess.
---
*Example*
\`\`\`go
// Example automatically generated from non-compiling source. May contain errors.
c83a2846e506bcc5f10682b564084bca2d275709ee
\`\`\`
##### \`Children\`Required
\`\`\`go
func Children() *[]IConstruct
\`\`\`
- *Type:* *[]IConstruct
All direct children of this construct.
---
##### \`Dependencies\`Required
\`\`\`go
func Dependencies() *[]IConstruct
\`\`\`
- *Type:* *[]IConstruct
Return all dependencies registered on this node (non-recursive).
---
##### \`Id\`Required
\`\`\`go
func Id() *string
\`\`\`
- *Type:* *string
The id of this construct within the current scope.
This is a a scope-unique id. To obtain an app-unique id for this construct, use \`addr\`.
---
##### \`Locked\`Required
\`\`\`go
func Locked() *bool
\`\`\`
- *Type:* *bool
Returns true if this construct or the scopes in which it is defined are locked.
---
##### \`Metadata\`Required
\`\`\`go
func Metadata() *[]MetadataEntry
\`\`\`
- *Type:* *[]MetadataEntry
An immutable array of metadata objects associated with this construct.
This can be used, for example, to implement support for deprecation notices, source mapping, etc.
---
##### \`Path\`Required
\`\`\`go
func Path() *string
\`\`\`
- *Type:* *string
The full, absolute path of this construct in the tree.
Components are separated by '/'.
---
##### \`Root\`Required
\`\`\`go
func Root() IConstruct
\`\`\`
- *Type:* IConstruct
Returns the root of the construct tree.
---
##### \`Scopes\`Required
\`\`\`go
func Scopes() *[]IConstruct
\`\`\`
- *Type:* *[]IConstruct
All parent scopes of this construct.
---
##### \`Scope\`Optional
\`\`\`go
func Scope() IConstruct
\`\`\`
- *Type:* IConstruct
Returns the scope in which this construct is defined.
The value is \`undefined\` at the root of the construct scope tree.
---
##### \`DefaultChild\`Optional
\`\`\`go
func DefaultChild() IConstruct
\`\`\`
- *Type:* IConstruct
Returns the child construct that has the id \`Default\` or \`Resource"\`.
This is usually the construct that provides the bulk of the underlying functionality.
Useful for modifications of the underlying construct that are not available at the higher levels.
Override the defaultChild property.
This should only be used in the cases where the correct
default child is not named 'Resource' or 'Default' as it
should be.
If you set this to undefined, the default behavior of finding
the child named 'Resource' or 'Default' will be used.
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| PathSep
| *string
| Separator used to delimit construct path components. |
---
##### \`PathSep\`Required
\`\`\`go
func PathSep() *string
\`\`\`
- *Type:* *string
Separator used to delimit construct path components.
---
## Protocols
### IConstruct
- *Extends:* IDependable
- *Implemented By:* Construct, IConstruct
Represents a construct.
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| Node
| The tree node. |
---
##### \`Node\`Required
\`\`\`go
func Node() Node
\`\`\`
- *Type:* Node
The tree node.
---
### IDependable
- *Implemented By:* Construct, DependencyGroup, IConstruct, IDependable
Trait marker for classes that can be depended upon.
The presence of this interface indicates that an object has
an \`IDependableTrait\` implementation.
This interface can be used to take an (ordering) dependency on a set of
constructs. An ordering dependency implies that the resources represented by
those constructs are deployed before the resources depending ON them are
deployed.
### IValidation
- *Implemented By:* IValidation
Implement this interface in order for the construct to be able to validate itself.
Implement this interface in order for the construct to be able to validate itself.
#### Methods
| **Name** | **Description** |
| --- | --- |
| Validate
| Validate the current construct. |
---
##### \`Validate\`
\`\`\`go
func Validate() *[]*string
\`\`\`
Validate the current construct.
This method can be implemented by derived constructs in order to perform
validation logic. It is called on all constructs before synthesis.
Validate the current construct.
This method can be implemented by derived constructs in order to perform
validation logic. It is called on all constructs before synthesis.
## Enums
### ConstructOrder
In what order to return constructs.
#### Members
| **Name** | **Description** |
| --- | --- |
| ConstructOrder_PREORDER
| Depth-first, pre-order. |
| ConstructOrder_POSTORDER
| Depth-first, post-order (leaf nodes first). |
---
##### \`ConstructOrder_PREORDER\`
Depth-first, pre-order.
---
##### \`ConstructOrder_POSTORDER\`
Depth-first, post-order (leaf nodes first).
---
"
`;
exports[`complex link formatter java snapshot 1`] = `
"# Amazon ECR Construct Library
---


---
This package contains constructs for working with Amazon Elastic Container Registry.
## Repositories
Define a repository by creating a new instance of \`Repository\`. A repository
holds multiple verions of a single container image.
\`\`\`java
// Example automatically generated from non-compiling source. May contain errors.
Object repository = new Repository(this, "Repository");
\`\`\`
## Image scanning
Amazon ECR image scanning helps in identifying software vulnerabilities in your container images. You can manually scan container images stored in Amazon ECR, or you can configure your repositories to scan images when you push them to a repository. To create a new repository to scan on push, simply enable \`imageScanOnPush\` in the properties
\`\`\`java
// Example automatically generated from non-compiling source. May contain errors.
Object repository = Repository.Builder.create(stack, "Repo")
.imageScanOnPush(true)
.build();
\`\`\`
To create an \`onImageScanCompleted\` event rule and trigger the event target
\`\`\`java
// Example automatically generated from non-compiling source. May contain errors.
repository.onImageScanCompleted("ImageScanComplete").addTarget(...);
\`\`\`
### Authorization Token
Besides the Amazon ECR APIs, ECR also allows the Docker CLI or a language-specific Docker library to push and pull
images from an ECR repository. However, the Docker CLI does not support native IAM authentication methods and
additional steps must be taken so that Amazon ECR can authenticate and authorize Docker push and pull requests.
More information can be found at at [Registry Authentication](https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html#registry_auth).
A Docker authorization token can be obtained using the \`GetAuthorizationToken\` ECR API. The following code snippets
grants an IAM user access to call this API.
\`\`\`java
// Example automatically generated from non-compiling source. May contain errors.
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.services.ecr.*;
User user = new User(this, "User", new UserProps()...);
AuthorizationToken.grantRead(user);
\`\`\`
If you access images in the [Public ECR Gallery](https://gallery.ecr.aws/) as well, it is recommended you authenticate to the registry to benefit from
higher rate and bandwidth limits.
> See \`Pricing\` in https://aws.amazon.com/blogs/aws/amazon-ecr-public-a-new-public-container-registry/ and [Service quotas](https://docs.aws.amazon.com/AmazonECR/latest/public/public-service-quotas.html).
The following code snippet grants an IAM user access to retrieve an authorization token for the public gallery.
\`\`\`java
// Example automatically generated from non-compiling source. May contain errors.
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.services.ecr.*;
User user = new User(this, "User", new UserProps()...);
PublicGalleryAuthorizationToken.grantRead(user);
\`\`\`
This user can then proceed to login to the registry using one of the [authentication methods](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth).
### Image tag immutability
You can set tag immutability on images in our repository using the \`imageTagMutability\` construct prop.
\`\`\`java
// Example automatically generated from non-compiling source. May contain errors.
Repository.Builder.create(stack, "Repo").imageTagMutability(ecr.getTagMutability().getIMMUTABLE()).build();
\`\`\`
## Automatically clean up repositories
You can set life cycle rules to automatically clean up old images from your
repository. The first life cycle rule that matches an image will be applied
against that image. For example, the following deletes images older than
30 days, while keeping all images tagged with prod (note that the order
is important here):
\`\`\`java
// Example automatically generated from non-compiling source. May contain errors.
repository.addLifecycleRule(Map.of("tagPrefixList", List.of("prod"), "maxImageCount", 9999));
repository.addLifecycleRule(Map.of("maxImageAge", cdk.Duration.days(30)));
\`\`\`
# API Reference
## Constructs
### CfnPublicRepository
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::PublicRepository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
#### Initializers
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnPublicRepository;
CfnPublicRepository.Builder.create(Construct scope, java.lang.String id)
// .repositoryCatalogData(java.lang.Object)
// .repositoryName(java.lang.String)
// .repositoryPolicyText(java.lang.Object)
// .tags(java.util.Listscope
| Construct
| - scope in which this resource is defined. |
| id
| java.lang.String
| - scoped id of the resource. |
| repositoryCatalogData
| java.lang.Object
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| repositoryName
| java.lang.String
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
| repositoryPolicyText
| java.lang.Object
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| tags
| java.util.List<CfnTag>
| \`AWS::ECR::PublicRepository.Tags\`. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* java.lang.String
scoped id of the resource.
---
##### \`repositoryCatalogData\`Optional
- *Type:* java.lang.Object
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`repositoryName\`Optional
- *Type:* java.lang.String
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
##### \`repositoryPolicyText\`Optional
- *Type:* java.lang.Object
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`tags\`Optional
- *Type:* java.util.List<CfnTag>
\`AWS::ECR::PublicRepository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| overrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| addDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| addDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| addMetadata
| Add a value to the CloudFormation Resource Metadata. |
| addOverride
| Adds an override to the synthesized CloudFormation resource. |
| addPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| addPropertyOverride
| Adds an override to a resource property. |
| applyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| getAtt
| Returns a token for an runtime attribute of this resource. |
| getMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`toString\`
\`\`\`java
public java.lang.String toString()
\`\`\`
Returns a string representation of this construct.
##### \`overrideLogicalId\`
\`\`\`java
public void overrideLogicalId(java.lang.String newLogicalId)
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`newLogicalId\`Required
- *Type:* java.lang.String
The new logical ID to use for this stack element.
---
##### \`addDeletionOverride\`
\`\`\`java
public void addDeletionOverride(java.lang.String path)
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* java.lang.String
The path of the value to delete.
---
##### \`addDependsOn\`
\`\`\`java
public void addDependsOn(CfnResource target)
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`addMetadata\`
\`\`\`java
public void addMetadata(java.lang.String key, java.lang.Object value)
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* java.lang.String
---
###### \`value\`Required
- *Type:* java.lang.Object
---
##### \`addOverride\`
\`\`\`java
public void addOverride(java.lang.String path, java.lang.Object value)
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* java.lang.String
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* java.lang.Object
The value.
Could be primitive or complex.
---
##### \`addPropertyDeletionOverride\`
\`\`\`java
public void addPropertyDeletionOverride(java.lang.String propertyPath)
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`propertyPath\`Required
- *Type:* java.lang.String
The path to the property.
---
##### \`addPropertyOverride\`
\`\`\`java
public void addPropertyOverride(java.lang.String propertyPath, java.lang.Object value)
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`propertyPath\`Required
- *Type:* java.lang.String
The path of the property.
---
###### \`value\`Required
- *Type:* java.lang.Object
The value.
---
##### \`applyRemovalPolicy\`
\`\`\`java
public void applyRemovalPolicy()
public void applyRemovalPolicy(RemovalPolicy policy)
public void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`getAtt\`
\`\`\`java
public Reference getAtt(java.lang.String attributeName)
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attributeName\`Required
- *Type:* java.lang.String
The name of the attribute.
---
##### \`getMetadata\`
\`\`\`java
public java.lang.Object getMetadata(java.lang.String key)
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* java.lang.String
---
##### \`inspect\`
\`\`\`java
public void inspect(TreeInspector inspector)
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| isCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`isConstruct\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnPublicRepository;
CfnPublicRepository.isConstruct(java.lang.Object x)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isCfnElement\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnPublicRepository;
CfnPublicRepository.isCfnElement(java.lang.Object x)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isCfnResource\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnPublicRepository;
CfnPublicRepository.isCfnResource(IConstruct construct)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creationStack
| java.util.List
| *No description.* |
| logicalId
| java.lang.String
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| java.lang.String
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfnResourceType
| java.lang.String
| AWS resource type. |
| attrArn
| java.lang.String
| *No description.* |
| tags
| TagManager
| \`AWS::ECR::PublicRepository.Tags\`. |
| repositoryCatalogData
| java.lang.Object
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| repositoryPolicyText
| java.lang.Object
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| repositoryName
| java.lang.String
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
---
##### \`node\`Required
\`\`\`java
public ConstructNode getNode();
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creationStack\`Required
\`\`\`java
public java.util.ListCFN_RESOURCE_TYPE_NAME
| java.lang.String
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`java
public java.lang.String getCfnResourceTypeName();
\`\`\`
- *Type:* java.lang.String
The CloudFormation resource type name for this resource class.
---
### CfnRegistryPolicy
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::RegistryPolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html)
#### Initializers
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRegistryPolicy;
CfnRegistryPolicy.Builder.create(Construct scope, java.lang.String id)
.policyText(java.lang.Object)
.build();
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| java.lang.String
| - scoped id of the resource. |
| policyText
| java.lang.Object
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* java.lang.String
scoped id of the resource.
---
##### \`policyText\`Required
- *Type:* java.lang.Object
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| overrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| addDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| addDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| addMetadata
| Add a value to the CloudFormation Resource Metadata. |
| addOverride
| Adds an override to the synthesized CloudFormation resource. |
| addPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| addPropertyOverride
| Adds an override to a resource property. |
| applyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| getAtt
| Returns a token for an runtime attribute of this resource. |
| getMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`toString\`
\`\`\`java
public java.lang.String toString()
\`\`\`
Returns a string representation of this construct.
##### \`overrideLogicalId\`
\`\`\`java
public void overrideLogicalId(java.lang.String newLogicalId)
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`newLogicalId\`Required
- *Type:* java.lang.String
The new logical ID to use for this stack element.
---
##### \`addDeletionOverride\`
\`\`\`java
public void addDeletionOverride(java.lang.String path)
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* java.lang.String
The path of the value to delete.
---
##### \`addDependsOn\`
\`\`\`java
public void addDependsOn(CfnResource target)
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`addMetadata\`
\`\`\`java
public void addMetadata(java.lang.String key, java.lang.Object value)
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* java.lang.String
---
###### \`value\`Required
- *Type:* java.lang.Object
---
##### \`addOverride\`
\`\`\`java
public void addOverride(java.lang.String path, java.lang.Object value)
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* java.lang.String
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* java.lang.Object
The value.
Could be primitive or complex.
---
##### \`addPropertyDeletionOverride\`
\`\`\`java
public void addPropertyDeletionOverride(java.lang.String propertyPath)
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`propertyPath\`Required
- *Type:* java.lang.String
The path to the property.
---
##### \`addPropertyOverride\`
\`\`\`java
public void addPropertyOverride(java.lang.String propertyPath, java.lang.Object value)
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`propertyPath\`Required
- *Type:* java.lang.String
The path of the property.
---
###### \`value\`Required
- *Type:* java.lang.Object
The value.
---
##### \`applyRemovalPolicy\`
\`\`\`java
public void applyRemovalPolicy()
public void applyRemovalPolicy(RemovalPolicy policy)
public void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`getAtt\`
\`\`\`java
public Reference getAtt(java.lang.String attributeName)
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attributeName\`Required
- *Type:* java.lang.String
The name of the attribute.
---
##### \`getMetadata\`
\`\`\`java
public java.lang.Object getMetadata(java.lang.String key)
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* java.lang.String
---
##### \`inspect\`
\`\`\`java
public void inspect(TreeInspector inspector)
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| isCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`isConstruct\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRegistryPolicy;
CfnRegistryPolicy.isConstruct(java.lang.Object x)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isCfnElement\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRegistryPolicy;
CfnRegistryPolicy.isCfnElement(java.lang.Object x)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isCfnResource\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRegistryPolicy;
CfnRegistryPolicy.isCfnResource(IConstruct construct)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creationStack
| java.util.List
| *No description.* |
| logicalId
| java.lang.String
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| java.lang.String
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfnResourceType
| java.lang.String
| AWS resource type. |
| attrRegistryId
| java.lang.String
| *No description.* |
| policyText
| java.lang.Object
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`node\`Required
\`\`\`java
public ConstructNode getNode();
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creationStack\`Required
\`\`\`java
public java.util.ListCFN_RESOURCE_TYPE_NAME
| java.lang.String
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`java
public java.lang.String getCfnResourceTypeName();
\`\`\`
- *Type:* java.lang.String
The CloudFormation resource type name for this resource class.
---
### CfnReplicationConfiguration
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
#### Initializers
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnReplicationConfiguration;
CfnReplicationConfiguration.Builder.create(Construct scope, java.lang.String id)
.replicationConfiguration(IResolvable)
.replicationConfiguration(ReplicationConfigurationProperty)
.build();
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| java.lang.String
| - scoped id of the resource. |
| replicationConfiguration
| IResolvable OR ReplicationConfigurationProperty
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* java.lang.String
scoped id of the resource.
---
##### \`replicationConfiguration\`Required
- *Type:* IResolvable OR ReplicationConfigurationProperty
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| overrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| addDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| addDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| addMetadata
| Add a value to the CloudFormation Resource Metadata. |
| addOverride
| Adds an override to the synthesized CloudFormation resource. |
| addPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| addPropertyOverride
| Adds an override to a resource property. |
| applyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| getAtt
| Returns a token for an runtime attribute of this resource. |
| getMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`toString\`
\`\`\`java
public java.lang.String toString()
\`\`\`
Returns a string representation of this construct.
##### \`overrideLogicalId\`
\`\`\`java
public void overrideLogicalId(java.lang.String newLogicalId)
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`newLogicalId\`Required
- *Type:* java.lang.String
The new logical ID to use for this stack element.
---
##### \`addDeletionOverride\`
\`\`\`java
public void addDeletionOverride(java.lang.String path)
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* java.lang.String
The path of the value to delete.
---
##### \`addDependsOn\`
\`\`\`java
public void addDependsOn(CfnResource target)
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`addMetadata\`
\`\`\`java
public void addMetadata(java.lang.String key, java.lang.Object value)
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* java.lang.String
---
###### \`value\`Required
- *Type:* java.lang.Object
---
##### \`addOverride\`
\`\`\`java
public void addOverride(java.lang.String path, java.lang.Object value)
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* java.lang.String
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* java.lang.Object
The value.
Could be primitive or complex.
---
##### \`addPropertyDeletionOverride\`
\`\`\`java
public void addPropertyDeletionOverride(java.lang.String propertyPath)
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`propertyPath\`Required
- *Type:* java.lang.String
The path to the property.
---
##### \`addPropertyOverride\`
\`\`\`java
public void addPropertyOverride(java.lang.String propertyPath, java.lang.Object value)
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`propertyPath\`Required
- *Type:* java.lang.String
The path of the property.
---
###### \`value\`Required
- *Type:* java.lang.Object
The value.
---
##### \`applyRemovalPolicy\`
\`\`\`java
public void applyRemovalPolicy()
public void applyRemovalPolicy(RemovalPolicy policy)
public void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`getAtt\`
\`\`\`java
public Reference getAtt(java.lang.String attributeName)
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attributeName\`Required
- *Type:* java.lang.String
The name of the attribute.
---
##### \`getMetadata\`
\`\`\`java
public java.lang.Object getMetadata(java.lang.String key)
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* java.lang.String
---
##### \`inspect\`
\`\`\`java
public void inspect(TreeInspector inspector)
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| isCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`isConstruct\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnReplicationConfiguration;
CfnReplicationConfiguration.isConstruct(java.lang.Object x)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isCfnElement\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnReplicationConfiguration;
CfnReplicationConfiguration.isCfnElement(java.lang.Object x)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isCfnResource\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnReplicationConfiguration;
CfnReplicationConfiguration.isCfnResource(IConstruct construct)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creationStack
| java.util.List
| *No description.* |
| logicalId
| java.lang.String
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| java.lang.String
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfnResourceType
| java.lang.String
| AWS resource type. |
| attrRegistryId
| java.lang.String
| *No description.* |
| replicationConfiguration
| IResolvable OR ReplicationConfigurationProperty
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`node\`Required
\`\`\`java
public ConstructNode getNode();
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creationStack\`Required
\`\`\`java
public java.util.ListCFN_RESOURCE_TYPE_NAME
| java.lang.String
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`java
public java.lang.String getCfnResourceTypeName();
\`\`\`
- *Type:* java.lang.String
The CloudFormation resource type name for this resource class.
---
### CfnRepository
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::Repository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
#### Initializers
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRepository;
CfnRepository.Builder.create(Construct scope, java.lang.String id)
// .encryptionConfiguration(java.lang.Object)
// .imageScanningConfiguration(java.lang.Object)
// .imageTagMutability(java.lang.String)
// .lifecyclePolicy(IResolvable)
// .lifecyclePolicy(LifecyclePolicyProperty)
// .repositoryName(java.lang.String)
// .repositoryPolicyText(java.lang.Object)
// .tags(java.util.Listscope
| Construct
| - scope in which this resource is defined. |
| id
| java.lang.String
| - scoped id of the resource. |
| encryptionConfiguration
| java.lang.Object
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| imageScanningConfiguration
| java.lang.Object
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| imageTagMutability
| java.lang.String
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| lifecyclePolicy
| IResolvable OR LifecyclePolicyProperty
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| repositoryName
| java.lang.String
| \`AWS::ECR::Repository.RepositoryName\`. |
| repositoryPolicyText
| java.lang.Object
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| tags
| java.util.List<CfnTag>
| \`AWS::ECR::Repository.Tags\`. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* java.lang.String
scoped id of the resource.
---
##### \`encryptionConfiguration\`Optional
- *Type:* java.lang.Object
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`imageScanningConfiguration\`Optional
- *Type:* java.lang.Object
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`imageTagMutability\`Optional
- *Type:* java.lang.String
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`lifecyclePolicy\`Optional
- *Type:* IResolvable OR LifecyclePolicyProperty
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`repositoryName\`Optional
- *Type:* java.lang.String
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
##### \`repositoryPolicyText\`Optional
- *Type:* java.lang.Object
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`tags\`Optional
- *Type:* java.util.List<CfnTag>
\`AWS::ECR::Repository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| overrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| addDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| addDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| addMetadata
| Add a value to the CloudFormation Resource Metadata. |
| addOverride
| Adds an override to the synthesized CloudFormation resource. |
| addPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| addPropertyOverride
| Adds an override to a resource property. |
| applyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| getAtt
| Returns a token for an runtime attribute of this resource. |
| getMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`toString\`
\`\`\`java
public java.lang.String toString()
\`\`\`
Returns a string representation of this construct.
##### \`overrideLogicalId\`
\`\`\`java
public void overrideLogicalId(java.lang.String newLogicalId)
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`newLogicalId\`Required
- *Type:* java.lang.String
The new logical ID to use for this stack element.
---
##### \`addDeletionOverride\`
\`\`\`java
public void addDeletionOverride(java.lang.String path)
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* java.lang.String
The path of the value to delete.
---
##### \`addDependsOn\`
\`\`\`java
public void addDependsOn(CfnResource target)
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`addMetadata\`
\`\`\`java
public void addMetadata(java.lang.String key, java.lang.Object value)
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* java.lang.String
---
###### \`value\`Required
- *Type:* java.lang.Object
---
##### \`addOverride\`
\`\`\`java
public void addOverride(java.lang.String path, java.lang.Object value)
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* java.lang.String
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* java.lang.Object
The value.
Could be primitive or complex.
---
##### \`addPropertyDeletionOverride\`
\`\`\`java
public void addPropertyDeletionOverride(java.lang.String propertyPath)
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`propertyPath\`Required
- *Type:* java.lang.String
The path to the property.
---
##### \`addPropertyOverride\`
\`\`\`java
public void addPropertyOverride(java.lang.String propertyPath, java.lang.Object value)
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`propertyPath\`Required
- *Type:* java.lang.String
The path of the property.
---
###### \`value\`Required
- *Type:* java.lang.Object
The value.
---
##### \`applyRemovalPolicy\`
\`\`\`java
public void applyRemovalPolicy()
public void applyRemovalPolicy(RemovalPolicy policy)
public void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`getAtt\`
\`\`\`java
public Reference getAtt(java.lang.String attributeName)
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attributeName\`Required
- *Type:* java.lang.String
The name of the attribute.
---
##### \`getMetadata\`
\`\`\`java
public java.lang.Object getMetadata(java.lang.String key)
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* java.lang.String
---
##### \`inspect\`
\`\`\`java
public void inspect(TreeInspector inspector)
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| isCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`isConstruct\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRepository;
CfnRepository.isConstruct(java.lang.Object x)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isCfnElement\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRepository;
CfnRepository.isCfnElement(java.lang.Object x)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isCfnResource\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRepository;
CfnRepository.isCfnResource(IConstruct construct)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creationStack
| java.util.List
| *No description.* |
| logicalId
| java.lang.String
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| java.lang.String
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfnResourceType
| java.lang.String
| AWS resource type. |
| attrArn
| java.lang.String
| *No description.* |
| attrRepositoryUri
| java.lang.String
| *No description.* |
| tags
| TagManager
| \`AWS::ECR::Repository.Tags\`. |
| encryptionConfiguration
| java.lang.Object
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| imageScanningConfiguration
| java.lang.Object
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| repositoryPolicyText
| java.lang.Object
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| imageTagMutability
| java.lang.String
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| lifecyclePolicy
| IResolvable OR LifecyclePolicyProperty
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| repositoryName
| java.lang.String
| \`AWS::ECR::Repository.RepositoryName\`. |
---
##### \`node\`Required
\`\`\`java
public ConstructNode getNode();
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creationStack\`Required
\`\`\`java
public java.util.ListCFN_RESOURCE_TYPE_NAME
| java.lang.String
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`java
public java.lang.String getCfnResourceTypeName();
\`\`\`
- *Type:* java.lang.String
The CloudFormation resource type name for this resource class.
---
### Repository
Define an ECR repository.
#### Initializers
\`\`\`java
import software.amazon.awscdk.services.ecr.Repository;
Repository.Builder.create(Construct scope, java.lang.String id)
// .imageScanOnPush(java.lang.Boolean)
// .imageTagMutability(TagMutability)
// .lifecycleRegistryId(java.lang.String)
// .lifecycleRules(java.util.Listscope
| Construct
| *No description.* |
| id
| java.lang.String
| *No description.* |
| imageScanOnPush
| java.lang.Boolean
| Enable the scan on push when creating the repository. |
| imageTagMutability
| TagMutability
| The tag mutability setting for the repository. |
| lifecycleRegistryId
| java.lang.String
| The AWS account ID associated with the registry that contains the repository. |
| lifecycleRules
| java.util.List<LifecycleRule>
| Life cycle rules to apply to this registry. |
| removalPolicy
| RemovalPolicy
| Determine what happens to the repository when the resource/stack is deleted. |
| repositoryName
| java.lang.String
| Name for this repository. |
---
##### \`scope\`Required
- *Type:* Construct
---
##### \`id\`Required
- *Type:* java.lang.String
---
##### \`imageScanOnPush\`Optional
- *Type:* java.lang.Boolean
- *Default:* false
Enable the scan on push when creating the repository.
---
##### \`imageTagMutability\`Optional
- *Type:* TagMutability
- *Default:* TagMutability.MUTABLE
The tag mutability setting for the repository.
If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten.
---
##### \`lifecycleRegistryId\`Optional
- *Type:* java.lang.String
- *Default:* The default registry is assumed.
The AWS account ID associated with the registry that contains the repository.
> [https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html](https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html)
---
##### \`lifecycleRules\`Optional
- *Type:* java.util.List<LifecycleRule>
- *Default:* No life cycle rules
Life cycle rules to apply to this registry.
---
##### \`removalPolicy\`Optional
- *Type:* RemovalPolicy
- *Default:* RemovalPolicy.Retain
Determine what happens to the repository when the resource/stack is deleted.
---
##### \`repositoryName\`Optional
- *Type:* java.lang.String
- *Default:* Automatically generated name.
Name for this repository.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| applyRemovalPolicy
| Apply the given removal policy to this resource. |
| addToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grantPull
| Grant the given identity permissions to use the images in this repository. |
| grantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| onCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| onCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| onEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| onImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed. |
| repositoryUriForDigest
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| repositoryUriForTag
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| addLifecycleRule
| Add a life cycle rule to the repository. |
---
##### \`toString\`
\`\`\`java
public java.lang.String toString()
\`\`\`
Returns a string representation of this construct.
##### \`applyRemovalPolicy\`
\`\`\`java
public void applyRemovalPolicy(RemovalPolicy policy)
\`\`\`
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (\`RemovalPolicy.DELETE\`), or left in your AWS
account for data recovery and cleanup later (\`RemovalPolicy.RETAIN\`).
###### \`policy\`Required
- *Type:* RemovalPolicy
---
##### \`addToResourcePolicy\`
\`\`\`java
public AddToResourcePolicyResult addToResourcePolicy(PolicyStatement statement)
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`java
public Grant grant(IGrantable grantee, java.lang.String actions)
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* java.lang.String
---
##### \`grantPull\`
\`\`\`java
public Grant grantPull(IGrantable grantee)
\`\`\`
Grant the given identity permissions to use the images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grantPullPush\`
\`\`\`java
public Grant grantPullPush(IGrantable grantee)
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`onCloudTrailEvent\`
\`\`\`java
public Rule onCloudTrailEvent(java.lang.String id)
public Rule onCloudTrailEvent(java.lang.String id, 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.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`onCloudTrailImagePushed\`
\`\`\`java
public Rule onCloudTrailImagePushed(java.lang.String id)
public Rule onCloudTrailImagePushed(java.lang.String id, 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.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`onEvent\`
\`\`\`java
public Rule onEvent(java.lang.String id)
public Rule onEvent(java.lang.String id, OnEventOptions options)
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* java.lang.String
---
###### \`options\`Optional
- *Type:* OnEventOptions
---
##### \`onImageScanCompleted\`
\`\`\`java
public Rule onImageScanCompleted(java.lang.String id)
public Rule onImageScanCompleted(java.lang.String id, OnImageScanCompletedOptions options)
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`repositoryUriForDigest\`
\`\`\`java
public java.lang.String repositoryUriForDigest()
public java.lang.String repositoryUriForDigest(java.lang.String digest)
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* java.lang.String
Optional image digest.
---
##### \`repositoryUriForTag\`
\`\`\`java
public java.lang.String repositoryUriForTag()
public java.lang.String repositoryUriForTag(java.lang.String tag)
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
###### \`tag\`Optional
- *Type:* java.lang.String
Optional image tag.
---
##### \`addLifecycleRule\`
\`\`\`java
public void addLifecycleRule(LifecycleRule rule)
\`\`\`
Add a life cycle rule to the repository.
Life cycle rules automatically expire images from the repository that match
certain conditions.
###### \`rule\`Required
- *Type:* LifecycleRule
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isResource
| Check whether the given construct is a Resource. |
| arnForLocalRepository
| Returns an ECR ARN for a repository that resides in the same account/region as the current stack. |
| fromRepositoryArn
| *No description.* |
| fromRepositoryAttributes
| Import a repository. |
| fromRepositoryName
| *No description.* |
---
##### \`isConstruct\`
\`\`\`java
import software.amazon.awscdk.services.ecr.Repository;
Repository.isConstruct(java.lang.Object x)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isResource\`
\`\`\`java
import software.amazon.awscdk.services.ecr.Repository;
Repository.isResource(IConstruct construct)
\`\`\`
Check whether the given construct is a Resource.
###### \`construct\`Required
- *Type:* IConstruct
---
##### \`arnForLocalRepository\`
\`\`\`java
import software.amazon.awscdk.services.ecr.Repository;
Repository.arnForLocalRepository(java.lang.String repositoryName, IConstruct scope),Repository.arnForLocalRepository(java.lang.String repositoryName, IConstruct scope, java.lang.String account)
\`\`\`
Returns an ECR ARN for a repository that resides in the same account/region as the current stack.
###### \`repositoryName\`Required
- *Type:* java.lang.String
---
###### \`scope\`Required
- *Type:* IConstruct
---
###### \`account\`Optional
- *Type:* java.lang.String
---
##### \`fromRepositoryArn\`
\`\`\`java
import software.amazon.awscdk.services.ecr.Repository;
Repository.fromRepositoryArn(Construct scope, java.lang.String id, java.lang.String repositoryArn)
\`\`\`
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* java.lang.String
---
###### \`repositoryArn\`Required
- *Type:* java.lang.String
---
##### \`fromRepositoryAttributes\`
\`\`\`java
import software.amazon.awscdk.services.ecr.Repository;
Repository.fromRepositoryAttributes(Construct scope, java.lang.String id, RepositoryAttributes attrs)
\`\`\`
Import a repository.
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* java.lang.String
---
###### \`attrs\`Required
- *Type:* RepositoryAttributes
---
##### \`fromRepositoryName\`
\`\`\`java
import software.amazon.awscdk.services.ecr.Repository;
Repository.fromRepositoryName(Construct scope, java.lang.String id, java.lang.String repositoryName)
\`\`\`
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* java.lang.String
---
###### \`repositoryName\`Required
- *Type:* java.lang.String
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repositoryArn
| java.lang.String
| The ARN of the repository. |
| repositoryName
| java.lang.String
| The name of the repository. |
| repositoryUri
| java.lang.String
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`java
public ConstructNode getNode();
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`env\`Required
\`\`\`java
public ResourceEnvironment getEnv();
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`java
public Stack getStack();
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repositoryArn\`Required
\`\`\`java
public java.lang.String getRepositoryArn();
\`\`\`
- *Type:* java.lang.String
The ARN of the repository.
---
##### \`repositoryName\`Required
\`\`\`java
public java.lang.String getRepositoryName();
\`\`\`
- *Type:* java.lang.String
The name of the repository.
---
##### \`repositoryUri\`Required
\`\`\`java
public java.lang.String getRepositoryUri();
\`\`\`
- *Type:* java.lang.String
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
### RepositoryBase
- *Implements:* IRepository
Base class for ECR repository.
Reused between imported repositories and owned repositories.
#### Initializers
\`\`\`java
import software.amazon.awscdk.services.ecr.RepositoryBase;
RepositoryBase.Builder.create(Construct scope, java.lang.String id)
// .account(java.lang.String)
// .environmentFromArn(java.lang.String)
// .physicalName(java.lang.String)
// .region(java.lang.String)
.build();
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| *No description.* |
| id
| java.lang.String
| *No description.* |
| account
| java.lang.String
| The AWS account ID this resource belongs to. |
| environmentFromArn
| java.lang.String
| ARN to deduce region and account from. |
| physicalName
| java.lang.String
| The value passed in by users to the physical name prop of the resource. |
| region
| java.lang.String
| The AWS region this resource belongs to. |
---
##### \`scope\`Required
- *Type:* Construct
---
##### \`id\`Required
- *Type:* java.lang.String
---
##### \`account\`Optional
- *Type:* java.lang.String
- *Default:* the resource is in the same account as the stack it belongs to
The AWS account ID this resource belongs to.
---
##### \`environmentFromArn\`Optional
- *Type:* java.lang.String
- *Default:* take environment from \`account\`, \`region\` parameters, or use Stack environment.
ARN to deduce region and account from.
The ARN is parsed and the account and region are taken from the ARN.
This should be used for imported resources.
Cannot be supplied together with either \`account\` or \`region\`.
---
##### \`physicalName\`Optional
- *Type:* java.lang.String
- *Default:* The physical name will be allocated by CloudFormation at deployment time
The value passed in by users to the physical name prop of the resource.
\`undefined\` implies that a physical name will be allocated by
CloudFormation during deployment.
- a concrete value implies a specific physical name
- \`PhysicalName.GENERATE_IF_NEEDED\` is a marker that indicates that a physical will only be generated
by the CDK if it is needed for cross-environment references. Otherwise, it will be allocated by CloudFormation.
---
##### \`region\`Optional
- *Type:* java.lang.String
- *Default:* the resource is in the same region as the stack it belongs to
The AWS region this resource belongs to.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| applyRemovalPolicy
| Apply the given removal policy to this resource. |
| addToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grantPull
| Grant the given identity permissions to use the images in this repository. |
| grantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| onCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| onCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| onEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| onImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed. |
| repositoryUriForDigest
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| repositoryUriForTag
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
---
##### \`toString\`
\`\`\`java
public java.lang.String toString()
\`\`\`
Returns a string representation of this construct.
##### \`applyRemovalPolicy\`
\`\`\`java
public void applyRemovalPolicy(RemovalPolicy policy)
\`\`\`
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (\`RemovalPolicy.DELETE\`), or left in your AWS
account for data recovery and cleanup later (\`RemovalPolicy.RETAIN\`).
###### \`policy\`Required
- *Type:* RemovalPolicy
---
##### \`addToResourcePolicy\`
\`\`\`java
public AddToResourcePolicyResult addToResourcePolicy(PolicyStatement statement)
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`java
public Grant grant(IGrantable grantee, java.lang.String actions)
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* java.lang.String
---
##### \`grantPull\`
\`\`\`java
public Grant grantPull(IGrantable grantee)
\`\`\`
Grant the given identity permissions to use the images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grantPullPush\`
\`\`\`java
public Grant grantPullPush(IGrantable grantee)
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`onCloudTrailEvent\`
\`\`\`java
public Rule onCloudTrailEvent(java.lang.String id)
public Rule onCloudTrailEvent(java.lang.String id, 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.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`onCloudTrailImagePushed\`
\`\`\`java
public Rule onCloudTrailImagePushed(java.lang.String id)
public Rule onCloudTrailImagePushed(java.lang.String id, 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.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`onEvent\`
\`\`\`java
public Rule onEvent(java.lang.String id)
public Rule onEvent(java.lang.String id, OnEventOptions options)
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* java.lang.String
---
###### \`options\`Optional
- *Type:* OnEventOptions
---
##### \`onImageScanCompleted\`
\`\`\`java
public Rule onImageScanCompleted(java.lang.String id)
public Rule onImageScanCompleted(java.lang.String id, OnImageScanCompletedOptions options)
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`repositoryUriForDigest\`
\`\`\`java
public java.lang.String repositoryUriForDigest()
public java.lang.String repositoryUriForDigest(java.lang.String digest)
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* java.lang.String
Optional image digest.
---
##### \`repositoryUriForTag\`
\`\`\`java
public java.lang.String repositoryUriForTag()
public java.lang.String repositoryUriForTag(java.lang.String tag)
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
###### \`tag\`Optional
- *Type:* java.lang.String
Optional image tag.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isResource
| Check whether the given construct is a Resource. |
---
##### \`isConstruct\`
\`\`\`java
import software.amazon.awscdk.services.ecr.RepositoryBase;
RepositoryBase.isConstruct(java.lang.Object x)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isResource\`
\`\`\`java
import software.amazon.awscdk.services.ecr.RepositoryBase;
RepositoryBase.isResource(IConstruct construct)
\`\`\`
Check whether the given construct is a Resource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repositoryArn
| java.lang.String
| The ARN of the repository. |
| repositoryName
| java.lang.String
| The name of the repository. |
| repositoryUri
| java.lang.String
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`java
public ConstructNode getNode();
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`env\`Required
\`\`\`java
public ResourceEnvironment getEnv();
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`java
public Stack getStack();
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repositoryArn\`Required
\`\`\`java
public java.lang.String getRepositoryArn();
\`\`\`
- *Type:* java.lang.String
The ARN of the repository.
---
##### \`repositoryName\`Required
\`\`\`java
public java.lang.String getRepositoryName();
\`\`\`
- *Type:* java.lang.String
The name of the repository.
---
##### \`repositoryUri\`Required
\`\`\`java
public java.lang.String getRepositoryUri();
\`\`\`
- *Type:* java.lang.String
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
## Structs
### CfnPublicRepositoryProps
Properties for defining a \`AWS::ECR::PublicRepository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnPublicRepositoryProps;
CfnPublicRepositoryProps.builder()
// .repositoryCatalogData(java.lang.Object)
// .repositoryName(java.lang.String)
// .repositoryPolicyText(java.lang.Object)
// .tags(java.util.ListrepositoryCatalogData
| java.lang.Object
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| repositoryName
| java.lang.String
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
| repositoryPolicyText
| java.lang.Object
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| tags
| java.util.List<CfnTag>
| \`AWS::ECR::PublicRepository.Tags\`. |
---
##### \`repositoryCatalogData\`Optional
\`\`\`java
public java.lang.Object getRepositoryCatalogData();
\`\`\`
- *Type:* java.lang.Object
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`repositoryName\`Optional
\`\`\`java
public java.lang.String getRepositoryName();
\`\`\`
- *Type:* java.lang.String
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
##### \`repositoryPolicyText\`Optional
\`\`\`java
public java.lang.Object getRepositoryPolicyText();
\`\`\`
- *Type:* java.lang.Object
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`tags\`Optional
\`\`\`java
public java.util.ListpolicyText
| java.lang.Object
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`policyText\`Required
\`\`\`java
public java.lang.Object getPolicyText();
\`\`\`
- *Type:* java.lang.Object
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
### CfnReplicationConfigurationProps
Properties for defining a \`AWS::ECR::ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnReplicationConfigurationProps;
CfnReplicationConfigurationProps.builder()
.replicationConfiguration(IResolvable)
.replicationConfiguration(ReplicationConfigurationProperty)
.build();
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| replicationConfiguration
| IResolvable OR ReplicationConfigurationProperty
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`replicationConfiguration\`Required
\`\`\`java
public java.lang.Object getReplicationConfiguration();
\`\`\`
- *Type:* IResolvable OR ReplicationConfigurationProperty
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
### CfnRepositoryProps
Properties for defining a \`AWS::ECR::Repository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRepositoryProps;
CfnRepositoryProps.builder()
// .encryptionConfiguration(java.lang.Object)
// .imageScanningConfiguration(java.lang.Object)
// .imageTagMutability(java.lang.String)
// .lifecyclePolicy(IResolvable)
// .lifecyclePolicy(LifecyclePolicyProperty)
// .repositoryName(java.lang.String)
// .repositoryPolicyText(java.lang.Object)
// .tags(java.util.ListencryptionConfiguration
| java.lang.Object
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| imageScanningConfiguration
| java.lang.Object
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| imageTagMutability
| java.lang.String
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| lifecyclePolicy
| IResolvable OR LifecyclePolicyProperty
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| repositoryName
| java.lang.String
| \`AWS::ECR::Repository.RepositoryName\`. |
| repositoryPolicyText
| java.lang.Object
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| tags
| java.util.List<CfnTag>
| \`AWS::ECR::Repository.Tags\`. |
---
##### \`encryptionConfiguration\`Optional
\`\`\`java
public java.lang.Object getEncryptionConfiguration();
\`\`\`
- *Type:* java.lang.Object
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`imageScanningConfiguration\`Optional
\`\`\`java
public java.lang.Object getImageScanningConfiguration();
\`\`\`
- *Type:* java.lang.Object
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`imageTagMutability\`Optional
\`\`\`java
public java.lang.String getImageTagMutability();
\`\`\`
- *Type:* java.lang.String
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`lifecyclePolicy\`Optional
\`\`\`java
public java.lang.Object getLifecyclePolicy();
\`\`\`
- *Type:* IResolvable OR LifecyclePolicyProperty
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`repositoryName\`Optional
\`\`\`java
public java.lang.String getRepositoryName();
\`\`\`
- *Type:* java.lang.String
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
##### \`repositoryPolicyText\`Optional
\`\`\`java
public java.lang.Object getRepositoryPolicyText();
\`\`\`
- *Type:* java.lang.Object
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`tags\`Optional
\`\`\`java
public java.util.ListlifecyclePolicyText
| java.lang.String
| \`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`. |
| registryId
| java.lang.String
| \`CfnRepository.LifecyclePolicyProperty.RegistryId\`. |
---
##### \`lifecyclePolicyText\`Optional
\`\`\`java
public java.lang.String getLifecyclePolicyText();
\`\`\`
- *Type:* java.lang.String
\`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext)
---
##### \`registryId\`Optional
\`\`\`java
public java.lang.String getRegistryId();
\`\`\`
- *Type:* java.lang.String
\`CfnRepository.LifecyclePolicyProperty.RegistryId\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid)
---
### LifecycleRule
An ECR life cycle rule.
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.LifecycleRule;
LifecycleRule.builder()
// .description(java.lang.String)
// .maxImageAge(Duration)
// .maxImageCount(java.lang.Number)
// .rulePriority(java.lang.Number)
// .tagPrefixList(java.util.Listdescription
| java.lang.String
| Describes the purpose of the rule. |
| maxImageAge
| Duration
| The maximum age of images to retain. The value must represent a number of days. |
| maxImageCount
| java.lang.Number
| The maximum number of images to retain. |
| rulePriority
| java.lang.Number
| Controls the order in which rules are evaluated (low to high). |
| tagPrefixList
| java.util.List
| Select images that have ALL the given prefixes in their tag. |
| tagStatus
| TagStatus
| Select images based on tags. |
---
##### \`description\`Optional
\`\`\`java
public java.lang.String getDescription();
\`\`\`
- *Type:* java.lang.String
- *Default:* No description
Describes the purpose of the rule.
---
##### \`maxImageAge\`Optional
\`\`\`java
public Duration getMaxImageAge();
\`\`\`
- *Type:* Duration
The maximum age of images to retain. The value must represent a number of days.
Specify exactly one of maxImageCount and maxImageAge.
---
##### \`maxImageCount\`Optional
\`\`\`java
public java.lang.Number getMaxImageCount();
\`\`\`
- *Type:* java.lang.Number
The maximum number of images to retain.
Specify exactly one of maxImageCount and maxImageAge.
---
##### \`rulePriority\`Optional
\`\`\`java
public java.lang.Number getRulePriority();
\`\`\`
- *Type:* java.lang.Number
- *Default:* Automatically assigned
Controls the order in which rules are evaluated (low to high).
All rules must have a unique priority, where lower numbers have
higher precedence. The first rule that matches is applied to an image.
There can only be one rule with a tagStatus of Any, and it must have
the highest rulePriority.
All rules without a specified priority will have incrementing priorities
automatically assigned to them, higher than any rules that DO have priorities.
---
##### \`tagPrefixList\`Optional
\`\`\`java
public java.util.Listdescription
| java.lang.String
| A description of the rule's purpose. |
| eventPattern
| EventPattern
| Additional restrictions for the event to route to the specified target. |
| ruleName
| java.lang.String
| A name for the rule. |
| target
| IRuleTarget
| The target to register for the event. |
| imageTag
| java.lang.String
| Only watch changes to this image tag. |
---
##### \`description\`Optional
\`\`\`java
public java.lang.String getDescription();
\`\`\`
- *Type:* java.lang.String
- *Default:* No description
A description of the rule's purpose.
---
##### \`eventPattern\`Optional
\`\`\`java
public EventPattern getEventPattern();
\`\`\`
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
##### \`ruleName\`Optional
\`\`\`java
public java.lang.String getRuleName();
\`\`\`
- *Type:* java.lang.String
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
##### \`target\`Optional
\`\`\`java
public IRuleTarget getTarget();
\`\`\`
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`imageTag\`Optional
\`\`\`java
public java.lang.String getImageTag();
\`\`\`
- *Type:* java.lang.String
- *Default:* Watch changes to all tags
Only watch changes to this image tag.
---
### OnImageScanCompletedOptions
Options for the OnImageScanCompleted method.
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.OnImageScanCompletedOptions;
OnImageScanCompletedOptions.builder()
// .description(java.lang.String)
// .eventPattern(EventPattern)
// .ruleName(java.lang.String)
// .target(IRuleTarget)
// .imageTags(java.util.Listdescription
| java.lang.String
| A description of the rule's purpose. |
| eventPattern
| EventPattern
| Additional restrictions for the event to route to the specified target. |
| ruleName
| java.lang.String
| A name for the rule. |
| target
| IRuleTarget
| The target to register for the event. |
| imageTags
| java.util.List
| Only watch changes to the image tags spedified. |
---
##### \`description\`Optional
\`\`\`java
public java.lang.String getDescription();
\`\`\`
- *Type:* java.lang.String
- *Default:* No description
A description of the rule's purpose.
---
##### \`eventPattern\`Optional
\`\`\`java
public EventPattern getEventPattern();
\`\`\`
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
##### \`ruleName\`Optional
\`\`\`java
public java.lang.String getRuleName();
\`\`\`
- *Type:* java.lang.String
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
##### \`target\`Optional
\`\`\`java
public IRuleTarget getTarget();
\`\`\`
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`imageTags\`Optional
\`\`\`java
public java.util.Listrules
| IResolvable OR java.util.List<IResolvable OR ReplicationRuleProperty>
| \`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`. |
---
##### \`rules\`Required
\`\`\`java
public java.lang.Object getRules();
\`\`\`
- *Type:* IResolvable OR java.util.List<IResolvable OR ReplicationRuleProperty>
\`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules)
---
### ReplicationDestinationProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html)
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnReplicationConfiguration.ReplicationDestinationProperty;
ReplicationDestinationProperty.builder()
.region(java.lang.String)
.registryId(java.lang.String)
.build();
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| region
| java.lang.String
| \`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`. |
| registryId
| java.lang.String
| \`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`. |
---
##### \`region\`Required
\`\`\`java
public java.lang.String getRegion();
\`\`\`
- *Type:* java.lang.String
\`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region)
---
##### \`registryId\`Required
\`\`\`java
public java.lang.String getRegistryId();
\`\`\`
- *Type:* java.lang.String
\`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid)
---
### ReplicationRuleProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html)
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnReplicationConfiguration.ReplicationRuleProperty;
ReplicationRuleProperty.builder()
.destinations(IResolvable)
.destinations(java.util.Listdestinations
| IResolvable OR java.util.List<IResolvable OR ReplicationDestinationProperty>
| \`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`. |
---
##### \`destinations\`Required
\`\`\`java
public java.lang.Object getDestinations();
\`\`\`
- *Type:* IResolvable OR java.util.List<IResolvable OR ReplicationDestinationProperty>
\`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations)
---
### RepositoryAttributes
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.RepositoryAttributes;
RepositoryAttributes.builder()
.repositoryArn(java.lang.String)
.repositoryName(java.lang.String)
.build();
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| repositoryArn
| java.lang.String
| *No description.* |
| repositoryName
| java.lang.String
| *No description.* |
---
##### \`repositoryArn\`Required
\`\`\`java
public java.lang.String getRepositoryArn();
\`\`\`
- *Type:* java.lang.String
---
##### \`repositoryName\`Required
\`\`\`java
public java.lang.String getRepositoryName();
\`\`\`
- *Type:* java.lang.String
---
### RepositoryProps
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.RepositoryProps;
RepositoryProps.builder()
// .imageScanOnPush(java.lang.Boolean)
// .imageTagMutability(TagMutability)
// .lifecycleRegistryId(java.lang.String)
// .lifecycleRules(java.util.ListimageScanOnPush
| java.lang.Boolean
| Enable the scan on push when creating the repository. |
| imageTagMutability
| TagMutability
| The tag mutability setting for the repository. |
| lifecycleRegistryId
| java.lang.String
| The AWS account ID associated with the registry that contains the repository. |
| lifecycleRules
| java.util.List<LifecycleRule>
| Life cycle rules to apply to this registry. |
| removalPolicy
| RemovalPolicy
| Determine what happens to the repository when the resource/stack is deleted. |
| repositoryName
| java.lang.String
| Name for this repository. |
---
##### \`imageScanOnPush\`Optional
\`\`\`java
public java.lang.Boolean getImageScanOnPush();
\`\`\`
- *Type:* java.lang.Boolean
- *Default:* false
Enable the scan on push when creating the repository.
---
##### \`imageTagMutability\`Optional
\`\`\`java
public TagMutability getImageTagMutability();
\`\`\`
- *Type:* TagMutability
- *Default:* TagMutability.MUTABLE
The tag mutability setting for the repository.
If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten.
---
##### \`lifecycleRegistryId\`Optional
\`\`\`java
public java.lang.String getLifecycleRegistryId();
\`\`\`
- *Type:* java.lang.String
- *Default:* The default registry is assumed.
The AWS account ID associated with the registry that contains the repository.
> [https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html](https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html)
---
##### \`lifecycleRules\`Optional
\`\`\`java
public java.util.ListgrantRead
| Grant access to retrieve an authorization token. |
---
##### \`grantRead\`
\`\`\`java
import software.amazon.awscdk.services.ecr.AuthorizationToken;
AuthorizationToken.grantRead(IGrantable grantee)
\`\`\`
Grant access to retrieve an authorization token.
###### \`grantee\`Required
- *Type:* IGrantable
---
### PublicGalleryAuthorizationToken
Authorization token to access the global public ECR Gallery via Docker CLI.
> [https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth)
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| grantRead
| Grant access to retrieve an authorization token. |
---
##### \`grantRead\`
\`\`\`java
import software.amazon.awscdk.services.ecr.PublicGalleryAuthorizationToken;
PublicGalleryAuthorizationToken.grantRead(IGrantable grantee)
\`\`\`
Grant access to retrieve an authorization token.
###### \`grantee\`Required
- *Type:* IGrantable
---
## Protocols
### IRepository
- *Extends:* IResource
- *Implemented By:* Repository, RepositoryBase, IRepository
Represents an ECR repository.
#### Methods
| **Name** | **Description** |
| --- | --- |
| addToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grantPull
| Grant the given identity permissions to pull images in this repository. |
| grantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| onCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| onCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| onEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| onImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed. |
| repositoryUriForDigest
| Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`. |
| repositoryUriForTag
| Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`. |
---
##### \`addToResourcePolicy\`
\`\`\`java
public AddToResourcePolicyResult addToResourcePolicy(PolicyStatement statement)
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`java
public Grant grant(IGrantable grantee, java.lang.String actions)
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* java.lang.String
---
##### \`grantPull\`
\`\`\`java
public Grant grantPull(IGrantable grantee)
\`\`\`
Grant the given identity permissions to pull images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grantPullPush\`
\`\`\`java
public Grant grantPullPush(IGrantable grantee)
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`onCloudTrailEvent\`
\`\`\`java
public Rule onCloudTrailEvent(java.lang.String id)
public Rule onCloudTrailEvent(java.lang.String id, 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.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`onCloudTrailImagePushed\`
\`\`\`java
public Rule onCloudTrailImagePushed(java.lang.String id)
public Rule onCloudTrailImagePushed(java.lang.String id, 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.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`onEvent\`
\`\`\`java
public Rule onEvent(java.lang.String id)
public Rule onEvent(java.lang.String id, OnEventOptions options)
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* java.lang.String
---
###### \`options\`Optional
- *Type:* OnEventOptions
---
##### \`onImageScanCompleted\`
\`\`\`java
public Rule onImageScanCompleted(java.lang.String id)
public Rule onImageScanCompleted(java.lang.String id, OnImageScanCompletedOptions options)
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`repositoryUriForDigest\`
\`\`\`java
public java.lang.String repositoryUriForDigest()
public java.lang.String repositoryUriForDigest(java.lang.String digest)
\`\`\`
Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* java.lang.String
Image digest to use (tools usually default to the image with the "latest" tag if omitted).
---
##### \`repositoryUriForTag\`
\`\`\`java
public java.lang.String repositoryUriForTag()
public java.lang.String repositoryUriForTag(java.lang.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]
###### \`tag\`Optional
- *Type:* java.lang.String
Image tag to use (tools usually default to "latest" if omitted).
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node for this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repositoryArn
| java.lang.String
| The ARN of the repository. |
| repositoryName
| java.lang.String
| The name of the repository. |
| repositoryUri
| java.lang.String
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`java
public ConstructNode getNode();
\`\`\`
- *Type:* ConstructNode
The construct tree node for this construct.
---
##### \`env\`Required
\`\`\`java
public ResourceEnvironment getEnv();
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`java
public Stack getStack();
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repositoryArn\`Required
\`\`\`java
public java.lang.String getRepositoryArn();
\`\`\`
- *Type:* java.lang.String
The ARN of the repository.
---
##### \`repositoryName\`Required
\`\`\`java
public java.lang.String getRepositoryName();
\`\`\`
- *Type:* java.lang.String
The name of the repository.
---
##### \`repositoryUri\`Required
\`\`\`java
public java.lang.String getRepositoryUri();
\`\`\`
- *Type:* java.lang.String
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
## Enums
### TagMutability
The tag mutability setting for your repository.
#### Members
| **Name** | **Description** |
| --- | --- |
| MUTABLE
| allow image tags to be overwritten. |
| IMMUTABLE
| all image tags within the repository will be immutable which will prevent them from being overwritten. |
---
##### \`MUTABLE\`
allow image tags to be overwritten.
---
##### \`IMMUTABLE\`
all image tags within the repository will be immutable which will prevent them from being overwritten.
---
### TagStatus
Select images based on tags.
#### Members
| **Name** | **Description** |
| --- | --- |
| ANY
| Rule applies to all images. |
| TAGGED
| Rule applies to tagged images. |
| UNTAGGED
| Rule applies to untagged images. |
---
##### \`ANY\`
Rule applies to all images.
---
##### \`TAGGED\`
Rule applies to tagged images.
---
##### \`UNTAGGED\`
Rule applies to untagged images.
---
"
`;
exports[`complex link formatter python snapshot 1`] = `
"# Amazon ECR Construct Library
---


---
This package contains constructs for working with Amazon Elastic Container Registry.
## Repositories
Define a repository by creating a new instance of \`Repository\`. A repository
holds multiple verions of a single container image.
\`\`\`python
# Example automatically generated from non-compiling source. May contain errors.
repository = ecr.Repository(self, "Repository")
\`\`\`
## Image scanning
Amazon ECR image scanning helps in identifying software vulnerabilities in your container images. You can manually scan container images stored in Amazon ECR, or you can configure your repositories to scan images when you push them to a repository. To create a new repository to scan on push, simply enable \`imageScanOnPush\` in the properties
\`\`\`python
# Example automatically generated from non-compiling source. May contain errors.
repository = ecr.Repository(stack, "Repo",
image_scan_on_push=True
)
\`\`\`
To create an \`onImageScanCompleted\` event rule and trigger the event target
\`\`\`python
# Example automatically generated from non-compiling source. May contain errors.
repository.on_image_scan_completed("ImageScanComplete").add_target(...)
\`\`\`
### Authorization Token
Besides the Amazon ECR APIs, ECR also allows the Docker CLI or a language-specific Docker library to push and pull
images from an ECR repository. However, the Docker CLI does not support native IAM authentication methods and
additional steps must be taken so that Amazon ECR can authenticate and authorize Docker push and pull requests.
More information can be found at at [Registry Authentication](https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html#registry_auth).
A Docker authorization token can be obtained using the \`GetAuthorizationToken\` ECR API. The following code snippets
grants an IAM user access to call this API.
\`\`\`python
# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.aws_iam as iam
import aws_cdk.aws_ecr as ecr
user = iam.User(self, "User", ...)
ecr.AuthorizationToken.grant_read(user)
\`\`\`
If you access images in the [Public ECR Gallery](https://gallery.ecr.aws/) as well, it is recommended you authenticate to the registry to benefit from
higher rate and bandwidth limits.
> See \`Pricing\` in https://aws.amazon.com/blogs/aws/amazon-ecr-public-a-new-public-container-registry/ and [Service quotas](https://docs.aws.amazon.com/AmazonECR/latest/public/public-service-quotas.html).
The following code snippet grants an IAM user access to retrieve an authorization token for the public gallery.
\`\`\`python
# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.aws_iam as iam
import aws_cdk.aws_ecr as ecr
user = iam.User(self, "User", ...)
ecr.PublicGalleryAuthorizationToken.grant_read(user)
\`\`\`
This user can then proceed to login to the registry using one of the [authentication methods](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth).
### Image tag immutability
You can set tag immutability on images in our repository using the \`imageTagMutability\` construct prop.
\`\`\`python
# Example automatically generated from non-compiling source. May contain errors.
ecr.Repository(stack, "Repo", image_tag_mutability=ecr.TagMutability.IMMUTABLE)
\`\`\`
## Automatically clean up repositories
You can set life cycle rules to automatically clean up old images from your
repository. The first life cycle rule that matches an image will be applied
against that image. For example, the following deletes images older than
30 days, while keeping all images tagged with prod (note that the order
is important here):
\`\`\`python
# Example automatically generated from non-compiling source. May contain errors.
repository.add_lifecycle_rule(tag_prefix_list=["prod"], max_image_count=9999)
repository.add_lifecycle_rule(max_image_age=cdk.Duration.days(30))
\`\`\`
# API Reference
## Constructs
### CfnPublicRepository
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::PublicRepository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
#### Initializers
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnPublicRepository(
scope: Construct,
id: str,
repository_catalog_data: typing.Any = None,
repository_name: str = None,
repository_policy_text: typing.Any = None,
tags: typing.List[CfnTag] = None
)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| str
| - scoped id of the resource. |
| repository_catalog_data
| typing.Any
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| repository_name
| str
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
| repository_policy_text
| typing.Any
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| tags
| typing.List[CfnTag]
| \`AWS::ECR::PublicRepository.Tags\`. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* str
scoped id of the resource.
---
##### \`repository_catalog_data\`Optional
- *Type:* typing.Any
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`repository_name\`Optional
- *Type:* str
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
##### \`repository_policy_text\`Optional
- *Type:* typing.Any
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`tags\`Optional
- *Type:* typing.List[CfnTag]
\`AWS::ECR::PublicRepository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| to_string
| Returns a string representation of this construct. |
| override_logical_id
| Overrides the auto-generated logical ID with a specific ID. |
| add_deletion_override
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| add_depends_on
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| add_metadata
| Add a value to the CloudFormation Resource Metadata. |
| add_override
| Adds an override to the synthesized CloudFormation resource. |
| add_property_deletion_override
| Adds an override that deletes the value of a property from the resource definition. |
| add_property_override
| Adds an override to a resource property. |
| apply_removal_policy
| Sets the deletion policy of the resource based on the removal policy specified. |
| get_att
| Returns a token for an runtime attribute of this resource. |
| get_metadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`to_string\`
\`\`\`python
def to_string() -> str
\`\`\`
Returns a string representation of this construct.
##### \`override_logical_id\`
\`\`\`python
def override_logical_id(
new_logical_id: str
) -> None
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`new_logical_id\`Required
- *Type:* str
The new logical ID to use for this stack element.
---
##### \`add_deletion_override\`
\`\`\`python
def add_deletion_override(
path: str
) -> None
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* str
The path of the value to delete.
---
##### \`add_depends_on\`
\`\`\`python
def add_depends_on(
target: CfnResource
) -> None
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`add_metadata\`
\`\`\`python
def add_metadata(
key: str,
value: typing.Any
) -> None
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* str
---
###### \`value\`Required
- *Type:* typing.Any
---
##### \`add_override\`
\`\`\`python
def add_override(
path: str,
value: typing.Any
) -> None
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* str
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* typing.Any
The value.
Could be primitive or complex.
---
##### \`add_property_deletion_override\`
\`\`\`python
def add_property_deletion_override(
property_path: str
) -> None
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`property_path\`Required
- *Type:* str
The path to the property.
---
##### \`add_property_override\`
\`\`\`python
def add_property_override(
property_path: str,
value: typing.Any
) -> None
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`property_path\`Required
- *Type:* str
The path of the property.
---
###### \`value\`Required
- *Type:* typing.Any
The value.
---
##### \`apply_removal_policy\`
\`\`\`python
def apply_removal_policy(
policy: RemovalPolicy = None,
apply_to_update_replace_policy: bool = None,
default: RemovalPolicy = None
) -> None
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`apply_to_update_replace_policy\`Optional
- *Type:* bool
- *Default:* true
Apply the same deletion policy to the resource's "UpdateReplacePolicy".
---
###### \`default\`Optional
- *Type:* RemovalPolicy
- *Default:* Default value is resource specific. To determine the default value for a resoure, please consult that specific resource's documentation.
The default policy to apply in case the removal policy is not defined.
---
##### \`get_att\`
\`\`\`python
def get_att(
attribute_name: str
) -> Reference
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attribute_name\`Required
- *Type:* str
The name of the attribute.
---
##### \`get_metadata\`
\`\`\`python
def get_metadata(
key: str
) -> typing.Any
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* str
---
##### \`inspect\`
\`\`\`python
def inspect(
inspector: TreeInspector
) -> None
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| is_construct
| Return whether the given object is a Construct. |
| is_cfn_element
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| is_cfn_resource
| Check whether the given construct is a CfnResource. |
---
##### \`is_construct\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnPublicRepository.is_construct(
x: typing.Any
)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_cfn_element\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnPublicRepository.is_cfn_element(
x: typing.Any
)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_cfn_resource\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnPublicRepository.is_cfn_resource(
construct: IConstruct
)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creation_stack
| typing.List[str]
| *No description.* |
| logical_id
| str
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| str
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfn_options
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfn_resource_type
| str
| AWS resource type. |
| attr_arn
| str
| *No description.* |
| tags
| TagManager
| \`AWS::ECR::PublicRepository.Tags\`. |
| repository_catalog_data
| typing.Any
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| repository_policy_text
| typing.Any
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| repository_name
| str
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
---
##### \`node\`Required
\`\`\`python
node: ConstructNode
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creation_stack\`Required
\`\`\`python
creation_stack: typing.List[str]
\`\`\`
- *Type:* typing.List[str]
---
##### \`logical_id\`Required
\`\`\`python
logical_id: str
\`\`\`
- *Type:* str
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`stack\`Required
\`\`\`python
stack: Stack
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`ref\`Required
\`\`\`python
ref: str
\`\`\`
- *Type:* str
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`cfn_options\`Required
\`\`\`python
cfn_options: ICfnResourceOptions
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`cfn_resource_type\`Required
\`\`\`python
cfn_resource_type: str
\`\`\`
- *Type:* str
AWS resource type.
---
##### \`attr_arn\`Required
\`\`\`python
attr_arn: str
\`\`\`
- *Type:* str
---
##### \`tags\`Required
\`\`\`python
tags: TagManager
\`\`\`
- *Type:* TagManager
\`AWS::ECR::PublicRepository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
---
##### \`repository_catalog_data\`Required
\`\`\`python
repository_catalog_data: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`repository_policy_text\`Required
\`\`\`python
repository_policy_text: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`repository_name\`Optional
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CFN_RESOURCE_TYPE_NAME
| str
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`python
CFN_RESOURCE_TYPE_NAME: str
\`\`\`
- *Type:* str
The CloudFormation resource type name for this resource class.
---
### CfnRegistryPolicy
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::RegistryPolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html)
#### Initializers
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRegistryPolicy(
scope: Construct,
id: str,
policy_text: typing.Any
)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| str
| - scoped id of the resource. |
| policy_text
| typing.Any
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* str
scoped id of the resource.
---
##### \`policy_text\`Required
- *Type:* typing.Any
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| to_string
| Returns a string representation of this construct. |
| override_logical_id
| Overrides the auto-generated logical ID with a specific ID. |
| add_deletion_override
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| add_depends_on
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| add_metadata
| Add a value to the CloudFormation Resource Metadata. |
| add_override
| Adds an override to the synthesized CloudFormation resource. |
| add_property_deletion_override
| Adds an override that deletes the value of a property from the resource definition. |
| add_property_override
| Adds an override to a resource property. |
| apply_removal_policy
| Sets the deletion policy of the resource based on the removal policy specified. |
| get_att
| Returns a token for an runtime attribute of this resource. |
| get_metadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`to_string\`
\`\`\`python
def to_string() -> str
\`\`\`
Returns a string representation of this construct.
##### \`override_logical_id\`
\`\`\`python
def override_logical_id(
new_logical_id: str
) -> None
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`new_logical_id\`Required
- *Type:* str
The new logical ID to use for this stack element.
---
##### \`add_deletion_override\`
\`\`\`python
def add_deletion_override(
path: str
) -> None
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* str
The path of the value to delete.
---
##### \`add_depends_on\`
\`\`\`python
def add_depends_on(
target: CfnResource
) -> None
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`add_metadata\`
\`\`\`python
def add_metadata(
key: str,
value: typing.Any
) -> None
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* str
---
###### \`value\`Required
- *Type:* typing.Any
---
##### \`add_override\`
\`\`\`python
def add_override(
path: str,
value: typing.Any
) -> None
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* str
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* typing.Any
The value.
Could be primitive or complex.
---
##### \`add_property_deletion_override\`
\`\`\`python
def add_property_deletion_override(
property_path: str
) -> None
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`property_path\`Required
- *Type:* str
The path to the property.
---
##### \`add_property_override\`
\`\`\`python
def add_property_override(
property_path: str,
value: typing.Any
) -> None
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`property_path\`Required
- *Type:* str
The path of the property.
---
###### \`value\`Required
- *Type:* typing.Any
The value.
---
##### \`apply_removal_policy\`
\`\`\`python
def apply_removal_policy(
policy: RemovalPolicy = None,
apply_to_update_replace_policy: bool = None,
default: RemovalPolicy = None
) -> None
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`apply_to_update_replace_policy\`Optional
- *Type:* bool
- *Default:* true
Apply the same deletion policy to the resource's "UpdateReplacePolicy".
---
###### \`default\`Optional
- *Type:* RemovalPolicy
- *Default:* Default value is resource specific. To determine the default value for a resoure, please consult that specific resource's documentation.
The default policy to apply in case the removal policy is not defined.
---
##### \`get_att\`
\`\`\`python
def get_att(
attribute_name: str
) -> Reference
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attribute_name\`Required
- *Type:* str
The name of the attribute.
---
##### \`get_metadata\`
\`\`\`python
def get_metadata(
key: str
) -> typing.Any
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* str
---
##### \`inspect\`
\`\`\`python
def inspect(
inspector: TreeInspector
) -> None
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| is_construct
| Return whether the given object is a Construct. |
| is_cfn_element
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| is_cfn_resource
| Check whether the given construct is a CfnResource. |
---
##### \`is_construct\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRegistryPolicy.is_construct(
x: typing.Any
)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_cfn_element\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRegistryPolicy.is_cfn_element(
x: typing.Any
)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_cfn_resource\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRegistryPolicy.is_cfn_resource(
construct: IConstruct
)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creation_stack
| typing.List[str]
| *No description.* |
| logical_id
| str
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| str
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfn_options
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfn_resource_type
| str
| AWS resource type. |
| attr_registry_id
| str
| *No description.* |
| policy_text
| typing.Any
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`node\`Required
\`\`\`python
node: ConstructNode
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creation_stack\`Required
\`\`\`python
creation_stack: typing.List[str]
\`\`\`
- *Type:* typing.List[str]
---
##### \`logical_id\`Required
\`\`\`python
logical_id: str
\`\`\`
- *Type:* str
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`stack\`Required
\`\`\`python
stack: Stack
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`ref\`Required
\`\`\`python
ref: str
\`\`\`
- *Type:* str
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`cfn_options\`Required
\`\`\`python
cfn_options: ICfnResourceOptions
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`cfn_resource_type\`Required
\`\`\`python
cfn_resource_type: str
\`\`\`
- *Type:* str
AWS resource type.
---
##### \`attr_registry_id\`Required
\`\`\`python
attr_registry_id: str
\`\`\`
- *Type:* str
---
##### \`policy_text\`Required
\`\`\`python
policy_text: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CFN_RESOURCE_TYPE_NAME
| str
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`python
CFN_RESOURCE_TYPE_NAME: str
\`\`\`
- *Type:* str
The CloudFormation resource type name for this resource class.
---
### CfnReplicationConfiguration
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
#### Initializers
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnReplicationConfiguration(
scope: Construct,
id: str,
replication_configuration: typing.Union[IResolvable, ReplicationConfigurationProperty]
)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| str
| - scoped id of the resource. |
| replication_configuration
| typing.Union[IResolvable, ReplicationConfigurationProperty]
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* str
scoped id of the resource.
---
##### \`replication_configuration\`Required
- *Type:* typing.Union[IResolvable, ReplicationConfigurationProperty]
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| to_string
| Returns a string representation of this construct. |
| override_logical_id
| Overrides the auto-generated logical ID with a specific ID. |
| add_deletion_override
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| add_depends_on
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| add_metadata
| Add a value to the CloudFormation Resource Metadata. |
| add_override
| Adds an override to the synthesized CloudFormation resource. |
| add_property_deletion_override
| Adds an override that deletes the value of a property from the resource definition. |
| add_property_override
| Adds an override to a resource property. |
| apply_removal_policy
| Sets the deletion policy of the resource based on the removal policy specified. |
| get_att
| Returns a token for an runtime attribute of this resource. |
| get_metadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`to_string\`
\`\`\`python
def to_string() -> str
\`\`\`
Returns a string representation of this construct.
##### \`override_logical_id\`
\`\`\`python
def override_logical_id(
new_logical_id: str
) -> None
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`new_logical_id\`Required
- *Type:* str
The new logical ID to use for this stack element.
---
##### \`add_deletion_override\`
\`\`\`python
def add_deletion_override(
path: str
) -> None
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* str
The path of the value to delete.
---
##### \`add_depends_on\`
\`\`\`python
def add_depends_on(
target: CfnResource
) -> None
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`add_metadata\`
\`\`\`python
def add_metadata(
key: str,
value: typing.Any
) -> None
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* str
---
###### \`value\`Required
- *Type:* typing.Any
---
##### \`add_override\`
\`\`\`python
def add_override(
path: str,
value: typing.Any
) -> None
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* str
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* typing.Any
The value.
Could be primitive or complex.
---
##### \`add_property_deletion_override\`
\`\`\`python
def add_property_deletion_override(
property_path: str
) -> None
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`property_path\`Required
- *Type:* str
The path to the property.
---
##### \`add_property_override\`
\`\`\`python
def add_property_override(
property_path: str,
value: typing.Any
) -> None
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`property_path\`Required
- *Type:* str
The path of the property.
---
###### \`value\`Required
- *Type:* typing.Any
The value.
---
##### \`apply_removal_policy\`
\`\`\`python
def apply_removal_policy(
policy: RemovalPolicy = None,
apply_to_update_replace_policy: bool = None,
default: RemovalPolicy = None
) -> None
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`apply_to_update_replace_policy\`Optional
- *Type:* bool
- *Default:* true
Apply the same deletion policy to the resource's "UpdateReplacePolicy".
---
###### \`default\`Optional
- *Type:* RemovalPolicy
- *Default:* Default value is resource specific. To determine the default value for a resoure, please consult that specific resource's documentation.
The default policy to apply in case the removal policy is not defined.
---
##### \`get_att\`
\`\`\`python
def get_att(
attribute_name: str
) -> Reference
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attribute_name\`Required
- *Type:* str
The name of the attribute.
---
##### \`get_metadata\`
\`\`\`python
def get_metadata(
key: str
) -> typing.Any
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* str
---
##### \`inspect\`
\`\`\`python
def inspect(
inspector: TreeInspector
) -> None
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| is_construct
| Return whether the given object is a Construct. |
| is_cfn_element
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| is_cfn_resource
| Check whether the given construct is a CfnResource. |
---
##### \`is_construct\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnReplicationConfiguration.is_construct(
x: typing.Any
)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_cfn_element\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnReplicationConfiguration.is_cfn_element(
x: typing.Any
)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_cfn_resource\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnReplicationConfiguration.is_cfn_resource(
construct: IConstruct
)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creation_stack
| typing.List[str]
| *No description.* |
| logical_id
| str
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| str
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfn_options
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfn_resource_type
| str
| AWS resource type. |
| attr_registry_id
| str
| *No description.* |
| replication_configuration
| typing.Union[IResolvable, ReplicationConfigurationProperty]
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`node\`Required
\`\`\`python
node: ConstructNode
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creation_stack\`Required
\`\`\`python
creation_stack: typing.List[str]
\`\`\`
- *Type:* typing.List[str]
---
##### \`logical_id\`Required
\`\`\`python
logical_id: str
\`\`\`
- *Type:* str
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`stack\`Required
\`\`\`python
stack: Stack
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`ref\`Required
\`\`\`python
ref: str
\`\`\`
- *Type:* str
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`cfn_options\`Required
\`\`\`python
cfn_options: ICfnResourceOptions
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`cfn_resource_type\`Required
\`\`\`python
cfn_resource_type: str
\`\`\`
- *Type:* str
AWS resource type.
---
##### \`attr_registry_id\`Required
\`\`\`python
attr_registry_id: str
\`\`\`
- *Type:* str
---
##### \`replication_configuration\`Required
\`\`\`python
replication_configuration: typing.Union[IResolvable, ReplicationConfigurationProperty]
\`\`\`
- *Type:* typing.Union[IResolvable, ReplicationConfigurationProperty]
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CFN_RESOURCE_TYPE_NAME
| str
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`python
CFN_RESOURCE_TYPE_NAME: str
\`\`\`
- *Type:* str
The CloudFormation resource type name for this resource class.
---
### CfnRepository
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::Repository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
#### Initializers
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRepository(
scope: Construct,
id: str,
encryption_configuration: typing.Any = None,
image_scanning_configuration: typing.Any = None,
image_tag_mutability: str = None,
lifecycle_policy: typing.Union[IResolvable, LifecyclePolicyProperty] = None,
repository_name: str = None,
repository_policy_text: typing.Any = None,
tags: typing.List[CfnTag] = None
)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| str
| - scoped id of the resource. |
| encryption_configuration
| typing.Any
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| image_scanning_configuration
| typing.Any
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| image_tag_mutability
| str
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| lifecycle_policy
| typing.Union[IResolvable, LifecyclePolicyProperty]
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| repository_name
| str
| \`AWS::ECR::Repository.RepositoryName\`. |
| repository_policy_text
| typing.Any
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| tags
| typing.List[CfnTag]
| \`AWS::ECR::Repository.Tags\`. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* str
scoped id of the resource.
---
##### \`encryption_configuration\`Optional
- *Type:* typing.Any
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`image_scanning_configuration\`Optional
- *Type:* typing.Any
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`image_tag_mutability\`Optional
- *Type:* str
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`lifecycle_policy\`Optional
- *Type:* typing.Union[IResolvable, LifecyclePolicyProperty]
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`repository_name\`Optional
- *Type:* str
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
##### \`repository_policy_text\`Optional
- *Type:* typing.Any
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`tags\`Optional
- *Type:* typing.List[CfnTag]
\`AWS::ECR::Repository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| to_string
| Returns a string representation of this construct. |
| override_logical_id
| Overrides the auto-generated logical ID with a specific ID. |
| add_deletion_override
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| add_depends_on
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| add_metadata
| Add a value to the CloudFormation Resource Metadata. |
| add_override
| Adds an override to the synthesized CloudFormation resource. |
| add_property_deletion_override
| Adds an override that deletes the value of a property from the resource definition. |
| add_property_override
| Adds an override to a resource property. |
| apply_removal_policy
| Sets the deletion policy of the resource based on the removal policy specified. |
| get_att
| Returns a token for an runtime attribute of this resource. |
| get_metadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`to_string\`
\`\`\`python
def to_string() -> str
\`\`\`
Returns a string representation of this construct.
##### \`override_logical_id\`
\`\`\`python
def override_logical_id(
new_logical_id: str
) -> None
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`new_logical_id\`Required
- *Type:* str
The new logical ID to use for this stack element.
---
##### \`add_deletion_override\`
\`\`\`python
def add_deletion_override(
path: str
) -> None
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* str
The path of the value to delete.
---
##### \`add_depends_on\`
\`\`\`python
def add_depends_on(
target: CfnResource
) -> None
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`add_metadata\`
\`\`\`python
def add_metadata(
key: str,
value: typing.Any
) -> None
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* str
---
###### \`value\`Required
- *Type:* typing.Any
---
##### \`add_override\`
\`\`\`python
def add_override(
path: str,
value: typing.Any
) -> None
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* str
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* typing.Any
The value.
Could be primitive or complex.
---
##### \`add_property_deletion_override\`
\`\`\`python
def add_property_deletion_override(
property_path: str
) -> None
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`property_path\`Required
- *Type:* str
The path to the property.
---
##### \`add_property_override\`
\`\`\`python
def add_property_override(
property_path: str,
value: typing.Any
) -> None
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`property_path\`Required
- *Type:* str
The path of the property.
---
###### \`value\`Required
- *Type:* typing.Any
The value.
---
##### \`apply_removal_policy\`
\`\`\`python
def apply_removal_policy(
policy: RemovalPolicy = None,
apply_to_update_replace_policy: bool = None,
default: RemovalPolicy = None
) -> None
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`apply_to_update_replace_policy\`Optional
- *Type:* bool
- *Default:* true
Apply the same deletion policy to the resource's "UpdateReplacePolicy".
---
###### \`default\`Optional
- *Type:* RemovalPolicy
- *Default:* Default value is resource specific. To determine the default value for a resoure, please consult that specific resource's documentation.
The default policy to apply in case the removal policy is not defined.
---
##### \`get_att\`
\`\`\`python
def get_att(
attribute_name: str
) -> Reference
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attribute_name\`Required
- *Type:* str
The name of the attribute.
---
##### \`get_metadata\`
\`\`\`python
def get_metadata(
key: str
) -> typing.Any
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* str
---
##### \`inspect\`
\`\`\`python
def inspect(
inspector: TreeInspector
) -> None
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| is_construct
| Return whether the given object is a Construct. |
| is_cfn_element
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| is_cfn_resource
| Check whether the given construct is a CfnResource. |
---
##### \`is_construct\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRepository.is_construct(
x: typing.Any
)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_cfn_element\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRepository.is_cfn_element(
x: typing.Any
)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_cfn_resource\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRepository.is_cfn_resource(
construct: IConstruct
)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creation_stack
| typing.List[str]
| *No description.* |
| logical_id
| str
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| str
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfn_options
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfn_resource_type
| str
| AWS resource type. |
| attr_arn
| str
| *No description.* |
| attr_repository_uri
| str
| *No description.* |
| tags
| TagManager
| \`AWS::ECR::Repository.Tags\`. |
| encryption_configuration
| typing.Any
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| image_scanning_configuration
| typing.Any
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| repository_policy_text
| typing.Any
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| image_tag_mutability
| str
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| lifecycle_policy
| typing.Union[IResolvable, LifecyclePolicyProperty]
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| repository_name
| str
| \`AWS::ECR::Repository.RepositoryName\`. |
---
##### \`node\`Required
\`\`\`python
node: ConstructNode
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creation_stack\`Required
\`\`\`python
creation_stack: typing.List[str]
\`\`\`
- *Type:* typing.List[str]
---
##### \`logical_id\`Required
\`\`\`python
logical_id: str
\`\`\`
- *Type:* str
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`stack\`Required
\`\`\`python
stack: Stack
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`ref\`Required
\`\`\`python
ref: str
\`\`\`
- *Type:* str
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`cfn_options\`Required
\`\`\`python
cfn_options: ICfnResourceOptions
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`cfn_resource_type\`Required
\`\`\`python
cfn_resource_type: str
\`\`\`
- *Type:* str
AWS resource type.
---
##### \`attr_arn\`Required
\`\`\`python
attr_arn: str
\`\`\`
- *Type:* str
---
##### \`attr_repository_uri\`Required
\`\`\`python
attr_repository_uri: str
\`\`\`
- *Type:* str
---
##### \`tags\`Required
\`\`\`python
tags: TagManager
\`\`\`
- *Type:* TagManager
\`AWS::ECR::Repository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
---
##### \`encryption_configuration\`Required
\`\`\`python
encryption_configuration: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`image_scanning_configuration\`Required
\`\`\`python
image_scanning_configuration: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`repository_policy_text\`Required
\`\`\`python
repository_policy_text: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`image_tag_mutability\`Optional
\`\`\`python
image_tag_mutability: str
\`\`\`
- *Type:* str
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`lifecycle_policy\`Optional
\`\`\`python
lifecycle_policy: typing.Union[IResolvable, LifecyclePolicyProperty]
\`\`\`
- *Type:* typing.Union[IResolvable, LifecyclePolicyProperty]
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`repository_name\`Optional
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CFN_RESOURCE_TYPE_NAME
| str
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`python
CFN_RESOURCE_TYPE_NAME: str
\`\`\`
- *Type:* str
The CloudFormation resource type name for this resource class.
---
### Repository
Define an ECR repository.
#### Initializers
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.Repository(
scope: Construct,
id: str,
image_scan_on_push: bool = None,
image_tag_mutability: TagMutability = None,
lifecycle_registry_id: str = None,
lifecycle_rules: typing.List[LifecycleRule] = None,
removal_policy: RemovalPolicy = None,
repository_name: str = None
)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| *No description.* |
| id
| str
| *No description.* |
| image_scan_on_push
| bool
| Enable the scan on push when creating the repository. |
| image_tag_mutability
| TagMutability
| The tag mutability setting for the repository. |
| lifecycle_registry_id
| str
| The AWS account ID associated with the registry that contains the repository. |
| lifecycle_rules
| typing.List[LifecycleRule]
| Life cycle rules to apply to this registry. |
| removal_policy
| RemovalPolicy
| Determine what happens to the repository when the resource/stack is deleted. |
| repository_name
| str
| Name for this repository. |
---
##### \`scope\`Required
- *Type:* Construct
---
##### \`id\`Required
- *Type:* str
---
##### \`image_scan_on_push\`Optional
- *Type:* bool
- *Default:* false
Enable the scan on push when creating the repository.
---
##### \`image_tag_mutability\`Optional
- *Type:* TagMutability
- *Default:* TagMutability.MUTABLE
The tag mutability setting for the repository.
If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten.
---
##### \`lifecycle_registry_id\`Optional
- *Type:* str
- *Default:* The default registry is assumed.
The AWS account ID associated with the registry that contains the repository.
> [https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html](https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html)
---
##### \`lifecycle_rules\`Optional
- *Type:* typing.List[LifecycleRule]
- *Default:* No life cycle rules
Life cycle rules to apply to this registry.
---
##### \`removal_policy\`Optional
- *Type:* RemovalPolicy
- *Default:* RemovalPolicy.Retain
Determine what happens to the repository when the resource/stack is deleted.
---
##### \`repository_name\`Optional
- *Type:* str
- *Default:* Automatically generated name.
Name for this repository.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| to_string
| Returns a string representation of this construct. |
| apply_removal_policy
| Apply the given removal policy to this resource. |
| add_to_resource_policy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grant_pull
| Grant the given identity permissions to use the images in this repository. |
| grant_pull_push
| Grant the given identity permissions to pull and push images to this repository. |
| on_cloud_trail_event
| Define a CloudWatch event that triggers when something happens to this repository. |
| on_cloud_trail_image_pushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| on_event
| Defines a CloudWatch event rule which triggers for repository events. |
| on_image_scan_completed
| Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed. |
| repository_uri_for_digest
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| repository_uri_for_tag
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| add_lifecycle_rule
| Add a life cycle rule to the repository. |
---
##### \`to_string\`
\`\`\`python
def to_string() -> str
\`\`\`
Returns a string representation of this construct.
##### \`apply_removal_policy\`
\`\`\`python
def apply_removal_policy(
policy: RemovalPolicy
) -> None
\`\`\`
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (\`RemovalPolicy.DELETE\`), or left in your AWS
account for data recovery and cleanup later (\`RemovalPolicy.RETAIN\`).
###### \`policy\`Required
- *Type:* RemovalPolicy
---
##### \`add_to_resource_policy\`
\`\`\`python
def add_to_resource_policy(
statement: PolicyStatement
) -> AddToResourcePolicyResult
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`python
def grant(
grantee: IGrantable,
actions: str
) -> Grant
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* str
---
##### \`grant_pull\`
\`\`\`python
def grant_pull(
grantee: IGrantable
) -> Grant
\`\`\`
Grant the given identity permissions to use the images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grant_pull_push\`
\`\`\`python
def grant_pull_push(
grantee: IGrantable
) -> Grant
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`on_cloud_trail_event\`
\`\`\`python
def on_cloud_trail_event(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None
) -> Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`on_cloud_trail_image_pushed\`
\`\`\`python
def on_cloud_trail_image_pushed(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None,
image_tag: str = None
) -> Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
###### \`image_tag\`Optional
- *Type:* str
- *Default:* Watch changes to all tags
Only watch changes to this image tag.
---
##### \`on_event\`
\`\`\`python
def on_event(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None
) -> Rule
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* str
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`on_image_scan_completed\`
\`\`\`python
def on_image_scan_completed(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None,
image_tags: typing.List[str] = None
) -> Rule
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
###### \`image_tags\`Optional
- *Type:* typing.List[str]
- *Default:* Watch the changes to the repository with all image tags
Only watch changes to the image tags spedified.
Leave it undefined to watch the full repository.
---
##### \`repository_uri_for_digest\`
\`\`\`python
def repository_uri_for_digest(
digest: str = None
) -> str
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* str
Optional image digest.
---
##### \`repository_uri_for_tag\`
\`\`\`python
def repository_uri_for_tag(
tag: str = None
) -> str
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
###### \`tag\`Optional
- *Type:* str
Optional image tag.
---
##### \`add_lifecycle_rule\`
\`\`\`python
def add_lifecycle_rule(
description: str = None,
max_image_age: Duration = None,
max_image_count: typing.Union[int, float] = None,
rule_priority: typing.Union[int, float] = None,
tag_prefix_list: typing.List[str] = None,
tag_status: TagStatus = None
) -> None
\`\`\`
Add a life cycle rule to the repository.
Life cycle rules automatically expire images from the repository that match
certain conditions.
###### \`description\`Optional
- *Type:* str
- *Default:* No description
Describes the purpose of the rule.
---
###### \`max_image_age\`Optional
- *Type:* Duration
The maximum age of images to retain. The value must represent a number of days.
Specify exactly one of maxImageCount and maxImageAge.
---
###### \`max_image_count\`Optional
- *Type:* typing.Union[int, float]
The maximum number of images to retain.
Specify exactly one of maxImageCount and maxImageAge.
---
###### \`rule_priority\`Optional
- *Type:* typing.Union[int, float]
- *Default:* Automatically assigned
Controls the order in which rules are evaluated (low to high).
All rules must have a unique priority, where lower numbers have
higher precedence. The first rule that matches is applied to an image.
There can only be one rule with a tagStatus of Any, and it must have
the highest rulePriority.
All rules without a specified priority will have incrementing priorities
automatically assigned to them, higher than any rules that DO have priorities.
---
###### \`tag_prefix_list\`Optional
- *Type:* typing.List[str]
Select images that have ALL the given prefixes in their tag.
Only if tagStatus == TagStatus.Tagged
---
###### \`tag_status\`Optional
- *Type:* TagStatus
- *Default:* TagStatus.Tagged if tagPrefixList is given, TagStatus.Any otherwise
Select images based on tags.
Only one rule is allowed to select untagged images, and it must
have the highest rulePriority.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| is_construct
| Return whether the given object is a Construct. |
| is_resource
| Check whether the given construct is a Resource. |
| arn_for_local_repository
| Returns an ECR ARN for a repository that resides in the same account/region as the current stack. |
| from_repository_arn
| *No description.* |
| from_repository_attributes
| Import a repository. |
| from_repository_name
| *No description.* |
---
##### \`is_construct\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.Repository.is_construct(
x: typing.Any
)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_resource\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.Repository.is_resource(
construct: IConstruct
)
\`\`\`
Check whether the given construct is a Resource.
###### \`construct\`Required
- *Type:* IConstruct
---
##### \`arn_for_local_repository\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.Repository.arn_for_local_repository(
repository_name: str,
scope: IConstruct,
account: str = None
)
\`\`\`
Returns an ECR ARN for a repository that resides in the same account/region as the current stack.
###### \`repository_name\`Required
- *Type:* str
---
###### \`scope\`Required
- *Type:* IConstruct
---
###### \`account\`Optional
- *Type:* str
---
##### \`from_repository_arn\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.Repository.from_repository_arn(
scope: Construct,
id: str,
repository_arn: str
)
\`\`\`
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* str
---
###### \`repository_arn\`Required
- *Type:* str
---
##### \`from_repository_attributes\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.Repository.from_repository_attributes(
scope: Construct,
id: str,
repository_arn: str,
repository_name: str
)
\`\`\`
Import a repository.
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* str
---
###### \`repository_arn\`Required
- *Type:* str
---
###### \`repository_name\`Required
- *Type:* str
---
##### \`from_repository_name\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.Repository.from_repository_name(
scope: Construct,
id: str,
repository_name: str
)
\`\`\`
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* str
---
###### \`repository_name\`Required
- *Type:* str
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repository_arn
| str
| The ARN of the repository. |
| repository_name
| str
| The name of the repository. |
| repository_uri
| str
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`python
node: ConstructNode
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`env\`Required
\`\`\`python
env: ResourceEnvironment
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`python
stack: Stack
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repository_arn\`Required
\`\`\`python
repository_arn: str
\`\`\`
- *Type:* str
The ARN of the repository.
---
##### \`repository_name\`Required
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
The name of the repository.
---
##### \`repository_uri\`Required
\`\`\`python
repository_uri: str
\`\`\`
- *Type:* str
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
### RepositoryBase
- *Implements:* IRepository
Base class for ECR repository.
Reused between imported repositories and owned repositories.
#### Initializers
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.RepositoryBase(
scope: Construct,
id: str,
account: str = None,
environment_from_arn: str = None,
physical_name: str = None,
region: str = None
)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| *No description.* |
| id
| str
| *No description.* |
| account
| str
| The AWS account ID this resource belongs to. |
| environment_from_arn
| str
| ARN to deduce region and account from. |
| physical_name
| str
| The value passed in by users to the physical name prop of the resource. |
| region
| str
| The AWS region this resource belongs to. |
---
##### \`scope\`Required
- *Type:* Construct
---
##### \`id\`Required
- *Type:* str
---
##### \`account\`Optional
- *Type:* str
- *Default:* the resource is in the same account as the stack it belongs to
The AWS account ID this resource belongs to.
---
##### \`environment_from_arn\`Optional
- *Type:* str
- *Default:* take environment from \`account\`, \`region\` parameters, or use Stack environment.
ARN to deduce region and account from.
The ARN is parsed and the account and region are taken from the ARN.
This should be used for imported resources.
Cannot be supplied together with either \`account\` or \`region\`.
---
##### \`physical_name\`Optional
- *Type:* str
- *Default:* The physical name will be allocated by CloudFormation at deployment time
The value passed in by users to the physical name prop of the resource.
\`undefined\` implies that a physical name will be allocated by
CloudFormation during deployment.
- a concrete value implies a specific physical name
- \`PhysicalName.GENERATE_IF_NEEDED\` is a marker that indicates that a physical will only be generated
by the CDK if it is needed for cross-environment references. Otherwise, it will be allocated by CloudFormation.
---
##### \`region\`Optional
- *Type:* str
- *Default:* the resource is in the same region as the stack it belongs to
The AWS region this resource belongs to.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| to_string
| Returns a string representation of this construct. |
| apply_removal_policy
| Apply the given removal policy to this resource. |
| add_to_resource_policy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grant_pull
| Grant the given identity permissions to use the images in this repository. |
| grant_pull_push
| Grant the given identity permissions to pull and push images to this repository. |
| on_cloud_trail_event
| Define a CloudWatch event that triggers when something happens to this repository. |
| on_cloud_trail_image_pushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| on_event
| Defines a CloudWatch event rule which triggers for repository events. |
| on_image_scan_completed
| Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed. |
| repository_uri_for_digest
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| repository_uri_for_tag
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
---
##### \`to_string\`
\`\`\`python
def to_string() -> str
\`\`\`
Returns a string representation of this construct.
##### \`apply_removal_policy\`
\`\`\`python
def apply_removal_policy(
policy: RemovalPolicy
) -> None
\`\`\`
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (\`RemovalPolicy.DELETE\`), or left in your AWS
account for data recovery and cleanup later (\`RemovalPolicy.RETAIN\`).
###### \`policy\`Required
- *Type:* RemovalPolicy
---
##### \`add_to_resource_policy\`
\`\`\`python
def add_to_resource_policy(
statement: PolicyStatement
) -> AddToResourcePolicyResult
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`python
def grant(
grantee: IGrantable,
actions: str
) -> Grant
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* str
---
##### \`grant_pull\`
\`\`\`python
def grant_pull(
grantee: IGrantable
) -> Grant
\`\`\`
Grant the given identity permissions to use the images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grant_pull_push\`
\`\`\`python
def grant_pull_push(
grantee: IGrantable
) -> Grant
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`on_cloud_trail_event\`
\`\`\`python
def on_cloud_trail_event(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None
) -> Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`on_cloud_trail_image_pushed\`
\`\`\`python
def on_cloud_trail_image_pushed(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None,
image_tag: str = None
) -> Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
###### \`image_tag\`Optional
- *Type:* str
- *Default:* Watch changes to all tags
Only watch changes to this image tag.
---
##### \`on_event\`
\`\`\`python
def on_event(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None
) -> Rule
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* str
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`on_image_scan_completed\`
\`\`\`python
def on_image_scan_completed(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None,
image_tags: typing.List[str] = None
) -> Rule
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
###### \`image_tags\`Optional
- *Type:* typing.List[str]
- *Default:* Watch the changes to the repository with all image tags
Only watch changes to the image tags spedified.
Leave it undefined to watch the full repository.
---
##### \`repository_uri_for_digest\`
\`\`\`python
def repository_uri_for_digest(
digest: str = None
) -> str
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* str
Optional image digest.
---
##### \`repository_uri_for_tag\`
\`\`\`python
def repository_uri_for_tag(
tag: str = None
) -> str
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
###### \`tag\`Optional
- *Type:* str
Optional image tag.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| is_construct
| Return whether the given object is a Construct. |
| is_resource
| Check whether the given construct is a Resource. |
---
##### \`is_construct\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.RepositoryBase.is_construct(
x: typing.Any
)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_resource\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.RepositoryBase.is_resource(
construct: IConstruct
)
\`\`\`
Check whether the given construct is a Resource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repository_arn
| str
| The ARN of the repository. |
| repository_name
| str
| The name of the repository. |
| repository_uri
| str
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`python
node: ConstructNode
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`env\`Required
\`\`\`python
env: ResourceEnvironment
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`python
stack: Stack
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repository_arn\`Required
\`\`\`python
repository_arn: str
\`\`\`
- *Type:* str
The ARN of the repository.
---
##### \`repository_name\`Required
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
The name of the repository.
---
##### \`repository_uri\`Required
\`\`\`python
repository_uri: str
\`\`\`
- *Type:* str
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
## Structs
### CfnPublicRepositoryProps
Properties for defining a \`AWS::ECR::PublicRepository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnPublicRepositoryProps(
repository_catalog_data: typing.Any = None,
repository_name: str = None,
repository_policy_text: typing.Any = None,
tags: typing.List[CfnTag] = None
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| repository_catalog_data
| typing.Any
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| repository_name
| str
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
| repository_policy_text
| typing.Any
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| tags
| typing.List[CfnTag]
| \`AWS::ECR::PublicRepository.Tags\`. |
---
##### \`repository_catalog_data\`Optional
\`\`\`python
repository_catalog_data: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`repository_name\`Optional
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
##### \`repository_policy_text\`Optional
\`\`\`python
repository_policy_text: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`tags\`Optional
\`\`\`python
tags: typing.List[CfnTag]
\`\`\`
- *Type:* typing.List[CfnTag]
\`AWS::ECR::PublicRepository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
---
### CfnRegistryPolicyProps
Properties for defining a \`AWS::ECR::RegistryPolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html)
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRegistryPolicyProps(
policy_text: typing.Any
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| policy_text
| typing.Any
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`policy_text\`Required
\`\`\`python
policy_text: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
### CfnReplicationConfigurationProps
Properties for defining a \`AWS::ECR::ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnReplicationConfigurationProps(
replication_configuration: typing.Union[IResolvable, ReplicationConfigurationProperty]
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| replication_configuration
| typing.Union[IResolvable, ReplicationConfigurationProperty]
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`replication_configuration\`Required
\`\`\`python
replication_configuration: typing.Union[IResolvable, ReplicationConfigurationProperty]
\`\`\`
- *Type:* typing.Union[IResolvable, ReplicationConfigurationProperty]
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
### CfnRepositoryProps
Properties for defining a \`AWS::ECR::Repository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRepositoryProps(
encryption_configuration: typing.Any = None,
image_scanning_configuration: typing.Any = None,
image_tag_mutability: str = None,
lifecycle_policy: typing.Union[IResolvable, LifecyclePolicyProperty] = None,
repository_name: str = None,
repository_policy_text: typing.Any = None,
tags: typing.List[CfnTag] = None
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| encryption_configuration
| typing.Any
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| image_scanning_configuration
| typing.Any
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| image_tag_mutability
| str
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| lifecycle_policy
| typing.Union[IResolvable, LifecyclePolicyProperty]
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| repository_name
| str
| \`AWS::ECR::Repository.RepositoryName\`. |
| repository_policy_text
| typing.Any
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| tags
| typing.List[CfnTag]
| \`AWS::ECR::Repository.Tags\`. |
---
##### \`encryption_configuration\`Optional
\`\`\`python
encryption_configuration: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`image_scanning_configuration\`Optional
\`\`\`python
image_scanning_configuration: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`image_tag_mutability\`Optional
\`\`\`python
image_tag_mutability: str
\`\`\`
- *Type:* str
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`lifecycle_policy\`Optional
\`\`\`python
lifecycle_policy: typing.Union[IResolvable, LifecyclePolicyProperty]
\`\`\`
- *Type:* typing.Union[IResolvable, LifecyclePolicyProperty]
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`repository_name\`Optional
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
##### \`repository_policy_text\`Optional
\`\`\`python
repository_policy_text: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`tags\`Optional
\`\`\`python
tags: typing.List[CfnTag]
\`\`\`
- *Type:* typing.List[CfnTag]
\`AWS::ECR::Repository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
---
### LifecyclePolicyProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html)
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRepository.LifecyclePolicyProperty(
lifecycle_policy_text: str = None,
registry_id: str = None
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| lifecycle_policy_text
| str
| \`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`. |
| registry_id
| str
| \`CfnRepository.LifecyclePolicyProperty.RegistryId\`. |
---
##### \`lifecycle_policy_text\`Optional
\`\`\`python
lifecycle_policy_text: str
\`\`\`
- *Type:* str
\`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext)
---
##### \`registry_id\`Optional
\`\`\`python
registry_id: str
\`\`\`
- *Type:* str
\`CfnRepository.LifecyclePolicyProperty.RegistryId\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid)
---
### LifecycleRule
An ECR life cycle rule.
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.LifecycleRule(
description: str = None,
max_image_age: Duration = None,
max_image_count: typing.Union[int, float] = None,
rule_priority: typing.Union[int, float] = None,
tag_prefix_list: typing.List[str] = None,
tag_status: TagStatus = None
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| description
| str
| Describes the purpose of the rule. |
| max_image_age
| Duration
| The maximum age of images to retain. The value must represent a number of days. |
| max_image_count
| typing.Union[int, float]
| The maximum number of images to retain. |
| rule_priority
| typing.Union[int, float]
| Controls the order in which rules are evaluated (low to high). |
| tag_prefix_list
| typing.List[str]
| Select images that have ALL the given prefixes in their tag. |
| tag_status
| TagStatus
| Select images based on tags. |
---
##### \`description\`Optional
\`\`\`python
description: str
\`\`\`
- *Type:* str
- *Default:* No description
Describes the purpose of the rule.
---
##### \`max_image_age\`Optional
\`\`\`python
max_image_age: Duration
\`\`\`
- *Type:* Duration
The maximum age of images to retain. The value must represent a number of days.
Specify exactly one of maxImageCount and maxImageAge.
---
##### \`max_image_count\`Optional
\`\`\`python
max_image_count: typing.Union[int, float]
\`\`\`
- *Type:* typing.Union[int, float]
The maximum number of images to retain.
Specify exactly one of maxImageCount and maxImageAge.
---
##### \`rule_priority\`Optional
\`\`\`python
rule_priority: typing.Union[int, float]
\`\`\`
- *Type:* typing.Union[int, float]
- *Default:* Automatically assigned
Controls the order in which rules are evaluated (low to high).
All rules must have a unique priority, where lower numbers have
higher precedence. The first rule that matches is applied to an image.
There can only be one rule with a tagStatus of Any, and it must have
the highest rulePriority.
All rules without a specified priority will have incrementing priorities
automatically assigned to them, higher than any rules that DO have priorities.
---
##### \`tag_prefix_list\`Optional
\`\`\`python
tag_prefix_list: typing.List[str]
\`\`\`
- *Type:* typing.List[str]
Select images that have ALL the given prefixes in their tag.
Only if tagStatus == TagStatus.Tagged
---
##### \`tag_status\`Optional
\`\`\`python
tag_status: TagStatus
\`\`\`
- *Type:* TagStatus
- *Default:* TagStatus.Tagged if tagPrefixList is given, TagStatus.Any otherwise
Select images based on tags.
Only one rule is allowed to select untagged images, and it must
have the highest rulePriority.
---
### OnCloudTrailImagePushedOptions
Options for the onCloudTrailImagePushed method.
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.OnCloudTrailImagePushedOptions(
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None,
image_tag: str = None
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| description
| str
| A description of the rule's purpose. |
| event_pattern
| EventPattern
| Additional restrictions for the event to route to the specified target. |
| rule_name
| str
| A name for the rule. |
| target
| IRuleTarget
| The target to register for the event. |
| image_tag
| str
| Only watch changes to this image tag. |
---
##### \`description\`Optional
\`\`\`python
description: str
\`\`\`
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
##### \`event_pattern\`Optional
\`\`\`python
event_pattern: EventPattern
\`\`\`
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
##### \`rule_name\`Optional
\`\`\`python
rule_name: str
\`\`\`
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
##### \`target\`Optional
\`\`\`python
target: IRuleTarget
\`\`\`
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`image_tag\`Optional
\`\`\`python
image_tag: str
\`\`\`
- *Type:* str
- *Default:* Watch changes to all tags
Only watch changes to this image tag.
---
### OnImageScanCompletedOptions
Options for the OnImageScanCompleted method.
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.OnImageScanCompletedOptions(
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None,
image_tags: typing.List[str] = None
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| description
| str
| A description of the rule's purpose. |
| event_pattern
| EventPattern
| Additional restrictions for the event to route to the specified target. |
| rule_name
| str
| A name for the rule. |
| target
| IRuleTarget
| The target to register for the event. |
| image_tags
| typing.List[str]
| Only watch changes to the image tags spedified. |
---
##### \`description\`Optional
\`\`\`python
description: str
\`\`\`
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
##### \`event_pattern\`Optional
\`\`\`python
event_pattern: EventPattern
\`\`\`
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
##### \`rule_name\`Optional
\`\`\`python
rule_name: str
\`\`\`
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
##### \`target\`Optional
\`\`\`python
target: IRuleTarget
\`\`\`
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`image_tags\`Optional
\`\`\`python
image_tags: typing.List[str]
\`\`\`
- *Type:* typing.List[str]
- *Default:* Watch the changes to the repository with all image tags
Only watch changes to the image tags spedified.
Leave it undefined to watch the full repository.
---
### ReplicationConfigurationProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html)
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationConfigurationProperty(
rules: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationRuleProperty]]]
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| rules
| typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationRuleProperty]]]
| \`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`. |
---
##### \`rules\`Required
\`\`\`python
rules: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationRuleProperty]]]
\`\`\`
- *Type:* typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationRuleProperty]]]
\`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules)
---
### ReplicationDestinationProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html)
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationDestinationProperty(
region: str,
registry_id: str
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| region
| str
| \`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`. |
| registry_id
| str
| \`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`. |
---
##### \`region\`Required
\`\`\`python
region: str
\`\`\`
- *Type:* str
\`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region)
---
##### \`registry_id\`Required
\`\`\`python
registry_id: str
\`\`\`
- *Type:* str
\`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid)
---
### ReplicationRuleProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html)
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationRuleProperty(
destinations: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationDestinationProperty]]]
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| destinations
| typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationDestinationProperty]]]
| \`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`. |
---
##### \`destinations\`Required
\`\`\`python
destinations: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationDestinationProperty]]]
\`\`\`
- *Type:* typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationDestinationProperty]]]
\`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations)
---
### RepositoryAttributes
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.RepositoryAttributes(
repository_arn: str,
repository_name: str
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| repository_arn
| str
| *No description.* |
| repository_name
| str
| *No description.* |
---
##### \`repository_arn\`Required
\`\`\`python
repository_arn: str
\`\`\`
- *Type:* str
---
##### \`repository_name\`Required
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
---
### RepositoryProps
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.RepositoryProps(
image_scan_on_push: bool = None,
image_tag_mutability: TagMutability = None,
lifecycle_registry_id: str = None,
lifecycle_rules: typing.List[LifecycleRule] = None,
removal_policy: RemovalPolicy = None,
repository_name: str = None
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| image_scan_on_push
| bool
| Enable the scan on push when creating the repository. |
| image_tag_mutability
| TagMutability
| The tag mutability setting for the repository. |
| lifecycle_registry_id
| str
| The AWS account ID associated with the registry that contains the repository. |
| lifecycle_rules
| typing.List[LifecycleRule]
| Life cycle rules to apply to this registry. |
| removal_policy
| RemovalPolicy
| Determine what happens to the repository when the resource/stack is deleted. |
| repository_name
| str
| Name for this repository. |
---
##### \`image_scan_on_push\`Optional
\`\`\`python
image_scan_on_push: bool
\`\`\`
- *Type:* bool
- *Default:* false
Enable the scan on push when creating the repository.
---
##### \`image_tag_mutability\`Optional
\`\`\`python
image_tag_mutability: TagMutability
\`\`\`
- *Type:* TagMutability
- *Default:* TagMutability.MUTABLE
The tag mutability setting for the repository.
If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten.
---
##### \`lifecycle_registry_id\`Optional
\`\`\`python
lifecycle_registry_id: str
\`\`\`
- *Type:* str
- *Default:* The default registry is assumed.
The AWS account ID associated with the registry that contains the repository.
> [https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html](https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html)
---
##### \`lifecycle_rules\`Optional
\`\`\`python
lifecycle_rules: typing.List[LifecycleRule]
\`\`\`
- *Type:* typing.List[LifecycleRule]
- *Default:* No life cycle rules
Life cycle rules to apply to this registry.
---
##### \`removal_policy\`Optional
\`\`\`python
removal_policy: RemovalPolicy
\`\`\`
- *Type:* RemovalPolicy
- *Default:* RemovalPolicy.Retain
Determine what happens to the repository when the resource/stack is deleted.
---
##### \`repository_name\`Optional
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
- *Default:* Automatically generated name.
Name for this repository.
---
## Classes
### AuthorizationToken
Authorization token to access private ECR repositories in the current environment via Docker CLI.
> [https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html](https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html)
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| grant_read
| Grant access to retrieve an authorization token. |
---
##### \`grant_read\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.AuthorizationToken.grant_read(
grantee: IGrantable
)
\`\`\`
Grant access to retrieve an authorization token.
###### \`grantee\`Required
- *Type:* IGrantable
---
### PublicGalleryAuthorizationToken
Authorization token to access the global public ECR Gallery via Docker CLI.
> [https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth)
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| grant_read
| Grant access to retrieve an authorization token. |
---
##### \`grant_read\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.PublicGalleryAuthorizationToken.grant_read(
grantee: IGrantable
)
\`\`\`
Grant access to retrieve an authorization token.
###### \`grantee\`Required
- *Type:* IGrantable
---
## Protocols
### IRepository
- *Extends:* IResource
- *Implemented By:* Repository, RepositoryBase, IRepository
Represents an ECR repository.
#### Methods
| **Name** | **Description** |
| --- | --- |
| add_to_resource_policy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grant_pull
| Grant the given identity permissions to pull images in this repository. |
| grant_pull_push
| Grant the given identity permissions to pull and push images to this repository. |
| on_cloud_trail_event
| Define a CloudWatch event that triggers when something happens to this repository. |
| on_cloud_trail_image_pushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| on_event
| Defines a CloudWatch event rule which triggers for repository events. |
| on_image_scan_completed
| Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed. |
| repository_uri_for_digest
| Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`. |
| repository_uri_for_tag
| Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`. |
---
##### \`add_to_resource_policy\`
\`\`\`python
def add_to_resource_policy(
statement: PolicyStatement
) -> AddToResourcePolicyResult
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`python
def grant(
grantee: IGrantable,
actions: str
) -> Grant
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* str
---
##### \`grant_pull\`
\`\`\`python
def grant_pull(
grantee: IGrantable
) -> Grant
\`\`\`
Grant the given identity permissions to pull images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grant_pull_push\`
\`\`\`python
def grant_pull_push(
grantee: IGrantable
) -> Grant
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`on_cloud_trail_event\`
\`\`\`python
def on_cloud_trail_event(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None
) -> Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`on_cloud_trail_image_pushed\`
\`\`\`python
def on_cloud_trail_image_pushed(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None,
image_tag: str = None
) -> Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
###### \`image_tag\`Optional
- *Type:* str
- *Default:* Watch changes to all tags
Only watch changes to this image tag.
---
##### \`on_event\`
\`\`\`python
def on_event(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None
) -> Rule
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* str
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`on_image_scan_completed\`
\`\`\`python
def on_image_scan_completed(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None,
image_tags: typing.List[str] = None
) -> Rule
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
###### \`image_tags\`Optional
- *Type:* typing.List[str]
- *Default:* Watch the changes to the repository with all image tags
Only watch changes to the image tags spedified.
Leave it undefined to watch the full repository.
---
##### \`repository_uri_for_digest\`
\`\`\`python
def repository_uri_for_digest(
digest: str = None
) -> str
\`\`\`
Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* str
Image digest to use (tools usually default to the image with the "latest" tag if omitted).
---
##### \`repository_uri_for_tag\`
\`\`\`python
def repository_uri_for_tag(
tag: str = None
) -> str
\`\`\`
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]
###### \`tag\`Optional
- *Type:* str
Image tag to use (tools usually default to "latest" if omitted).
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node for this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repository_arn
| str
| The ARN of the repository. |
| repository_name
| str
| The name of the repository. |
| repository_uri
| str
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`python
node: ConstructNode
\`\`\`
- *Type:* ConstructNode
The construct tree node for this construct.
---
##### \`env\`Required
\`\`\`python
env: ResourceEnvironment
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`python
stack: Stack
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repository_arn\`Required
\`\`\`python
repository_arn: str
\`\`\`
- *Type:* str
The ARN of the repository.
---
##### \`repository_name\`Required
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
The name of the repository.
---
##### \`repository_uri\`Required
\`\`\`python
repository_uri: str
\`\`\`
- *Type:* str
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
## Enums
### TagMutability
The tag mutability setting for your repository.
#### Members
| **Name** | **Description** |
| --- | --- |
| MUTABLE
| allow image tags to be overwritten. |
| IMMUTABLE
| all image tags within the repository will be immutable which will prevent them from being overwritten. |
---
##### \`MUTABLE\`
allow image tags to be overwritten.
---
##### \`IMMUTABLE\`
all image tags within the repository will be immutable which will prevent them from being overwritten.
---
### TagStatus
Select images based on tags.
#### Members
| **Name** | **Description** |
| --- | --- |
| ANY
| Rule applies to all images. |
| TAGGED
| Rule applies to tagged images. |
| UNTAGGED
| Rule applies to untagged images. |
---
##### \`ANY\`
Rule applies to all images.
---
##### \`TAGGED\`
Rule applies to tagged images.
---
##### \`UNTAGGED\`
Rule applies to untagged images.
---
"
`;
exports[`complex link formatter typescript snapshot 1`] = `
"# Amazon ECR Construct Library
---


---
This package contains constructs for working with Amazon Elastic Container Registry.
## Repositories
Define a repository by creating a new instance of \`Repository\`. A repository
holds multiple verions of a single container image.
\`\`\`ts
const repository = new ecr.Repository(this, 'Repository');
\`\`\`
## Image scanning
Amazon ECR image scanning helps in identifying software vulnerabilities in your container images. You can manually scan container images stored in Amazon ECR, or you can configure your repositories to scan images when you push them to a repository. To create a new repository to scan on push, simply enable \`imageScanOnPush\` in the properties
\`\`\`ts
const repository = new ecr.Repository(stack, 'Repo', {
imageScanOnPush: true
});
\`\`\`
To create an \`onImageScanCompleted\` event rule and trigger the event target
\`\`\`ts
repository.onImageScanCompleted('ImageScanComplete')
.addTarget(...)
\`\`\`
### Authorization Token
Besides the Amazon ECR APIs, ECR also allows the Docker CLI or a language-specific Docker library to push and pull
images from an ECR repository. However, the Docker CLI does not support native IAM authentication methods and
additional steps must be taken so that Amazon ECR can authenticate and authorize Docker push and pull requests.
More information can be found at at [Registry Authentication](https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html#registry_auth).
A Docker authorization token can be obtained using the \`GetAuthorizationToken\` ECR API. The following code snippets
grants an IAM user access to call this API.
\`\`\`ts
import * as iam from '@aws-cdk/aws-iam';
import * as ecr from '@aws-cdk/aws-ecr';
const user = new iam.User(this, 'User', { ... });
ecr.AuthorizationToken.grantRead(user);
\`\`\`
If you access images in the [Public ECR Gallery](https://gallery.ecr.aws/) as well, it is recommended you authenticate to the registry to benefit from
higher rate and bandwidth limits.
> See \`Pricing\` in https://aws.amazon.com/blogs/aws/amazon-ecr-public-a-new-public-container-registry/ and [Service quotas](https://docs.aws.amazon.com/AmazonECR/latest/public/public-service-quotas.html).
The following code snippet grants an IAM user access to retrieve an authorization token for the public gallery.
\`\`\`ts
import * as iam from '@aws-cdk/aws-iam';
import * as ecr from '@aws-cdk/aws-ecr';
const user = new iam.User(this, 'User', { ... });
ecr.PublicGalleryAuthorizationToken.grantRead(user);
\`\`\`
This user can then proceed to login to the registry using one of the [authentication methods](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth).
### Image tag immutability
You can set tag immutability on images in our repository using the \`imageTagMutability\` construct prop.
\`\`\`ts
new ecr.Repository(stack, 'Repo', { imageTagMutability: ecr.TagMutability.IMMUTABLE });
\`\`\`
## Automatically clean up repositories
You can set life cycle rules to automatically clean up old images from your
repository. The first life cycle rule that matches an image will be applied
against that image. For example, the following deletes images older than
30 days, while keeping all images tagged with prod (note that the order
is important here):
\`\`\`ts
repository.addLifecycleRule({ tagPrefixList: ['prod'], maxImageCount: 9999 });
repository.addLifecycleRule({ maxImageAge: cdk.Duration.days(30) });
\`\`\`
# API Reference
## Constructs
### CfnPublicRepository
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::PublicRepository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
#### Initializers
\`\`\`typescript
import { CfnPublicRepository } from '@aws-cdk/aws-ecr'
new CfnPublicRepository(scope: Construct, id: string, props?: CfnPublicRepositoryProps)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| string
| - scoped id of the resource. |
| props
| CfnPublicRepositoryProps
| - resource properties. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* string
scoped id of the resource.
---
##### \`props\`Optional
- *Type:* CfnPublicRepositoryProps
resource properties.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| overrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| addDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| addDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| addMetadata
| Add a value to the CloudFormation Resource Metadata. |
| addOverride
| Adds an override to the synthesized CloudFormation resource. |
| addPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| addPropertyOverride
| Adds an override to a resource property. |
| applyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| getAtt
| Returns a token for an runtime attribute of this resource. |
| getMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`toString\`
\`\`\`typescript
public toString(): string
\`\`\`
Returns a string representation of this construct.
##### \`overrideLogicalId\`
\`\`\`typescript
public overrideLogicalId(newLogicalId: string): void
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`newLogicalId\`Required
- *Type:* string
The new logical ID to use for this stack element.
---
##### \`addDeletionOverride\`
\`\`\`typescript
public addDeletionOverride(path: string): void
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* string
The path of the value to delete.
---
##### \`addDependsOn\`
\`\`\`typescript
public addDependsOn(target: CfnResource): void
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`addMetadata\`
\`\`\`typescript
public addMetadata(key: string, value: any): void
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* string
---
###### \`value\`Required
- *Type:* any
---
##### \`addOverride\`
\`\`\`typescript
public addOverride(path: string, value: any): void
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* string
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* any
The value.
Could be primitive or complex.
---
##### \`addPropertyDeletionOverride\`
\`\`\`typescript
public addPropertyDeletionOverride(propertyPath: string): void
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`propertyPath\`Required
- *Type:* string
The path to the property.
---
##### \`addPropertyOverride\`
\`\`\`typescript
public addPropertyOverride(propertyPath: string, value: any): void
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`propertyPath\`Required
- *Type:* string
The path of the property.
---
###### \`value\`Required
- *Type:* any
The value.
---
##### \`applyRemovalPolicy\`
\`\`\`typescript
public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`getAtt\`
\`\`\`typescript
public getAtt(attributeName: string): Reference
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attributeName\`Required
- *Type:* string
The name of the attribute.
---
##### \`getMetadata\`
\`\`\`typescript
public getMetadata(key: string): any
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* string
---
##### \`inspect\`
\`\`\`typescript
public inspect(inspector: TreeInspector): void
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| isCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`isConstruct\`
\`\`\`typescript
import { CfnPublicRepository } from '@aws-cdk/aws-ecr'
CfnPublicRepository.isConstruct(x: any)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* any
---
##### \`isCfnElement\`
\`\`\`typescript
import { CfnPublicRepository } from '@aws-cdk/aws-ecr'
CfnPublicRepository.isCfnElement(x: any)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* any
---
##### \`isCfnResource\`
\`\`\`typescript
import { CfnPublicRepository } from '@aws-cdk/aws-ecr'
CfnPublicRepository.isCfnResource(construct: IConstruct)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creationStack
| string[]
| *No description.* |
| logicalId
| string
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| string
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfnResourceType
| string
| AWS resource type. |
| attrArn
| string
| *No description.* |
| tags
| TagManager
| \`AWS::ECR::PublicRepository.Tags\`. |
| repositoryCatalogData
| any
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| repositoryPolicyText
| any
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| repositoryName
| string
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
---
##### \`node\`Required
\`\`\`typescript
public readonly node: ConstructNode;
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creationStack\`Required
\`\`\`typescript
public readonly creationStack: string[];
\`\`\`
- *Type:* string[]
---
##### \`logicalId\`Required
\`\`\`typescript
public readonly logicalId: string;
\`\`\`
- *Type:* string
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`stack\`Required
\`\`\`typescript
public readonly stack: Stack;
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`ref\`Required
\`\`\`typescript
public readonly ref: string;
\`\`\`
- *Type:* string
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`cfnOptions\`Required
\`\`\`typescript
public readonly cfnOptions: ICfnResourceOptions;
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`cfnResourceType\`Required
\`\`\`typescript
public readonly cfnResourceType: string;
\`\`\`
- *Type:* string
AWS resource type.
---
##### \`attrArn\`Required
\`\`\`typescript
public readonly attrArn: string;
\`\`\`
- *Type:* string
---
##### \`tags\`Required
\`\`\`typescript
public readonly tags: TagManager;
\`\`\`
- *Type:* TagManager
\`AWS::ECR::PublicRepository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
---
##### \`repositoryCatalogData\`Required
\`\`\`typescript
public readonly repositoryCatalogData: any;
\`\`\`
- *Type:* any
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`repositoryPolicyText\`Required
\`\`\`typescript
public readonly repositoryPolicyText: any;
\`\`\`
- *Type:* any
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`repositoryName\`Optional
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CFN_RESOURCE_TYPE_NAME
| string
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`typescript
public readonly CFN_RESOURCE_TYPE_NAME: string;
\`\`\`
- *Type:* string
The CloudFormation resource type name for this resource class.
---
### CfnRegistryPolicy
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::RegistryPolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html)
#### Initializers
\`\`\`typescript
import { CfnRegistryPolicy } from '@aws-cdk/aws-ecr'
new CfnRegistryPolicy(scope: Construct, id: string, props: CfnRegistryPolicyProps)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| string
| - scoped id of the resource. |
| props
| CfnRegistryPolicyProps
| - resource properties. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* string
scoped id of the resource.
---
##### \`props\`Required
- *Type:* CfnRegistryPolicyProps
resource properties.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| overrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| addDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| addDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| addMetadata
| Add a value to the CloudFormation Resource Metadata. |
| addOverride
| Adds an override to the synthesized CloudFormation resource. |
| addPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| addPropertyOverride
| Adds an override to a resource property. |
| applyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| getAtt
| Returns a token for an runtime attribute of this resource. |
| getMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`toString\`
\`\`\`typescript
public toString(): string
\`\`\`
Returns a string representation of this construct.
##### \`overrideLogicalId\`
\`\`\`typescript
public overrideLogicalId(newLogicalId: string): void
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`newLogicalId\`Required
- *Type:* string
The new logical ID to use for this stack element.
---
##### \`addDeletionOverride\`
\`\`\`typescript
public addDeletionOverride(path: string): void
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* string
The path of the value to delete.
---
##### \`addDependsOn\`
\`\`\`typescript
public addDependsOn(target: CfnResource): void
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`addMetadata\`
\`\`\`typescript
public addMetadata(key: string, value: any): void
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* string
---
###### \`value\`Required
- *Type:* any
---
##### \`addOverride\`
\`\`\`typescript
public addOverride(path: string, value: any): void
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* string
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* any
The value.
Could be primitive or complex.
---
##### \`addPropertyDeletionOverride\`
\`\`\`typescript
public addPropertyDeletionOverride(propertyPath: string): void
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`propertyPath\`Required
- *Type:* string
The path to the property.
---
##### \`addPropertyOverride\`
\`\`\`typescript
public addPropertyOverride(propertyPath: string, value: any): void
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`propertyPath\`Required
- *Type:* string
The path of the property.
---
###### \`value\`Required
- *Type:* any
The value.
---
##### \`applyRemovalPolicy\`
\`\`\`typescript
public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`getAtt\`
\`\`\`typescript
public getAtt(attributeName: string): Reference
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attributeName\`Required
- *Type:* string
The name of the attribute.
---
##### \`getMetadata\`
\`\`\`typescript
public getMetadata(key: string): any
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* string
---
##### \`inspect\`
\`\`\`typescript
public inspect(inspector: TreeInspector): void
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| isCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`isConstruct\`
\`\`\`typescript
import { CfnRegistryPolicy } from '@aws-cdk/aws-ecr'
CfnRegistryPolicy.isConstruct(x: any)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* any
---
##### \`isCfnElement\`
\`\`\`typescript
import { CfnRegistryPolicy } from '@aws-cdk/aws-ecr'
CfnRegistryPolicy.isCfnElement(x: any)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* any
---
##### \`isCfnResource\`
\`\`\`typescript
import { CfnRegistryPolicy } from '@aws-cdk/aws-ecr'
CfnRegistryPolicy.isCfnResource(construct: IConstruct)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creationStack
| string[]
| *No description.* |
| logicalId
| string
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| string
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfnResourceType
| string
| AWS resource type. |
| attrRegistryId
| string
| *No description.* |
| policyText
| any
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`node\`Required
\`\`\`typescript
public readonly node: ConstructNode;
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creationStack\`Required
\`\`\`typescript
public readonly creationStack: string[];
\`\`\`
- *Type:* string[]
---
##### \`logicalId\`Required
\`\`\`typescript
public readonly logicalId: string;
\`\`\`
- *Type:* string
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`stack\`Required
\`\`\`typescript
public readonly stack: Stack;
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`ref\`Required
\`\`\`typescript
public readonly ref: string;
\`\`\`
- *Type:* string
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`cfnOptions\`Required
\`\`\`typescript
public readonly cfnOptions: ICfnResourceOptions;
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`cfnResourceType\`Required
\`\`\`typescript
public readonly cfnResourceType: string;
\`\`\`
- *Type:* string
AWS resource type.
---
##### \`attrRegistryId\`Required
\`\`\`typescript
public readonly attrRegistryId: string;
\`\`\`
- *Type:* string
---
##### \`policyText\`Required
\`\`\`typescript
public readonly policyText: any;
\`\`\`
- *Type:* any
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CFN_RESOURCE_TYPE_NAME
| string
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`typescript
public readonly CFN_RESOURCE_TYPE_NAME: string;
\`\`\`
- *Type:* string
The CloudFormation resource type name for this resource class.
---
### CfnReplicationConfiguration
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
#### Initializers
\`\`\`typescript
import { CfnReplicationConfiguration } from '@aws-cdk/aws-ecr'
new CfnReplicationConfiguration(scope: Construct, id: string, props: CfnReplicationConfigurationProps)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| string
| - scoped id of the resource. |
| props
| CfnReplicationConfigurationProps
| - resource properties. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* string
scoped id of the resource.
---
##### \`props\`Required
- *Type:* CfnReplicationConfigurationProps
resource properties.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| overrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| addDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| addDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| addMetadata
| Add a value to the CloudFormation Resource Metadata. |
| addOverride
| Adds an override to the synthesized CloudFormation resource. |
| addPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| addPropertyOverride
| Adds an override to a resource property. |
| applyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| getAtt
| Returns a token for an runtime attribute of this resource. |
| getMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`toString\`
\`\`\`typescript
public toString(): string
\`\`\`
Returns a string representation of this construct.
##### \`overrideLogicalId\`
\`\`\`typescript
public overrideLogicalId(newLogicalId: string): void
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`newLogicalId\`Required
- *Type:* string
The new logical ID to use for this stack element.
---
##### \`addDeletionOverride\`
\`\`\`typescript
public addDeletionOverride(path: string): void
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* string
The path of the value to delete.
---
##### \`addDependsOn\`
\`\`\`typescript
public addDependsOn(target: CfnResource): void
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`addMetadata\`
\`\`\`typescript
public addMetadata(key: string, value: any): void
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* string
---
###### \`value\`Required
- *Type:* any
---
##### \`addOverride\`
\`\`\`typescript
public addOverride(path: string, value: any): void
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* string
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* any
The value.
Could be primitive or complex.
---
##### \`addPropertyDeletionOverride\`
\`\`\`typescript
public addPropertyDeletionOverride(propertyPath: string): void
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`propertyPath\`Required
- *Type:* string
The path to the property.
---
##### \`addPropertyOverride\`
\`\`\`typescript
public addPropertyOverride(propertyPath: string, value: any): void
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`propertyPath\`Required
- *Type:* string
The path of the property.
---
###### \`value\`Required
- *Type:* any
The value.
---
##### \`applyRemovalPolicy\`
\`\`\`typescript
public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`getAtt\`
\`\`\`typescript
public getAtt(attributeName: string): Reference
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attributeName\`Required
- *Type:* string
The name of the attribute.
---
##### \`getMetadata\`
\`\`\`typescript
public getMetadata(key: string): any
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* string
---
##### \`inspect\`
\`\`\`typescript
public inspect(inspector: TreeInspector): void
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| isCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`isConstruct\`
\`\`\`typescript
import { CfnReplicationConfiguration } from '@aws-cdk/aws-ecr'
CfnReplicationConfiguration.isConstruct(x: any)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* any
---
##### \`isCfnElement\`
\`\`\`typescript
import { CfnReplicationConfiguration } from '@aws-cdk/aws-ecr'
CfnReplicationConfiguration.isCfnElement(x: any)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* any
---
##### \`isCfnResource\`
\`\`\`typescript
import { CfnReplicationConfiguration } from '@aws-cdk/aws-ecr'
CfnReplicationConfiguration.isCfnResource(construct: IConstruct)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creationStack
| string[]
| *No description.* |
| logicalId
| string
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| string
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfnResourceType
| string
| AWS resource type. |
| attrRegistryId
| string
| *No description.* |
| replicationConfiguration
| IResolvable \\| ReplicationConfigurationProperty
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`node\`Required
\`\`\`typescript
public readonly node: ConstructNode;
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creationStack\`Required
\`\`\`typescript
public readonly creationStack: string[];
\`\`\`
- *Type:* string[]
---
##### \`logicalId\`Required
\`\`\`typescript
public readonly logicalId: string;
\`\`\`
- *Type:* string
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`stack\`Required
\`\`\`typescript
public readonly stack: Stack;
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`ref\`Required
\`\`\`typescript
public readonly ref: string;
\`\`\`
- *Type:* string
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`cfnOptions\`Required
\`\`\`typescript
public readonly cfnOptions: ICfnResourceOptions;
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`cfnResourceType\`Required
\`\`\`typescript
public readonly cfnResourceType: string;
\`\`\`
- *Type:* string
AWS resource type.
---
##### \`attrRegistryId\`Required
\`\`\`typescript
public readonly attrRegistryId: string;
\`\`\`
- *Type:* string
---
##### \`replicationConfiguration\`Required
\`\`\`typescript
public readonly replicationConfiguration: IResolvable | ReplicationConfigurationProperty;
\`\`\`
- *Type:* IResolvable | ReplicationConfigurationProperty
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CFN_RESOURCE_TYPE_NAME
| string
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`typescript
public readonly CFN_RESOURCE_TYPE_NAME: string;
\`\`\`
- *Type:* string
The CloudFormation resource type name for this resource class.
---
### CfnRepository
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::Repository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
#### Initializers
\`\`\`typescript
import { CfnRepository } from '@aws-cdk/aws-ecr'
new CfnRepository(scope: Construct, id: string, props?: CfnRepositoryProps)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| string
| - scoped id of the resource. |
| props
| CfnRepositoryProps
| - resource properties. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* string
scoped id of the resource.
---
##### \`props\`Optional
- *Type:* CfnRepositoryProps
resource properties.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| overrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| addDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| addDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| addMetadata
| Add a value to the CloudFormation Resource Metadata. |
| addOverride
| Adds an override to the synthesized CloudFormation resource. |
| addPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| addPropertyOverride
| Adds an override to a resource property. |
| applyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| getAtt
| Returns a token for an runtime attribute of this resource. |
| getMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`toString\`
\`\`\`typescript
public toString(): string
\`\`\`
Returns a string representation of this construct.
##### \`overrideLogicalId\`
\`\`\`typescript
public overrideLogicalId(newLogicalId: string): void
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`newLogicalId\`Required
- *Type:* string
The new logical ID to use for this stack element.
---
##### \`addDeletionOverride\`
\`\`\`typescript
public addDeletionOverride(path: string): void
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* string
The path of the value to delete.
---
##### \`addDependsOn\`
\`\`\`typescript
public addDependsOn(target: CfnResource): void
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`addMetadata\`
\`\`\`typescript
public addMetadata(key: string, value: any): void
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* string
---
###### \`value\`Required
- *Type:* any
---
##### \`addOverride\`
\`\`\`typescript
public addOverride(path: string, value: any): void
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* string
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* any
The value.
Could be primitive or complex.
---
##### \`addPropertyDeletionOverride\`
\`\`\`typescript
public addPropertyDeletionOverride(propertyPath: string): void
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`propertyPath\`Required
- *Type:* string
The path to the property.
---
##### \`addPropertyOverride\`
\`\`\`typescript
public addPropertyOverride(propertyPath: string, value: any): void
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`propertyPath\`Required
- *Type:* string
The path of the property.
---
###### \`value\`Required
- *Type:* any
The value.
---
##### \`applyRemovalPolicy\`
\`\`\`typescript
public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`getAtt\`
\`\`\`typescript
public getAtt(attributeName: string): Reference
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attributeName\`Required
- *Type:* string
The name of the attribute.
---
##### \`getMetadata\`
\`\`\`typescript
public getMetadata(key: string): any
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* string
---
##### \`inspect\`
\`\`\`typescript
public inspect(inspector: TreeInspector): void
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| isCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`isConstruct\`
\`\`\`typescript
import { CfnRepository } from '@aws-cdk/aws-ecr'
CfnRepository.isConstruct(x: any)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* any
---
##### \`isCfnElement\`
\`\`\`typescript
import { CfnRepository } from '@aws-cdk/aws-ecr'
CfnRepository.isCfnElement(x: any)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* any
---
##### \`isCfnResource\`
\`\`\`typescript
import { CfnRepository } from '@aws-cdk/aws-ecr'
CfnRepository.isCfnResource(construct: IConstruct)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creationStack
| string[]
| *No description.* |
| logicalId
| string
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| string
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfnResourceType
| string
| AWS resource type. |
| attrArn
| string
| *No description.* |
| attrRepositoryUri
| string
| *No description.* |
| tags
| TagManager
| \`AWS::ECR::Repository.Tags\`. |
| encryptionConfiguration
| any
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| imageScanningConfiguration
| any
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| repositoryPolicyText
| any
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| imageTagMutability
| string
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| lifecyclePolicy
| IResolvable \\| LifecyclePolicyProperty
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| repositoryName
| string
| \`AWS::ECR::Repository.RepositoryName\`. |
---
##### \`node\`Required
\`\`\`typescript
public readonly node: ConstructNode;
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creationStack\`Required
\`\`\`typescript
public readonly creationStack: string[];
\`\`\`
- *Type:* string[]
---
##### \`logicalId\`Required
\`\`\`typescript
public readonly logicalId: string;
\`\`\`
- *Type:* string
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`stack\`Required
\`\`\`typescript
public readonly stack: Stack;
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`ref\`Required
\`\`\`typescript
public readonly ref: string;
\`\`\`
- *Type:* string
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`cfnOptions\`Required
\`\`\`typescript
public readonly cfnOptions: ICfnResourceOptions;
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`cfnResourceType\`Required
\`\`\`typescript
public readonly cfnResourceType: string;
\`\`\`
- *Type:* string
AWS resource type.
---
##### \`attrArn\`Required
\`\`\`typescript
public readonly attrArn: string;
\`\`\`
- *Type:* string
---
##### \`attrRepositoryUri\`Required
\`\`\`typescript
public readonly attrRepositoryUri: string;
\`\`\`
- *Type:* string
---
##### \`tags\`Required
\`\`\`typescript
public readonly tags: TagManager;
\`\`\`
- *Type:* TagManager
\`AWS::ECR::Repository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
---
##### \`encryptionConfiguration\`Required
\`\`\`typescript
public readonly encryptionConfiguration: any;
\`\`\`
- *Type:* any
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`imageScanningConfiguration\`Required
\`\`\`typescript
public readonly imageScanningConfiguration: any;
\`\`\`
- *Type:* any
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`repositoryPolicyText\`Required
\`\`\`typescript
public readonly repositoryPolicyText: any;
\`\`\`
- *Type:* any
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`imageTagMutability\`Optional
\`\`\`typescript
public readonly imageTagMutability: string;
\`\`\`
- *Type:* string
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`lifecyclePolicy\`Optional
\`\`\`typescript
public readonly lifecyclePolicy: IResolvable | LifecyclePolicyProperty;
\`\`\`
- *Type:* IResolvable | LifecyclePolicyProperty
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`repositoryName\`Optional
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CFN_RESOURCE_TYPE_NAME
| string
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`typescript
public readonly CFN_RESOURCE_TYPE_NAME: string;
\`\`\`
- *Type:* string
The CloudFormation resource type name for this resource class.
---
### Repository
Define an ECR repository.
#### Initializers
\`\`\`typescript
import { Repository } from '@aws-cdk/aws-ecr'
new Repository(scope: Construct, id: string, props?: RepositoryProps)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| *No description.* |
| id
| string
| *No description.* |
| props
| RepositoryProps
| *No description.* |
---
##### \`scope\`Required
- *Type:* Construct
---
##### \`id\`Required
- *Type:* string
---
##### \`props\`Optional
- *Type:* RepositoryProps
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| applyRemovalPolicy
| Apply the given removal policy to this resource. |
| addToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grantPull
| Grant the given identity permissions to use the images in this repository. |
| grantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| onCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| onCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| onEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| onImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed. |
| repositoryUriForDigest
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| repositoryUriForTag
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| addLifecycleRule
| Add a life cycle rule to the repository. |
---
##### \`toString\`
\`\`\`typescript
public toString(): string
\`\`\`
Returns a string representation of this construct.
##### \`applyRemovalPolicy\`
\`\`\`typescript
public applyRemovalPolicy(policy: RemovalPolicy): void
\`\`\`
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (\`RemovalPolicy.DELETE\`), or left in your AWS
account for data recovery and cleanup later (\`RemovalPolicy.RETAIN\`).
###### \`policy\`Required
- *Type:* RemovalPolicy
---
##### \`addToResourcePolicy\`
\`\`\`typescript
public addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResult
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`typescript
public grant(grantee: IGrantable, actions: string): Grant
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* string
---
##### \`grantPull\`
\`\`\`typescript
public grantPull(grantee: IGrantable): Grant
\`\`\`
Grant the given identity permissions to use the images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grantPullPush\`
\`\`\`typescript
public grantPullPush(grantee: IGrantable): Grant
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`onCloudTrailEvent\`
\`\`\`typescript
public onCloudTrailEvent(id: string, options?: OnEventOptions): Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`onCloudTrailImagePushed\`
\`\`\`typescript
public onCloudTrailImagePushed(id: string, options?: OnCloudTrailImagePushedOptions): Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`onEvent\`
\`\`\`typescript
public onEvent(id: string, options?: OnEventOptions): Rule
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* string
---
###### \`options\`Optional
- *Type:* OnEventOptions
---
##### \`onImageScanCompleted\`
\`\`\`typescript
public onImageScanCompleted(id: string, options?: OnImageScanCompletedOptions): Rule
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`repositoryUriForDigest\`
\`\`\`typescript
public repositoryUriForDigest(digest?: string): string
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* string
Optional image digest.
---
##### \`repositoryUriForTag\`
\`\`\`typescript
public repositoryUriForTag(tag?: string): string
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
###### \`tag\`Optional
- *Type:* string
Optional image tag.
---
##### \`addLifecycleRule\`
\`\`\`typescript
public addLifecycleRule(rule: LifecycleRule): void
\`\`\`
Add a life cycle rule to the repository.
Life cycle rules automatically expire images from the repository that match
certain conditions.
###### \`rule\`Required
- *Type:* LifecycleRule
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isResource
| Check whether the given construct is a Resource. |
| arnForLocalRepository
| Returns an ECR ARN for a repository that resides in the same account/region as the current stack. |
| fromRepositoryArn
| *No description.* |
| fromRepositoryAttributes
| Import a repository. |
| fromRepositoryName
| *No description.* |
---
##### \`isConstruct\`
\`\`\`typescript
import { Repository } from '@aws-cdk/aws-ecr'
Repository.isConstruct(x: any)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* any
---
##### \`isResource\`
\`\`\`typescript
import { Repository } from '@aws-cdk/aws-ecr'
Repository.isResource(construct: IConstruct)
\`\`\`
Check whether the given construct is a Resource.
###### \`construct\`Required
- *Type:* IConstruct
---
##### \`arnForLocalRepository\`
\`\`\`typescript
import { Repository } from '@aws-cdk/aws-ecr'
Repository.arnForLocalRepository(repositoryName: string, scope: IConstruct, account?: string)
\`\`\`
Returns an ECR ARN for a repository that resides in the same account/region as the current stack.
###### \`repositoryName\`Required
- *Type:* string
---
###### \`scope\`Required
- *Type:* IConstruct
---
###### \`account\`Optional
- *Type:* string
---
##### \`fromRepositoryArn\`
\`\`\`typescript
import { Repository } from '@aws-cdk/aws-ecr'
Repository.fromRepositoryArn(scope: Construct, id: string, repositoryArn: string)
\`\`\`
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* string
---
###### \`repositoryArn\`Required
- *Type:* string
---
##### \`fromRepositoryAttributes\`
\`\`\`typescript
import { Repository } from '@aws-cdk/aws-ecr'
Repository.fromRepositoryAttributes(scope: Construct, id: string, attrs: RepositoryAttributes)
\`\`\`
Import a repository.
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* string
---
###### \`attrs\`Required
- *Type:* RepositoryAttributes
---
##### \`fromRepositoryName\`
\`\`\`typescript
import { Repository } from '@aws-cdk/aws-ecr'
Repository.fromRepositoryName(scope: Construct, id: string, repositoryName: string)
\`\`\`
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* string
---
###### \`repositoryName\`Required
- *Type:* string
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repositoryArn
| string
| The ARN of the repository. |
| repositoryName
| string
| The name of the repository. |
| repositoryUri
| string
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`typescript
public readonly node: ConstructNode;
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`env\`Required
\`\`\`typescript
public readonly env: ResourceEnvironment;
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`typescript
public readonly stack: Stack;
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repositoryArn\`Required
\`\`\`typescript
public readonly repositoryArn: string;
\`\`\`
- *Type:* string
The ARN of the repository.
---
##### \`repositoryName\`Required
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
The name of the repository.
---
##### \`repositoryUri\`Required
\`\`\`typescript
public readonly repositoryUri: string;
\`\`\`
- *Type:* string
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
### RepositoryBase
- *Implements:* IRepository
Base class for ECR repository.
Reused between imported repositories and owned repositories.
#### Initializers
\`\`\`typescript
import { RepositoryBase } from '@aws-cdk/aws-ecr'
new RepositoryBase(scope: Construct, id: string, props?: ResourceProps)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| *No description.* |
| id
| string
| *No description.* |
| props
| ResourceProps
| *No description.* |
---
##### \`scope\`Required
- *Type:* Construct
---
##### \`id\`Required
- *Type:* string
---
##### \`props\`Optional
- *Type:* ResourceProps
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| applyRemovalPolicy
| Apply the given removal policy to this resource. |
| addToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grantPull
| Grant the given identity permissions to use the images in this repository. |
| grantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| onCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| onCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| onEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| onImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed. |
| repositoryUriForDigest
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| repositoryUriForTag
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
---
##### \`toString\`
\`\`\`typescript
public toString(): string
\`\`\`
Returns a string representation of this construct.
##### \`applyRemovalPolicy\`
\`\`\`typescript
public applyRemovalPolicy(policy: RemovalPolicy): void
\`\`\`
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (\`RemovalPolicy.DELETE\`), or left in your AWS
account for data recovery and cleanup later (\`RemovalPolicy.RETAIN\`).
###### \`policy\`Required
- *Type:* RemovalPolicy
---
##### \`addToResourcePolicy\`
\`\`\`typescript
public addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResult
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`typescript
public grant(grantee: IGrantable, actions: string): Grant
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* string
---
##### \`grantPull\`
\`\`\`typescript
public grantPull(grantee: IGrantable): Grant
\`\`\`
Grant the given identity permissions to use the images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grantPullPush\`
\`\`\`typescript
public grantPullPush(grantee: IGrantable): Grant
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`onCloudTrailEvent\`
\`\`\`typescript
public onCloudTrailEvent(id: string, options?: OnEventOptions): Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`onCloudTrailImagePushed\`
\`\`\`typescript
public onCloudTrailImagePushed(id: string, options?: OnCloudTrailImagePushedOptions): Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`onEvent\`
\`\`\`typescript
public onEvent(id: string, options?: OnEventOptions): Rule
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* string
---
###### \`options\`Optional
- *Type:* OnEventOptions
---
##### \`onImageScanCompleted\`
\`\`\`typescript
public onImageScanCompleted(id: string, options?: OnImageScanCompletedOptions): Rule
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`repositoryUriForDigest\`
\`\`\`typescript
public repositoryUriForDigest(digest?: string): string
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* string
Optional image digest.
---
##### \`repositoryUriForTag\`
\`\`\`typescript
public repositoryUriForTag(tag?: string): string
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
###### \`tag\`Optional
- *Type:* string
Optional image tag.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isResource
| Check whether the given construct is a Resource. |
---
##### \`isConstruct\`
\`\`\`typescript
import { RepositoryBase } from '@aws-cdk/aws-ecr'
RepositoryBase.isConstruct(x: any)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* any
---
##### \`isResource\`
\`\`\`typescript
import { RepositoryBase } from '@aws-cdk/aws-ecr'
RepositoryBase.isResource(construct: IConstruct)
\`\`\`
Check whether the given construct is a Resource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repositoryArn
| string
| The ARN of the repository. |
| repositoryName
| string
| The name of the repository. |
| repositoryUri
| string
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`typescript
public readonly node: ConstructNode;
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`env\`Required
\`\`\`typescript
public readonly env: ResourceEnvironment;
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`typescript
public readonly stack: Stack;
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repositoryArn\`Required
\`\`\`typescript
public readonly repositoryArn: string;
\`\`\`
- *Type:* string
The ARN of the repository.
---
##### \`repositoryName\`Required
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
The name of the repository.
---
##### \`repositoryUri\`Required
\`\`\`typescript
public readonly repositoryUri: string;
\`\`\`
- *Type:* string
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
## Structs
### CfnPublicRepositoryProps
Properties for defining a \`AWS::ECR::PublicRepository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
#### Initializer
\`\`\`typescript
import { CfnPublicRepositoryProps } from '@aws-cdk/aws-ecr'
const cfnPublicRepositoryProps: CfnPublicRepositoryProps = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| repositoryCatalogData
| any
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| repositoryName
| string
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
| repositoryPolicyText
| any
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| tags
| CfnTag[]
| \`AWS::ECR::PublicRepository.Tags\`. |
---
##### \`repositoryCatalogData\`Optional
\`\`\`typescript
public readonly repositoryCatalogData: any;
\`\`\`
- *Type:* any
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`repositoryName\`Optional
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
##### \`repositoryPolicyText\`Optional
\`\`\`typescript
public readonly repositoryPolicyText: any;
\`\`\`
- *Type:* any
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`tags\`Optional
\`\`\`typescript
public readonly tags: CfnTag[];
\`\`\`
- *Type:* CfnTag[]
\`AWS::ECR::PublicRepository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
---
### CfnRegistryPolicyProps
Properties for defining a \`AWS::ECR::RegistryPolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html)
#### Initializer
\`\`\`typescript
import { CfnRegistryPolicyProps } from '@aws-cdk/aws-ecr'
const cfnRegistryPolicyProps: CfnRegistryPolicyProps = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| policyText
| any
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`policyText\`Required
\`\`\`typescript
public readonly policyText: any;
\`\`\`
- *Type:* any
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
### CfnReplicationConfigurationProps
Properties for defining a \`AWS::ECR::ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
#### Initializer
\`\`\`typescript
import { CfnReplicationConfigurationProps } from '@aws-cdk/aws-ecr'
const cfnReplicationConfigurationProps: CfnReplicationConfigurationProps = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| replicationConfiguration
| IResolvable \\| ReplicationConfigurationProperty
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`replicationConfiguration\`Required
\`\`\`typescript
public readonly replicationConfiguration: IResolvable | ReplicationConfigurationProperty;
\`\`\`
- *Type:* IResolvable | ReplicationConfigurationProperty
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
### CfnRepositoryProps
Properties for defining a \`AWS::ECR::Repository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
#### Initializer
\`\`\`typescript
import { CfnRepositoryProps } from '@aws-cdk/aws-ecr'
const cfnRepositoryProps: CfnRepositoryProps = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| encryptionConfiguration
| any
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| imageScanningConfiguration
| any
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| imageTagMutability
| string
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| lifecyclePolicy
| IResolvable \\| LifecyclePolicyProperty
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| repositoryName
| string
| \`AWS::ECR::Repository.RepositoryName\`. |
| repositoryPolicyText
| any
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| tags
| CfnTag[]
| \`AWS::ECR::Repository.Tags\`. |
---
##### \`encryptionConfiguration\`Optional
\`\`\`typescript
public readonly encryptionConfiguration: any;
\`\`\`
- *Type:* any
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`imageScanningConfiguration\`Optional
\`\`\`typescript
public readonly imageScanningConfiguration: any;
\`\`\`
- *Type:* any
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`imageTagMutability\`Optional
\`\`\`typescript
public readonly imageTagMutability: string;
\`\`\`
- *Type:* string
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`lifecyclePolicy\`Optional
\`\`\`typescript
public readonly lifecyclePolicy: IResolvable | LifecyclePolicyProperty;
\`\`\`
- *Type:* IResolvable | LifecyclePolicyProperty
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`repositoryName\`Optional
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
##### \`repositoryPolicyText\`Optional
\`\`\`typescript
public readonly repositoryPolicyText: any;
\`\`\`
- *Type:* any
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`tags\`Optional
\`\`\`typescript
public readonly tags: CfnTag[];
\`\`\`
- *Type:* CfnTag[]
\`AWS::ECR::Repository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
---
### LifecyclePolicyProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html)
#### Initializer
\`\`\`typescript
import { LifecyclePolicyProperty } from '@aws-cdk/aws-ecr'
const lifecyclePolicyProperty: LifecyclePolicyProperty = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| lifecyclePolicyText
| string
| \`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`. |
| registryId
| string
| \`CfnRepository.LifecyclePolicyProperty.RegistryId\`. |
---
##### \`lifecyclePolicyText\`Optional
\`\`\`typescript
public readonly lifecyclePolicyText: string;
\`\`\`
- *Type:* string
\`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext)
---
##### \`registryId\`Optional
\`\`\`typescript
public readonly registryId: string;
\`\`\`
- *Type:* string
\`CfnRepository.LifecyclePolicyProperty.RegistryId\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid)
---
### LifecycleRule
An ECR life cycle rule.
#### Initializer
\`\`\`typescript
import { LifecycleRule } from '@aws-cdk/aws-ecr'
const lifecycleRule: LifecycleRule = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| description
| string
| Describes the purpose of the rule. |
| maxImageAge
| Duration
| The maximum age of images to retain. The value must represent a number of days. |
| maxImageCount
| number
| The maximum number of images to retain. |
| rulePriority
| number
| Controls the order in which rules are evaluated (low to high). |
| tagPrefixList
| string[]
| Select images that have ALL the given prefixes in their tag. |
| tagStatus
| TagStatus
| Select images based on tags. |
---
##### \`description\`Optional
\`\`\`typescript
public readonly description: string;
\`\`\`
- *Type:* string
- *Default:* No description
Describes the purpose of the rule.
---
##### \`maxImageAge\`Optional
\`\`\`typescript
public readonly maxImageAge: Duration;
\`\`\`
- *Type:* Duration
The maximum age of images to retain. The value must represent a number of days.
Specify exactly one of maxImageCount and maxImageAge.
---
##### \`maxImageCount\`Optional
\`\`\`typescript
public readonly maxImageCount: number;
\`\`\`
- *Type:* number
The maximum number of images to retain.
Specify exactly one of maxImageCount and maxImageAge.
---
##### \`rulePriority\`Optional
\`\`\`typescript
public readonly rulePriority: number;
\`\`\`
- *Type:* number
- *Default:* Automatically assigned
Controls the order in which rules are evaluated (low to high).
All rules must have a unique priority, where lower numbers have
higher precedence. The first rule that matches is applied to an image.
There can only be one rule with a tagStatus of Any, and it must have
the highest rulePriority.
All rules without a specified priority will have incrementing priorities
automatically assigned to them, higher than any rules that DO have priorities.
---
##### \`tagPrefixList\`Optional
\`\`\`typescript
public readonly tagPrefixList: string[];
\`\`\`
- *Type:* string[]
Select images that have ALL the given prefixes in their tag.
Only if tagStatus == TagStatus.Tagged
---
##### \`tagStatus\`Optional
\`\`\`typescript
public readonly tagStatus: TagStatus;
\`\`\`
- *Type:* TagStatus
- *Default:* TagStatus.Tagged if tagPrefixList is given, TagStatus.Any otherwise
Select images based on tags.
Only one rule is allowed to select untagged images, and it must
have the highest rulePriority.
---
### OnCloudTrailImagePushedOptions
Options for the onCloudTrailImagePushed method.
#### Initializer
\`\`\`typescript
import { OnCloudTrailImagePushedOptions } from '@aws-cdk/aws-ecr'
const onCloudTrailImagePushedOptions: OnCloudTrailImagePushedOptions = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| description
| string
| A description of the rule's purpose. |
| eventPattern
| EventPattern
| Additional restrictions for the event to route to the specified target. |
| ruleName
| string
| A name for the rule. |
| target
| IRuleTarget
| The target to register for the event. |
| imageTag
| string
| Only watch changes to this image tag. |
---
##### \`description\`Optional
\`\`\`typescript
public readonly description: string;
\`\`\`
- *Type:* string
- *Default:* No description
A description of the rule's purpose.
---
##### \`eventPattern\`Optional
\`\`\`typescript
public readonly eventPattern: EventPattern;
\`\`\`
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
##### \`ruleName\`Optional
\`\`\`typescript
public readonly ruleName: string;
\`\`\`
- *Type:* string
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
##### \`target\`Optional
\`\`\`typescript
public readonly target: IRuleTarget;
\`\`\`
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`imageTag\`Optional
\`\`\`typescript
public readonly imageTag: string;
\`\`\`
- *Type:* string
- *Default:* Watch changes to all tags
Only watch changes to this image tag.
---
### OnImageScanCompletedOptions
Options for the OnImageScanCompleted method.
#### Initializer
\`\`\`typescript
import { OnImageScanCompletedOptions } from '@aws-cdk/aws-ecr'
const onImageScanCompletedOptions: OnImageScanCompletedOptions = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| description
| string
| A description of the rule's purpose. |
| eventPattern
| EventPattern
| Additional restrictions for the event to route to the specified target. |
| ruleName
| string
| A name for the rule. |
| target
| IRuleTarget
| The target to register for the event. |
| imageTags
| string[]
| Only watch changes to the image tags spedified. |
---
##### \`description\`Optional
\`\`\`typescript
public readonly description: string;
\`\`\`
- *Type:* string
- *Default:* No description
A description of the rule's purpose.
---
##### \`eventPattern\`Optional
\`\`\`typescript
public readonly eventPattern: EventPattern;
\`\`\`
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
##### \`ruleName\`Optional
\`\`\`typescript
public readonly ruleName: string;
\`\`\`
- *Type:* string
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
##### \`target\`Optional
\`\`\`typescript
public readonly target: IRuleTarget;
\`\`\`
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`imageTags\`Optional
\`\`\`typescript
public readonly imageTags: string[];
\`\`\`
- *Type:* string[]
- *Default:* Watch the changes to the repository with all image tags
Only watch changes to the image tags spedified.
Leave it undefined to watch the full repository.
---
### ReplicationConfigurationProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html)
#### Initializer
\`\`\`typescript
import { ReplicationConfigurationProperty } from '@aws-cdk/aws-ecr'
const replicationConfigurationProperty: ReplicationConfigurationProperty = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| rules
| IResolvable \\| IResolvable \\| ReplicationRuleProperty[]
| \`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`. |
---
##### \`rules\`Required
\`\`\`typescript
public readonly rules: IResolvable | IResolvable | ReplicationRuleProperty[];
\`\`\`
- *Type:* IResolvable | IResolvable | ReplicationRuleProperty[]
\`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules)
---
### ReplicationDestinationProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html)
#### Initializer
\`\`\`typescript
import { ReplicationDestinationProperty } from '@aws-cdk/aws-ecr'
const replicationDestinationProperty: ReplicationDestinationProperty = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| region
| string
| \`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`. |
| registryId
| string
| \`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`. |
---
##### \`region\`Required
\`\`\`typescript
public readonly region: string;
\`\`\`
- *Type:* string
\`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region)
---
##### \`registryId\`Required
\`\`\`typescript
public readonly registryId: string;
\`\`\`
- *Type:* string
\`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid)
---
### ReplicationRuleProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html)
#### Initializer
\`\`\`typescript
import { ReplicationRuleProperty } from '@aws-cdk/aws-ecr'
const replicationRuleProperty: ReplicationRuleProperty = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| destinations
| IResolvable \\| IResolvable \\| ReplicationDestinationProperty[]
| \`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`. |
---
##### \`destinations\`Required
\`\`\`typescript
public readonly destinations: IResolvable | IResolvable | ReplicationDestinationProperty[];
\`\`\`
- *Type:* IResolvable | IResolvable | ReplicationDestinationProperty[]
\`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations)
---
### RepositoryAttributes
#### Initializer
\`\`\`typescript
import { RepositoryAttributes } from '@aws-cdk/aws-ecr'
const repositoryAttributes: RepositoryAttributes = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| repositoryArn
| string
| *No description.* |
| repositoryName
| string
| *No description.* |
---
##### \`repositoryArn\`Required
\`\`\`typescript
public readonly repositoryArn: string;
\`\`\`
- *Type:* string
---
##### \`repositoryName\`Required
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
---
### RepositoryProps
#### Initializer
\`\`\`typescript
import { RepositoryProps } from '@aws-cdk/aws-ecr'
const repositoryProps: RepositoryProps = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| imageScanOnPush
| boolean
| Enable the scan on push when creating the repository. |
| imageTagMutability
| TagMutability
| The tag mutability setting for the repository. |
| lifecycleRegistryId
| string
| The AWS account ID associated with the registry that contains the repository. |
| lifecycleRules
| LifecycleRule[]
| Life cycle rules to apply to this registry. |
| removalPolicy
| RemovalPolicy
| Determine what happens to the repository when the resource/stack is deleted. |
| repositoryName
| string
| Name for this repository. |
---
##### \`imageScanOnPush\`Optional
\`\`\`typescript
public readonly imageScanOnPush: boolean;
\`\`\`
- *Type:* boolean
- *Default:* false
Enable the scan on push when creating the repository.
---
##### \`imageTagMutability\`Optional
\`\`\`typescript
public readonly imageTagMutability: TagMutability;
\`\`\`
- *Type:* TagMutability
- *Default:* TagMutability.MUTABLE
The tag mutability setting for the repository.
If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten.
---
##### \`lifecycleRegistryId\`Optional
\`\`\`typescript
public readonly lifecycleRegistryId: string;
\`\`\`
- *Type:* string
- *Default:* The default registry is assumed.
The AWS account ID associated with the registry that contains the repository.
> [https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html](https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html)
---
##### \`lifecycleRules\`Optional
\`\`\`typescript
public readonly lifecycleRules: LifecycleRule[];
\`\`\`
- *Type:* LifecycleRule[]
- *Default:* No life cycle rules
Life cycle rules to apply to this registry.
---
##### \`removalPolicy\`Optional
\`\`\`typescript
public readonly removalPolicy: RemovalPolicy;
\`\`\`
- *Type:* RemovalPolicy
- *Default:* RemovalPolicy.Retain
Determine what happens to the repository when the resource/stack is deleted.
---
##### \`repositoryName\`Optional
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
- *Default:* Automatically generated name.
Name for this repository.
---
## Classes
### AuthorizationToken
Authorization token to access private ECR repositories in the current environment via Docker CLI.
> [https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html](https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html)
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| grantRead
| Grant access to retrieve an authorization token. |
---
##### \`grantRead\`
\`\`\`typescript
import { AuthorizationToken } from '@aws-cdk/aws-ecr'
AuthorizationToken.grantRead(grantee: IGrantable)
\`\`\`
Grant access to retrieve an authorization token.
###### \`grantee\`Required
- *Type:* IGrantable
---
### PublicGalleryAuthorizationToken
Authorization token to access the global public ECR Gallery via Docker CLI.
> [https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth)
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| grantRead
| Grant access to retrieve an authorization token. |
---
##### \`grantRead\`
\`\`\`typescript
import { PublicGalleryAuthorizationToken } from '@aws-cdk/aws-ecr'
PublicGalleryAuthorizationToken.grantRead(grantee: IGrantable)
\`\`\`
Grant access to retrieve an authorization token.
###### \`grantee\`Required
- *Type:* IGrantable
---
## Protocols
### IRepository
- *Extends:* IResource
- *Implemented By:* Repository, RepositoryBase, IRepository
Represents an ECR repository.
#### Methods
| **Name** | **Description** |
| --- | --- |
| addToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grantPull
| Grant the given identity permissions to pull images in this repository. |
| grantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| onCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| onCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| onEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| onImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed. |
| repositoryUriForDigest
| Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`. |
| repositoryUriForTag
| Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`. |
---
##### \`addToResourcePolicy\`
\`\`\`typescript
public addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResult
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`typescript
public grant(grantee: IGrantable, actions: string): Grant
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* string
---
##### \`grantPull\`
\`\`\`typescript
public grantPull(grantee: IGrantable): Grant
\`\`\`
Grant the given identity permissions to pull images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grantPullPush\`
\`\`\`typescript
public grantPullPush(grantee: IGrantable): Grant
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`onCloudTrailEvent\`
\`\`\`typescript
public onCloudTrailEvent(id: string, options?: OnEventOptions): Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`onCloudTrailImagePushed\`
\`\`\`typescript
public onCloudTrailImagePushed(id: string, options?: OnCloudTrailImagePushedOptions): Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`onEvent\`
\`\`\`typescript
public onEvent(id: string, options?: OnEventOptions): Rule
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* string
---
###### \`options\`Optional
- *Type:* OnEventOptions
---
##### \`onImageScanCompleted\`
\`\`\`typescript
public onImageScanCompleted(id: string, options?: OnImageScanCompletedOptions): Rule
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`repositoryUriForDigest\`
\`\`\`typescript
public repositoryUriForDigest(digest?: string): string
\`\`\`
Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* string
Image digest to use (tools usually default to the image with the "latest" tag if omitted).
---
##### \`repositoryUriForTag\`
\`\`\`typescript
public repositoryUriForTag(tag?: string): string
\`\`\`
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]
###### \`tag\`Optional
- *Type:* string
Image tag to use (tools usually default to "latest" if omitted).
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node for this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repositoryArn
| string
| The ARN of the repository. |
| repositoryName
| string
| The name of the repository. |
| repositoryUri
| string
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`typescript
public readonly node: ConstructNode;
\`\`\`
- *Type:* ConstructNode
The construct tree node for this construct.
---
##### \`env\`Required
\`\`\`typescript
public readonly env: ResourceEnvironment;
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`typescript
public readonly stack: Stack;
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repositoryArn\`Required
\`\`\`typescript
public readonly repositoryArn: string;
\`\`\`
- *Type:* string
The ARN of the repository.
---
##### \`repositoryName\`Required
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
The name of the repository.
---
##### \`repositoryUri\`Required
\`\`\`typescript
public readonly repositoryUri: string;
\`\`\`
- *Type:* string
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
## Enums
### TagMutability
The tag mutability setting for your repository.
#### Members
| **Name** | **Description** |
| --- | --- |
| MUTABLE
| allow image tags to be overwritten. |
| IMMUTABLE
| all image tags within the repository will be immutable which will prevent them from being overwritten. |
---
##### \`MUTABLE\`
allow image tags to be overwritten.
---
##### \`IMMUTABLE\`
all image tags within the repository will be immutable which will prevent them from being overwritten.
---
### TagStatus
Select images based on tags.
#### Members
| **Name** | **Description** |
| --- | --- |
| ANY
| Rule applies to all images. |
| TAGGED
| Rule applies to tagged images. |
| UNTAGGED
| Rule applies to untagged images. |
---
##### \`ANY\`
Rule applies to all images.
---
##### \`TAGGED\`
Rule applies to tagged images.
---
##### \`UNTAGGED\`
Rule applies to untagged images.
---
"
`;
exports[`simple link formatter csharp snapshot 1`] = `
"# Amazon ECR Construct Library
---


---
This package contains constructs for working with Amazon Elastic Container Registry.
## Repositories
Define a repository by creating a new instance of \`Repository\`. A repository
holds multiple verions of a single container image.
\`\`\`csharp
// Example automatically generated from non-compiling source. May contain errors.
var repository = new ecr.Repository(this, "Repository");
\`\`\`
## Image scanning
Amazon ECR image scanning helps in identifying software vulnerabilities in your container images. You can manually scan container images stored in Amazon ECR, or you can configure your repositories to scan images when you push them to a repository. To create a new repository to scan on push, simply enable \`imageScanOnPush\` in the properties
\`\`\`csharp
// Example automatically generated from non-compiling source. May contain errors.
var repository = new ecr.Repository(stack, "Repo", new Struct {
ImageScanOnPush = true
});
\`\`\`
To create an \`onImageScanCompleted\` event rule and trigger the event target
\`\`\`csharp
// Example automatically generated from non-compiling source. May contain errors.
repository.OnImageScanCompleted("ImageScanComplete").AddTarget(...);
\`\`\`
### Authorization Token
Besides the Amazon ECR APIs, ECR also allows the Docker CLI or a language-specific Docker library to push and pull
images from an ECR repository. However, the Docker CLI does not support native IAM authentication methods and
additional steps must be taken so that Amazon ECR can authenticate and authorize Docker push and pull requests.
More information can be found at at [Registry Authentication](https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html#registry_auth).
A Docker authorization token can be obtained using the \`GetAuthorizationToken\` ECR API. The following code snippets
grants an IAM user access to call this API.
\`\`\`csharp
// Example automatically generated from non-compiling source. May contain errors.
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.ECR;
var user = new User(this, "User", new UserProps { ... });
AuthorizationToken.GrantRead(user);
\`\`\`
If you access images in the [Public ECR Gallery](https://gallery.ecr.aws/) as well, it is recommended you authenticate to the registry to benefit from
higher rate and bandwidth limits.
> See \`Pricing\` in https://aws.amazon.com/blogs/aws/amazon-ecr-public-a-new-public-container-registry/ and [Service quotas](https://docs.aws.amazon.com/AmazonECR/latest/public/public-service-quotas.html).
The following code snippet grants an IAM user access to retrieve an authorization token for the public gallery.
\`\`\`csharp
// Example automatically generated from non-compiling source. May contain errors.
using Amazon.CDK.AWS.IAM;
using Amazon.CDK.AWS.ECR;
var user = new User(this, "User", new UserProps { ... });
PublicGalleryAuthorizationToken.GrantRead(user);
\`\`\`
This user can then proceed to login to the registry using one of the [authentication methods](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth).
### Image tag immutability
You can set tag immutability on images in our repository using the \`imageTagMutability\` construct prop.
\`\`\`csharp
// Example automatically generated from non-compiling source. May contain errors.
new ecr.Repository(stack, "Repo", new Struct { ImageTagMutability = ecr.TagMutability.IMMUTABLE });
\`\`\`
## Automatically clean up repositories
You can set life cycle rules to automatically clean up old images from your
repository. The first life cycle rule that matches an image will be applied
against that image. For example, the following deletes images older than
30 days, while keeping all images tagged with prod (note that the order
is important here):
\`\`\`csharp
// Example automatically generated from non-compiling source. May contain errors.
repository.AddLifecycleRule(new Struct { TagPrefixList = new [] { "prod" }, MaxImageCount = 9999 });
repository.AddLifecycleRule(new Struct { MaxImageAge = cdk.Duration.Days(30) });
\`\`\`
# API Reference
## Constructs
### CfnPublicRepository
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::PublicRepository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
#### Initializers
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new CfnPublicRepository(Construct Scope, string Id, CfnPublicRepositoryProps Props = null);
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Scope
| Construct
| - scope in which this resource is defined. |
| Id
| string
| - scoped id of the resource. |
| Props
| CfnPublicRepositoryProps
| - resource properties. |
---
##### \`Scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`Id\`Required
- *Type:* string
scoped id of the resource.
---
##### \`Props\`Optional
- *Type:* CfnPublicRepositoryProps
resource properties.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| ToString
| Returns a string representation of this construct. |
| OverrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| AddDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| AddDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| AddMetadata
| Add a value to the CloudFormation Resource Metadata. |
| AddOverride
| Adds an override to the synthesized CloudFormation resource. |
| AddPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| AddPropertyOverride
| Adds an override to a resource property. |
| ApplyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| GetAtt
| Returns a token for an runtime attribute of this resource. |
| GetMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| Inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`ToString\`
\`\`\`csharp
private string ToString()
\`\`\`
Returns a string representation of this construct.
##### \`OverrideLogicalId\`
\`\`\`csharp
private void OverrideLogicalId(string NewLogicalId)
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`NewLogicalId\`Required
- *Type:* string
The new logical ID to use for this stack element.
---
##### \`AddDeletionOverride\`
\`\`\`csharp
private void AddDeletionOverride(string Path)
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`Path\`Required
- *Type:* string
The path of the value to delete.
---
##### \`AddDependsOn\`
\`\`\`csharp
private void AddDependsOn(CfnResource Target)
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`Target\`Required
- *Type:* CfnResource
---
##### \`AddMetadata\`
\`\`\`csharp
private void AddMetadata(string Key, object Value)
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`Key\`Required
- *Type:* string
---
###### \`Value\`Required
- *Type:* object
---
##### \`AddOverride\`
\`\`\`csharp
private void AddOverride(string Path, object Value)
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`Path\`Required
- *Type:* string
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`Value\`Required
- *Type:* object
The value.
Could be primitive or complex.
---
##### \`AddPropertyDeletionOverride\`
\`\`\`csharp
private void AddPropertyDeletionOverride(string PropertyPath)
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`PropertyPath\`Required
- *Type:* string
The path to the property.
---
##### \`AddPropertyOverride\`
\`\`\`csharp
private void AddPropertyOverride(string PropertyPath, object Value)
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`PropertyPath\`Required
- *Type:* string
The path of the property.
---
###### \`Value\`Required
- *Type:* object
The value.
---
##### \`ApplyRemovalPolicy\`
\`\`\`csharp
private void ApplyRemovalPolicy(RemovalPolicy Policy = null, RemovalPolicyOptions Options = null)
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`Policy\`Optional
- *Type:* RemovalPolicy
---
###### \`Options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`GetAtt\`
\`\`\`csharp
private Reference GetAtt(string AttributeName)
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`AttributeName\`Required
- *Type:* string
The name of the attribute.
---
##### \`GetMetadata\`
\`\`\`csharp
private object GetMetadata(string Key)
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`Key\`Required
- *Type:* string
---
##### \`Inspect\`
\`\`\`csharp
private void Inspect(TreeInspector Inspector)
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`Inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| IsConstruct
| Return whether the given object is a Construct. |
| IsCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| IsCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`IsConstruct\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnPublicRepository.IsConstruct(object X);
\`\`\`
Return whether the given object is a Construct.
###### \`X\`Required
- *Type:* object
---
##### \`IsCfnElement\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnPublicRepository.IsCfnElement(object X);
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`X\`Required
- *Type:* object
---
##### \`IsCfnResource\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnPublicRepository.IsCfnResource(IConstruct Construct);
\`\`\`
Check whether the given construct is a CfnResource.
###### \`Construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| ConstructNode
| The construct tree node associated with this construct. |
| CreationStack
| string[]
| *No description.* |
| LogicalId
| string
| The logical ID for this CloudFormation stack element. |
| Stack
| Stack
| The stack in which this element is defined. |
| Ref
| string
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| CfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| CfnResourceType
| string
| AWS resource type. |
| AttrArn
| string
| *No description.* |
| Tags
| TagManager
| \`AWS::ECR::PublicRepository.Tags\`. |
| RepositoryCatalogData
| object
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| RepositoryPolicyText
| object
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| RepositoryName
| string
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
---
##### \`Node\`Required
\`\`\`csharp
public ConstructNode Node { get; }
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`CreationStack\`Required
\`\`\`csharp
public string[] CreationStack { get; }
\`\`\`
- *Type:* string[]
---
##### \`LogicalId\`Required
\`\`\`csharp
public string LogicalId { get; }
\`\`\`
- *Type:* string
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`Stack\`Required
\`\`\`csharp
public Stack Stack { get; }
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`Ref\`Required
\`\`\`csharp
public string Ref { get; }
\`\`\`
- *Type:* string
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`CfnOptions\`Required
\`\`\`csharp
public ICfnResourceOptions CfnOptions { get; }
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`CfnResourceType\`Required
\`\`\`csharp
public string CfnResourceType { get; }
\`\`\`
- *Type:* string
AWS resource type.
---
##### \`AttrArn\`Required
\`\`\`csharp
public string AttrArn { get; }
\`\`\`
- *Type:* string
---
##### \`Tags\`Required
\`\`\`csharp
public TagManager Tags { get; }
\`\`\`
- *Type:* TagManager
\`AWS::ECR::PublicRepository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
---
##### \`RepositoryCatalogData\`Required
\`\`\`csharp
public object RepositoryCatalogData { get; }
\`\`\`
- *Type:* object
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`RepositoryPolicyText\`Required
\`\`\`csharp
public object RepositoryPolicyText { get; }
\`\`\`
- *Type:* object
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`RepositoryName\`Optional
\`\`\`csharp
public string RepositoryName { get; }
\`\`\`
- *Type:* string
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CfnResourceTypeName
| string
| The CloudFormation resource type name for this resource class. |
---
##### \`CfnResourceTypeName\`Required
\`\`\`csharp
public string CfnResourceTypeName { get; }
\`\`\`
- *Type:* string
The CloudFormation resource type name for this resource class.
---
### CfnRegistryPolicy
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::RegistryPolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html)
#### Initializers
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new CfnRegistryPolicy(Construct Scope, string Id, CfnRegistryPolicyProps Props);
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Scope
| Construct
| - scope in which this resource is defined. |
| Id
| string
| - scoped id of the resource. |
| Props
| CfnRegistryPolicyProps
| - resource properties. |
---
##### \`Scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`Id\`Required
- *Type:* string
scoped id of the resource.
---
##### \`Props\`Required
- *Type:* CfnRegistryPolicyProps
resource properties.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| ToString
| Returns a string representation of this construct. |
| OverrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| AddDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| AddDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| AddMetadata
| Add a value to the CloudFormation Resource Metadata. |
| AddOverride
| Adds an override to the synthesized CloudFormation resource. |
| AddPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| AddPropertyOverride
| Adds an override to a resource property. |
| ApplyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| GetAtt
| Returns a token for an runtime attribute of this resource. |
| GetMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| Inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`ToString\`
\`\`\`csharp
private string ToString()
\`\`\`
Returns a string representation of this construct.
##### \`OverrideLogicalId\`
\`\`\`csharp
private void OverrideLogicalId(string NewLogicalId)
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`NewLogicalId\`Required
- *Type:* string
The new logical ID to use for this stack element.
---
##### \`AddDeletionOverride\`
\`\`\`csharp
private void AddDeletionOverride(string Path)
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`Path\`Required
- *Type:* string
The path of the value to delete.
---
##### \`AddDependsOn\`
\`\`\`csharp
private void AddDependsOn(CfnResource Target)
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`Target\`Required
- *Type:* CfnResource
---
##### \`AddMetadata\`
\`\`\`csharp
private void AddMetadata(string Key, object Value)
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`Key\`Required
- *Type:* string
---
###### \`Value\`Required
- *Type:* object
---
##### \`AddOverride\`
\`\`\`csharp
private void AddOverride(string Path, object Value)
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`Path\`Required
- *Type:* string
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`Value\`Required
- *Type:* object
The value.
Could be primitive or complex.
---
##### \`AddPropertyDeletionOverride\`
\`\`\`csharp
private void AddPropertyDeletionOverride(string PropertyPath)
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`PropertyPath\`Required
- *Type:* string
The path to the property.
---
##### \`AddPropertyOverride\`
\`\`\`csharp
private void AddPropertyOverride(string PropertyPath, object Value)
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`PropertyPath\`Required
- *Type:* string
The path of the property.
---
###### \`Value\`Required
- *Type:* object
The value.
---
##### \`ApplyRemovalPolicy\`
\`\`\`csharp
private void ApplyRemovalPolicy(RemovalPolicy Policy = null, RemovalPolicyOptions Options = null)
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`Policy\`Optional
- *Type:* RemovalPolicy
---
###### \`Options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`GetAtt\`
\`\`\`csharp
private Reference GetAtt(string AttributeName)
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`AttributeName\`Required
- *Type:* string
The name of the attribute.
---
##### \`GetMetadata\`
\`\`\`csharp
private object GetMetadata(string Key)
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`Key\`Required
- *Type:* string
---
##### \`Inspect\`
\`\`\`csharp
private void Inspect(TreeInspector Inspector)
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`Inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| IsConstruct
| Return whether the given object is a Construct. |
| IsCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| IsCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`IsConstruct\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnRegistryPolicy.IsConstruct(object X);
\`\`\`
Return whether the given object is a Construct.
###### \`X\`Required
- *Type:* object
---
##### \`IsCfnElement\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnRegistryPolicy.IsCfnElement(object X);
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`X\`Required
- *Type:* object
---
##### \`IsCfnResource\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnRegistryPolicy.IsCfnResource(IConstruct Construct);
\`\`\`
Check whether the given construct is a CfnResource.
###### \`Construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| ConstructNode
| The construct tree node associated with this construct. |
| CreationStack
| string[]
| *No description.* |
| LogicalId
| string
| The logical ID for this CloudFormation stack element. |
| Stack
| Stack
| The stack in which this element is defined. |
| Ref
| string
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| CfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| CfnResourceType
| string
| AWS resource type. |
| AttrRegistryId
| string
| *No description.* |
| PolicyText
| object
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`Node\`Required
\`\`\`csharp
public ConstructNode Node { get; }
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`CreationStack\`Required
\`\`\`csharp
public string[] CreationStack { get; }
\`\`\`
- *Type:* string[]
---
##### \`LogicalId\`Required
\`\`\`csharp
public string LogicalId { get; }
\`\`\`
- *Type:* string
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`Stack\`Required
\`\`\`csharp
public Stack Stack { get; }
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`Ref\`Required
\`\`\`csharp
public string Ref { get; }
\`\`\`
- *Type:* string
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`CfnOptions\`Required
\`\`\`csharp
public ICfnResourceOptions CfnOptions { get; }
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`CfnResourceType\`Required
\`\`\`csharp
public string CfnResourceType { get; }
\`\`\`
- *Type:* string
AWS resource type.
---
##### \`AttrRegistryId\`Required
\`\`\`csharp
public string AttrRegistryId { get; }
\`\`\`
- *Type:* string
---
##### \`PolicyText\`Required
\`\`\`csharp
public object PolicyText { get; }
\`\`\`
- *Type:* object
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CfnResourceTypeName
| string
| The CloudFormation resource type name for this resource class. |
---
##### \`CfnResourceTypeName\`Required
\`\`\`csharp
public string CfnResourceTypeName { get; }
\`\`\`
- *Type:* string
The CloudFormation resource type name for this resource class.
---
### CfnReplicationConfiguration
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
#### Initializers
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new CfnReplicationConfiguration(Construct Scope, string Id, CfnReplicationConfigurationProps Props);
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Scope
| Construct
| - scope in which this resource is defined. |
| Id
| string
| - scoped id of the resource. |
| Props
| CfnReplicationConfigurationProps
| - resource properties. |
---
##### \`Scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`Id\`Required
- *Type:* string
scoped id of the resource.
---
##### \`Props\`Required
- *Type:* CfnReplicationConfigurationProps
resource properties.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| ToString
| Returns a string representation of this construct. |
| OverrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| AddDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| AddDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| AddMetadata
| Add a value to the CloudFormation Resource Metadata. |
| AddOverride
| Adds an override to the synthesized CloudFormation resource. |
| AddPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| AddPropertyOverride
| Adds an override to a resource property. |
| ApplyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| GetAtt
| Returns a token for an runtime attribute of this resource. |
| GetMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| Inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`ToString\`
\`\`\`csharp
private string ToString()
\`\`\`
Returns a string representation of this construct.
##### \`OverrideLogicalId\`
\`\`\`csharp
private void OverrideLogicalId(string NewLogicalId)
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`NewLogicalId\`Required
- *Type:* string
The new logical ID to use for this stack element.
---
##### \`AddDeletionOverride\`
\`\`\`csharp
private void AddDeletionOverride(string Path)
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`Path\`Required
- *Type:* string
The path of the value to delete.
---
##### \`AddDependsOn\`
\`\`\`csharp
private void AddDependsOn(CfnResource Target)
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`Target\`Required
- *Type:* CfnResource
---
##### \`AddMetadata\`
\`\`\`csharp
private void AddMetadata(string Key, object Value)
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`Key\`Required
- *Type:* string
---
###### \`Value\`Required
- *Type:* object
---
##### \`AddOverride\`
\`\`\`csharp
private void AddOverride(string Path, object Value)
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`Path\`Required
- *Type:* string
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`Value\`Required
- *Type:* object
The value.
Could be primitive or complex.
---
##### \`AddPropertyDeletionOverride\`
\`\`\`csharp
private void AddPropertyDeletionOverride(string PropertyPath)
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`PropertyPath\`Required
- *Type:* string
The path to the property.
---
##### \`AddPropertyOverride\`
\`\`\`csharp
private void AddPropertyOverride(string PropertyPath, object Value)
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`PropertyPath\`Required
- *Type:* string
The path of the property.
---
###### \`Value\`Required
- *Type:* object
The value.
---
##### \`ApplyRemovalPolicy\`
\`\`\`csharp
private void ApplyRemovalPolicy(RemovalPolicy Policy = null, RemovalPolicyOptions Options = null)
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`Policy\`Optional
- *Type:* RemovalPolicy
---
###### \`Options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`GetAtt\`
\`\`\`csharp
private Reference GetAtt(string AttributeName)
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`AttributeName\`Required
- *Type:* string
The name of the attribute.
---
##### \`GetMetadata\`
\`\`\`csharp
private object GetMetadata(string Key)
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`Key\`Required
- *Type:* string
---
##### \`Inspect\`
\`\`\`csharp
private void Inspect(TreeInspector Inspector)
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`Inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| IsConstruct
| Return whether the given object is a Construct. |
| IsCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| IsCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`IsConstruct\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnReplicationConfiguration.IsConstruct(object X);
\`\`\`
Return whether the given object is a Construct.
###### \`X\`Required
- *Type:* object
---
##### \`IsCfnElement\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnReplicationConfiguration.IsCfnElement(object X);
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`X\`Required
- *Type:* object
---
##### \`IsCfnResource\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnReplicationConfiguration.IsCfnResource(IConstruct Construct);
\`\`\`
Check whether the given construct is a CfnResource.
###### \`Construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| ConstructNode
| The construct tree node associated with this construct. |
| CreationStack
| string[]
| *No description.* |
| LogicalId
| string
| The logical ID for this CloudFormation stack element. |
| Stack
| Stack
| The stack in which this element is defined. |
| Ref
| string
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| CfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| CfnResourceType
| string
| AWS resource type. |
| AttrRegistryId
| string
| *No description.* |
| ReplicationConfiguration
| object
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`Node\`Required
\`\`\`csharp
public ConstructNode Node { get; }
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`CreationStack\`Required
\`\`\`csharp
public string[] CreationStack { get; }
\`\`\`
- *Type:* string[]
---
##### \`LogicalId\`Required
\`\`\`csharp
public string LogicalId { get; }
\`\`\`
- *Type:* string
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`Stack\`Required
\`\`\`csharp
public Stack Stack { get; }
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`Ref\`Required
\`\`\`csharp
public string Ref { get; }
\`\`\`
- *Type:* string
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`CfnOptions\`Required
\`\`\`csharp
public ICfnResourceOptions CfnOptions { get; }
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`CfnResourceType\`Required
\`\`\`csharp
public string CfnResourceType { get; }
\`\`\`
- *Type:* string
AWS resource type.
---
##### \`AttrRegistryId\`Required
\`\`\`csharp
public string AttrRegistryId { get; }
\`\`\`
- *Type:* string
---
##### \`ReplicationConfiguration\`Required
\`\`\`csharp
public object ReplicationConfiguration { get; }
\`\`\`
- *Type:* object
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CfnResourceTypeName
| string
| The CloudFormation resource type name for this resource class. |
---
##### \`CfnResourceTypeName\`Required
\`\`\`csharp
public string CfnResourceTypeName { get; }
\`\`\`
- *Type:* string
The CloudFormation resource type name for this resource class.
---
### CfnRepository
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::Repository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
#### Initializers
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new CfnRepository(Construct Scope, string Id, CfnRepositoryProps Props = null);
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Scope
| Construct
| - scope in which this resource is defined. |
| Id
| string
| - scoped id of the resource. |
| Props
| CfnRepositoryProps
| - resource properties. |
---
##### \`Scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`Id\`Required
- *Type:* string
scoped id of the resource.
---
##### \`Props\`Optional
- *Type:* CfnRepositoryProps
resource properties.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| ToString
| Returns a string representation of this construct. |
| OverrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| AddDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| AddDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| AddMetadata
| Add a value to the CloudFormation Resource Metadata. |
| AddOverride
| Adds an override to the synthesized CloudFormation resource. |
| AddPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| AddPropertyOverride
| Adds an override to a resource property. |
| ApplyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| GetAtt
| Returns a token for an runtime attribute of this resource. |
| GetMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| Inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`ToString\`
\`\`\`csharp
private string ToString()
\`\`\`
Returns a string representation of this construct.
##### \`OverrideLogicalId\`
\`\`\`csharp
private void OverrideLogicalId(string NewLogicalId)
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`NewLogicalId\`Required
- *Type:* string
The new logical ID to use for this stack element.
---
##### \`AddDeletionOverride\`
\`\`\`csharp
private void AddDeletionOverride(string Path)
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`Path\`Required
- *Type:* string
The path of the value to delete.
---
##### \`AddDependsOn\`
\`\`\`csharp
private void AddDependsOn(CfnResource Target)
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`Target\`Required
- *Type:* CfnResource
---
##### \`AddMetadata\`
\`\`\`csharp
private void AddMetadata(string Key, object Value)
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`Key\`Required
- *Type:* string
---
###### \`Value\`Required
- *Type:* object
---
##### \`AddOverride\`
\`\`\`csharp
private void AddOverride(string Path, object Value)
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`Path\`Required
- *Type:* string
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`Value\`Required
- *Type:* object
The value.
Could be primitive or complex.
---
##### \`AddPropertyDeletionOverride\`
\`\`\`csharp
private void AddPropertyDeletionOverride(string PropertyPath)
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`PropertyPath\`Required
- *Type:* string
The path to the property.
---
##### \`AddPropertyOverride\`
\`\`\`csharp
private void AddPropertyOverride(string PropertyPath, object Value)
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`PropertyPath\`Required
- *Type:* string
The path of the property.
---
###### \`Value\`Required
- *Type:* object
The value.
---
##### \`ApplyRemovalPolicy\`
\`\`\`csharp
private void ApplyRemovalPolicy(RemovalPolicy Policy = null, RemovalPolicyOptions Options = null)
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`Policy\`Optional
- *Type:* RemovalPolicy
---
###### \`Options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`GetAtt\`
\`\`\`csharp
private Reference GetAtt(string AttributeName)
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`AttributeName\`Required
- *Type:* string
The name of the attribute.
---
##### \`GetMetadata\`
\`\`\`csharp
private object GetMetadata(string Key)
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`Key\`Required
- *Type:* string
---
##### \`Inspect\`
\`\`\`csharp
private void Inspect(TreeInspector Inspector)
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`Inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| IsConstruct
| Return whether the given object is a Construct. |
| IsCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| IsCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`IsConstruct\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnRepository.IsConstruct(object X);
\`\`\`
Return whether the given object is a Construct.
###### \`X\`Required
- *Type:* object
---
##### \`IsCfnElement\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnRepository.IsCfnElement(object X);
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`X\`Required
- *Type:* object
---
##### \`IsCfnResource\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
CfnRepository.IsCfnResource(IConstruct Construct);
\`\`\`
Check whether the given construct is a CfnResource.
###### \`Construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| ConstructNode
| The construct tree node associated with this construct. |
| CreationStack
| string[]
| *No description.* |
| LogicalId
| string
| The logical ID for this CloudFormation stack element. |
| Stack
| Stack
| The stack in which this element is defined. |
| Ref
| string
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| CfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| CfnResourceType
| string
| AWS resource type. |
| AttrArn
| string
| *No description.* |
| AttrRepositoryUri
| string
| *No description.* |
| Tags
| TagManager
| \`AWS::ECR::Repository.Tags\`. |
| EncryptionConfiguration
| object
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| ImageScanningConfiguration
| object
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| RepositoryPolicyText
| object
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| ImageTagMutability
| string
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| LifecyclePolicy
| object
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| RepositoryName
| string
| \`AWS::ECR::Repository.RepositoryName\`. |
---
##### \`Node\`Required
\`\`\`csharp
public ConstructNode Node { get; }
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`CreationStack\`Required
\`\`\`csharp
public string[] CreationStack { get; }
\`\`\`
- *Type:* string[]
---
##### \`LogicalId\`Required
\`\`\`csharp
public string LogicalId { get; }
\`\`\`
- *Type:* string
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`Stack\`Required
\`\`\`csharp
public Stack Stack { get; }
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`Ref\`Required
\`\`\`csharp
public string Ref { get; }
\`\`\`
- *Type:* string
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`CfnOptions\`Required
\`\`\`csharp
public ICfnResourceOptions CfnOptions { get; }
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`CfnResourceType\`Required
\`\`\`csharp
public string CfnResourceType { get; }
\`\`\`
- *Type:* string
AWS resource type.
---
##### \`AttrArn\`Required
\`\`\`csharp
public string AttrArn { get; }
\`\`\`
- *Type:* string
---
##### \`AttrRepositoryUri\`Required
\`\`\`csharp
public string AttrRepositoryUri { get; }
\`\`\`
- *Type:* string
---
##### \`Tags\`Required
\`\`\`csharp
public TagManager Tags { get; }
\`\`\`
- *Type:* TagManager
\`AWS::ECR::Repository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
---
##### \`EncryptionConfiguration\`Required
\`\`\`csharp
public object EncryptionConfiguration { get; }
\`\`\`
- *Type:* object
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`ImageScanningConfiguration\`Required
\`\`\`csharp
public object ImageScanningConfiguration { get; }
\`\`\`
- *Type:* object
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`RepositoryPolicyText\`Required
\`\`\`csharp
public object RepositoryPolicyText { get; }
\`\`\`
- *Type:* object
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`ImageTagMutability\`Optional
\`\`\`csharp
public string ImageTagMutability { get; }
\`\`\`
- *Type:* string
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`LifecyclePolicy\`Optional
\`\`\`csharp
public object LifecyclePolicy { get; }
\`\`\`
- *Type:* object
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`RepositoryName\`Optional
\`\`\`csharp
public string RepositoryName { get; }
\`\`\`
- *Type:* string
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CfnResourceTypeName
| string
| The CloudFormation resource type name for this resource class. |
---
##### \`CfnResourceTypeName\`Required
\`\`\`csharp
public string CfnResourceTypeName { get; }
\`\`\`
- *Type:* string
The CloudFormation resource type name for this resource class.
---
### Repository
Define an ECR repository.
#### Initializers
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new Repository(Construct Scope, string Id, RepositoryProps Props = null);
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Scope
| Construct
| *No description.* |
| Id
| string
| *No description.* |
| Props
| RepositoryProps
| *No description.* |
---
##### \`Scope\`Required
- *Type:* Construct
---
##### \`Id\`Required
- *Type:* string
---
##### \`Props\`Optional
- *Type:* RepositoryProps
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| ToString
| Returns a string representation of this construct. |
| ApplyRemovalPolicy
| Apply the given removal policy to this resource. |
| AddToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| Grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| GrantPull
| Grant the given identity permissions to use the images in this repository. |
| GrantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| OnCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| OnCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| OnEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| OnImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed. |
| RepositoryUriForDigest
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| RepositoryUriForTag
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| AddLifecycleRule
| Add a life cycle rule to the repository. |
---
##### \`ToString\`
\`\`\`csharp
private string ToString()
\`\`\`
Returns a string representation of this construct.
##### \`ApplyRemovalPolicy\`
\`\`\`csharp
private void ApplyRemovalPolicy(RemovalPolicy Policy)
\`\`\`
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (\`RemovalPolicy.DELETE\`), or left in your AWS
account for data recovery and cleanup later (\`RemovalPolicy.RETAIN\`).
###### \`Policy\`Required
- *Type:* RemovalPolicy
---
##### \`AddToResourcePolicy\`
\`\`\`csharp
private AddToResourcePolicyResult AddToResourcePolicy(PolicyStatement Statement)
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`Statement\`Required
- *Type:* PolicyStatement
---
##### \`Grant\`
\`\`\`csharp
private Grant Grant(IGrantable Grantee, string Actions)
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
###### \`Actions\`Required
- *Type:* string
---
##### \`GrantPull\`
\`\`\`csharp
private Grant GrantPull(IGrantable Grantee)
\`\`\`
Grant the given identity permissions to use the images in this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
##### \`GrantPullPush\`
\`\`\`csharp
private Grant GrantPullPush(IGrantable Grantee)
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
##### \`OnCloudTrailEvent\`
\`\`\`csharp
private Rule OnCloudTrailEvent(string Id, OnEventOptions Options = null)
\`\`\`
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.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`OnCloudTrailImagePushed\`
\`\`\`csharp
private Rule OnCloudTrailImagePushed(string Id, OnCloudTrailImagePushedOptions Options = null)
\`\`\`
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.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`OnEvent\`
\`\`\`csharp
private Rule OnEvent(string Id, OnEventOptions Options = null)
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`Id\`Required
- *Type:* string
---
###### \`Options\`Optional
- *Type:* OnEventOptions
---
##### \`OnImageScanCompleted\`
\`\`\`csharp
private Rule OnImageScanCompleted(string Id, OnImageScanCompletedOptions Options = null)
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`RepositoryUriForDigest\`
\`\`\`csharp
private string RepositoryUriForDigest(string Digest = null)
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`Digest\`Optional
- *Type:* string
Optional image digest.
---
##### \`RepositoryUriForTag\`
\`\`\`csharp
private string RepositoryUriForTag(string Tag = null)
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
###### \`Tag\`Optional
- *Type:* string
Optional image tag.
---
##### \`AddLifecycleRule\`
\`\`\`csharp
private void AddLifecycleRule(LifecycleRule Rule)
\`\`\`
Add a life cycle rule to the repository.
Life cycle rules automatically expire images from the repository that match
certain conditions.
###### \`Rule\`Required
- *Type:* LifecycleRule
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| IsConstruct
| Return whether the given object is a Construct. |
| IsResource
| Check whether the given construct is a Resource. |
| ArnForLocalRepository
| Returns an ECR ARN for a repository that resides in the same account/region as the current stack. |
| FromRepositoryArn
| *No description.* |
| FromRepositoryAttributes
| Import a repository. |
| FromRepositoryName
| *No description.* |
---
##### \`IsConstruct\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
Repository.IsConstruct(object X);
\`\`\`
Return whether the given object is a Construct.
###### \`X\`Required
- *Type:* object
---
##### \`IsResource\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
Repository.IsResource(IConstruct Construct);
\`\`\`
Check whether the given construct is a Resource.
###### \`Construct\`Required
- *Type:* IConstruct
---
##### \`ArnForLocalRepository\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
Repository.ArnForLocalRepository(string RepositoryName, IConstruct Scope, string Account = null);
\`\`\`
Returns an ECR ARN for a repository that resides in the same account/region as the current stack.
###### \`RepositoryName\`Required
- *Type:* string
---
###### \`Scope\`Required
- *Type:* IConstruct
---
###### \`Account\`Optional
- *Type:* string
---
##### \`FromRepositoryArn\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
Repository.FromRepositoryArn(Construct Scope, string Id, string RepositoryArn);
\`\`\`
###### \`Scope\`Required
- *Type:* Construct
---
###### \`Id\`Required
- *Type:* string
---
###### \`RepositoryArn\`Required
- *Type:* string
---
##### \`FromRepositoryAttributes\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
Repository.FromRepositoryAttributes(Construct Scope, string Id, RepositoryAttributes Attrs);
\`\`\`
Import a repository.
###### \`Scope\`Required
- *Type:* Construct
---
###### \`Id\`Required
- *Type:* string
---
###### \`Attrs\`Required
- *Type:* RepositoryAttributes
---
##### \`FromRepositoryName\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
Repository.FromRepositoryName(Construct Scope, string Id, string RepositoryName);
\`\`\`
###### \`Scope\`Required
- *Type:* Construct
---
###### \`Id\`Required
- *Type:* string
---
###### \`RepositoryName\`Required
- *Type:* string
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| ConstructNode
| The construct tree node associated with this construct. |
| Env
| ResourceEnvironment
| The environment this resource belongs to. |
| Stack
| Stack
| The stack in which this resource is defined. |
| RepositoryArn
| string
| The ARN of the repository. |
| RepositoryName
| string
| The name of the repository. |
| RepositoryUri
| string
| The URI of this repository (represents the latest image):. |
---
##### \`Node\`Required
\`\`\`csharp
public ConstructNode Node { get; }
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`Env\`Required
\`\`\`csharp
public ResourceEnvironment Env { get; }
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`Stack\`Required
\`\`\`csharp
public Stack Stack { get; }
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`RepositoryArn\`Required
\`\`\`csharp
public string RepositoryArn { get; }
\`\`\`
- *Type:* string
The ARN of the repository.
---
##### \`RepositoryName\`Required
\`\`\`csharp
public string RepositoryName { get; }
\`\`\`
- *Type:* string
The name of the repository.
---
##### \`RepositoryUri\`Required
\`\`\`csharp
public string RepositoryUri { get; }
\`\`\`
- *Type:* string
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
### RepositoryBase
- *Implements:* IRepository
Base class for ECR repository.
Reused between imported repositories and owned repositories.
#### Initializers
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new RepositoryBase(Construct Scope, string Id, ResourceProps Props = null);
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Scope
| Construct
| *No description.* |
| Id
| string
| *No description.* |
| Props
| ResourceProps
| *No description.* |
---
##### \`Scope\`Required
- *Type:* Construct
---
##### \`Id\`Required
- *Type:* string
---
##### \`Props\`Optional
- *Type:* ResourceProps
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| ToString
| Returns a string representation of this construct. |
| ApplyRemovalPolicy
| Apply the given removal policy to this resource. |
| AddToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| Grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| GrantPull
| Grant the given identity permissions to use the images in this repository. |
| GrantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| OnCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| OnCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| OnEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| OnImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed. |
| RepositoryUriForDigest
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| RepositoryUriForTag
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
---
##### \`ToString\`
\`\`\`csharp
private string ToString()
\`\`\`
Returns a string representation of this construct.
##### \`ApplyRemovalPolicy\`
\`\`\`csharp
private void ApplyRemovalPolicy(RemovalPolicy Policy)
\`\`\`
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (\`RemovalPolicy.DELETE\`), or left in your AWS
account for data recovery and cleanup later (\`RemovalPolicy.RETAIN\`).
###### \`Policy\`Required
- *Type:* RemovalPolicy
---
##### \`AddToResourcePolicy\`
\`\`\`csharp
private AddToResourcePolicyResult AddToResourcePolicy(PolicyStatement Statement)
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`Statement\`Required
- *Type:* PolicyStatement
---
##### \`Grant\`
\`\`\`csharp
private Grant Grant(IGrantable Grantee, string Actions)
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
###### \`Actions\`Required
- *Type:* string
---
##### \`GrantPull\`
\`\`\`csharp
private Grant GrantPull(IGrantable Grantee)
\`\`\`
Grant the given identity permissions to use the images in this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
##### \`GrantPullPush\`
\`\`\`csharp
private Grant GrantPullPush(IGrantable Grantee)
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
##### \`OnCloudTrailEvent\`
\`\`\`csharp
private Rule OnCloudTrailEvent(string Id, OnEventOptions Options = null)
\`\`\`
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.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`OnCloudTrailImagePushed\`
\`\`\`csharp
private Rule OnCloudTrailImagePushed(string Id, OnCloudTrailImagePushedOptions Options = null)
\`\`\`
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.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`OnEvent\`
\`\`\`csharp
private Rule OnEvent(string Id, OnEventOptions Options = null)
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`Id\`Required
- *Type:* string
---
###### \`Options\`Optional
- *Type:* OnEventOptions
---
##### \`OnImageScanCompleted\`
\`\`\`csharp
private Rule OnImageScanCompleted(string Id, OnImageScanCompletedOptions Options = null)
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`RepositoryUriForDigest\`
\`\`\`csharp
private string RepositoryUriForDigest(string Digest = null)
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`Digest\`Optional
- *Type:* string
Optional image digest.
---
##### \`RepositoryUriForTag\`
\`\`\`csharp
private string RepositoryUriForTag(string Tag = null)
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
###### \`Tag\`Optional
- *Type:* string
Optional image tag.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| IsConstruct
| Return whether the given object is a Construct. |
| IsResource
| Check whether the given construct is a Resource. |
---
##### \`IsConstruct\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
RepositoryBase.IsConstruct(object X);
\`\`\`
Return whether the given object is a Construct.
###### \`X\`Required
- *Type:* object
---
##### \`IsResource\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
RepositoryBase.IsResource(IConstruct Construct);
\`\`\`
Check whether the given construct is a Resource.
###### \`Construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| ConstructNode
| The construct tree node associated with this construct. |
| Env
| ResourceEnvironment
| The environment this resource belongs to. |
| Stack
| Stack
| The stack in which this resource is defined. |
| RepositoryArn
| string
| The ARN of the repository. |
| RepositoryName
| string
| The name of the repository. |
| RepositoryUri
| string
| The URI of this repository (represents the latest image):. |
---
##### \`Node\`Required
\`\`\`csharp
public ConstructNode Node { get; }
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`Env\`Required
\`\`\`csharp
public ResourceEnvironment Env { get; }
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`Stack\`Required
\`\`\`csharp
public Stack Stack { get; }
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`RepositoryArn\`Required
\`\`\`csharp
public string RepositoryArn { get; }
\`\`\`
- *Type:* string
The ARN of the repository.
---
##### \`RepositoryName\`Required
\`\`\`csharp
public string RepositoryName { get; }
\`\`\`
- *Type:* string
The name of the repository.
---
##### \`RepositoryUri\`Required
\`\`\`csharp
public string RepositoryUri { get; }
\`\`\`
- *Type:* string
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
## Structs
### CfnPublicRepositoryProps
Properties for defining a \`AWS::ECR::PublicRepository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new CfnPublicRepositoryProps {
object RepositoryCatalogData = null,
string RepositoryName = null,
object RepositoryPolicyText = null,
CfnTag[] Tags = null
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| RepositoryCatalogData
| object
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| RepositoryName
| string
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
| RepositoryPolicyText
| object
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| Tags
| CfnTag[]
| \`AWS::ECR::PublicRepository.Tags\`. |
---
##### \`RepositoryCatalogData\`Optional
\`\`\`csharp
public object RepositoryCatalogData { get; set; }
\`\`\`
- *Type:* object
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`RepositoryName\`Optional
\`\`\`csharp
public string RepositoryName { get; set; }
\`\`\`
- *Type:* string
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
##### \`RepositoryPolicyText\`Optional
\`\`\`csharp
public object RepositoryPolicyText { get; set; }
\`\`\`
- *Type:* object
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`Tags\`Optional
\`\`\`csharp
public CfnTag[] Tags { get; set; }
\`\`\`
- *Type:* CfnTag[]
\`AWS::ECR::PublicRepository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
---
### CfnRegistryPolicyProps
Properties for defining a \`AWS::ECR::RegistryPolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html)
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new CfnRegistryPolicyProps {
object PolicyText
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| PolicyText
| object
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`PolicyText\`Required
\`\`\`csharp
public object PolicyText { get; set; }
\`\`\`
- *Type:* object
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
### CfnReplicationConfigurationProps
Properties for defining a \`AWS::ECR::ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new CfnReplicationConfigurationProps {
object ReplicationConfiguration
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| ReplicationConfiguration
| object
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`ReplicationConfiguration\`Required
\`\`\`csharp
public object ReplicationConfiguration { get; set; }
\`\`\`
- *Type:* object
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
### CfnRepositoryProps
Properties for defining a \`AWS::ECR::Repository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new CfnRepositoryProps {
object EncryptionConfiguration = null,
object ImageScanningConfiguration = null,
string ImageTagMutability = null,
object LifecyclePolicy = null,
string RepositoryName = null,
object RepositoryPolicyText = null,
CfnTag[] Tags = null
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| EncryptionConfiguration
| object
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| ImageScanningConfiguration
| object
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| ImageTagMutability
| string
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| LifecyclePolicy
| object
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| RepositoryName
| string
| \`AWS::ECR::Repository.RepositoryName\`. |
| RepositoryPolicyText
| object
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| Tags
| CfnTag[]
| \`AWS::ECR::Repository.Tags\`. |
---
##### \`EncryptionConfiguration\`Optional
\`\`\`csharp
public object EncryptionConfiguration { get; set; }
\`\`\`
- *Type:* object
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`ImageScanningConfiguration\`Optional
\`\`\`csharp
public object ImageScanningConfiguration { get; set; }
\`\`\`
- *Type:* object
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`ImageTagMutability\`Optional
\`\`\`csharp
public string ImageTagMutability { get; set; }
\`\`\`
- *Type:* string
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`LifecyclePolicy\`Optional
\`\`\`csharp
public object LifecyclePolicy { get; set; }
\`\`\`
- *Type:* object
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`RepositoryName\`Optional
\`\`\`csharp
public string RepositoryName { get; set; }
\`\`\`
- *Type:* string
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
##### \`RepositoryPolicyText\`Optional
\`\`\`csharp
public object RepositoryPolicyText { get; set; }
\`\`\`
- *Type:* object
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`Tags\`Optional
\`\`\`csharp
public CfnTag[] Tags { get; set; }
\`\`\`
- *Type:* CfnTag[]
\`AWS::ECR::Repository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
---
### LifecyclePolicyProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html)
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new LifecyclePolicyProperty {
string LifecyclePolicyText = null,
string RegistryId = null
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| LifecyclePolicyText
| string
| \`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`. |
| RegistryId
| string
| \`CfnRepository.LifecyclePolicyProperty.RegistryId\`. |
---
##### \`LifecyclePolicyText\`Optional
\`\`\`csharp
public string LifecyclePolicyText { get; set; }
\`\`\`
- *Type:* string
\`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext)
---
##### \`RegistryId\`Optional
\`\`\`csharp
public string RegistryId { get; set; }
\`\`\`
- *Type:* string
\`CfnRepository.LifecyclePolicyProperty.RegistryId\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid)
---
### LifecycleRule
An ECR life cycle rule.
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new LifecycleRule {
string Description = null,
Duration MaxImageAge = null,
double MaxImageCount = null,
double RulePriority = null,
string[] TagPrefixList = null,
TagStatus TagStatus = null
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Description
| string
| Describes the purpose of the rule. |
| MaxImageAge
| Duration
| The maximum age of images to retain. The value must represent a number of days. |
| MaxImageCount
| double
| The maximum number of images to retain. |
| RulePriority
| double
| Controls the order in which rules are evaluated (low to high). |
| TagPrefixList
| string[]
| Select images that have ALL the given prefixes in their tag. |
| TagStatus
| TagStatus
| Select images based on tags. |
---
##### \`Description\`Optional
\`\`\`csharp
public string Description { get; set; }
\`\`\`
- *Type:* string
- *Default:* No description
Describes the purpose of the rule.
---
##### \`MaxImageAge\`Optional
\`\`\`csharp
public Duration MaxImageAge { get; set; }
\`\`\`
- *Type:* Duration
The maximum age of images to retain. The value must represent a number of days.
Specify exactly one of maxImageCount and maxImageAge.
---
##### \`MaxImageCount\`Optional
\`\`\`csharp
public double MaxImageCount { get; set; }
\`\`\`
- *Type:* double
The maximum number of images to retain.
Specify exactly one of maxImageCount and maxImageAge.
---
##### \`RulePriority\`Optional
\`\`\`csharp
public double RulePriority { get; set; }
\`\`\`
- *Type:* double
- *Default:* Automatically assigned
Controls the order in which rules are evaluated (low to high).
All rules must have a unique priority, where lower numbers have
higher precedence. The first rule that matches is applied to an image.
There can only be one rule with a tagStatus of Any, and it must have
the highest rulePriority.
All rules without a specified priority will have incrementing priorities
automatically assigned to them, higher than any rules that DO have priorities.
---
##### \`TagPrefixList\`Optional
\`\`\`csharp
public string[] TagPrefixList { get; set; }
\`\`\`
- *Type:* string[]
Select images that have ALL the given prefixes in their tag.
Only if tagStatus == TagStatus.Tagged
---
##### \`TagStatus\`Optional
\`\`\`csharp
public TagStatus TagStatus { get; set; }
\`\`\`
- *Type:* TagStatus
- *Default:* TagStatus.Tagged if tagPrefixList is given, TagStatus.Any otherwise
Select images based on tags.
Only one rule is allowed to select untagged images, and it must
have the highest rulePriority.
---
### OnCloudTrailImagePushedOptions
Options for the onCloudTrailImagePushed method.
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new OnCloudTrailImagePushedOptions {
string Description = null,
EventPattern EventPattern = null,
string RuleName = null,
IRuleTarget Target = null,
string ImageTag = null
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Description
| string
| A description of the rule's purpose. |
| EventPattern
| EventPattern
| Additional restrictions for the event to route to the specified target. |
| RuleName
| string
| A name for the rule. |
| Target
| IRuleTarget
| The target to register for the event. |
| ImageTag
| string
| Only watch changes to this image tag. |
---
##### \`Description\`Optional
\`\`\`csharp
public string Description { get; set; }
\`\`\`
- *Type:* string
- *Default:* No description
A description of the rule's purpose.
---
##### \`EventPattern\`Optional
\`\`\`csharp
public EventPattern EventPattern { get; set; }
\`\`\`
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
##### \`RuleName\`Optional
\`\`\`csharp
public string RuleName { get; set; }
\`\`\`
- *Type:* string
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
##### \`Target\`Optional
\`\`\`csharp
public IRuleTarget Target { get; set; }
\`\`\`
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`ImageTag\`Optional
\`\`\`csharp
public string ImageTag { get; set; }
\`\`\`
- *Type:* string
- *Default:* Watch changes to all tags
Only watch changes to this image tag.
---
### OnImageScanCompletedOptions
Options for the OnImageScanCompleted method.
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new OnImageScanCompletedOptions {
string Description = null,
EventPattern EventPattern = null,
string RuleName = null,
IRuleTarget Target = null,
string[] ImageTags = null
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Description
| string
| A description of the rule's purpose. |
| EventPattern
| EventPattern
| Additional restrictions for the event to route to the specified target. |
| RuleName
| string
| A name for the rule. |
| Target
| IRuleTarget
| The target to register for the event. |
| ImageTags
| string[]
| Only watch changes to the image tags spedified. |
---
##### \`Description\`Optional
\`\`\`csharp
public string Description { get; set; }
\`\`\`
- *Type:* string
- *Default:* No description
A description of the rule's purpose.
---
##### \`EventPattern\`Optional
\`\`\`csharp
public EventPattern EventPattern { get; set; }
\`\`\`
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
##### \`RuleName\`Optional
\`\`\`csharp
public string RuleName { get; set; }
\`\`\`
- *Type:* string
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
##### \`Target\`Optional
\`\`\`csharp
public IRuleTarget Target { get; set; }
\`\`\`
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`ImageTags\`Optional
\`\`\`csharp
public string[] ImageTags { get; set; }
\`\`\`
- *Type:* string[]
- *Default:* Watch the changes to the repository with all image tags
Only watch changes to the image tags spedified.
Leave it undefined to watch the full repository.
---
### ReplicationConfigurationProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html)
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new ReplicationConfigurationProperty {
object Rules
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Rules
| object
| \`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`. |
---
##### \`Rules\`Required
\`\`\`csharp
public object Rules { get; set; }
\`\`\`
- *Type:* object
\`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules)
---
### ReplicationDestinationProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html)
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new ReplicationDestinationProperty {
string Region,
string RegistryId
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Region
| string
| \`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`. |
| RegistryId
| string
| \`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`. |
---
##### \`Region\`Required
\`\`\`csharp
public string Region { get; set; }
\`\`\`
- *Type:* string
\`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region)
---
##### \`RegistryId\`Required
\`\`\`csharp
public string RegistryId { get; set; }
\`\`\`
- *Type:* string
\`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid)
---
### ReplicationRuleProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html)
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new ReplicationRuleProperty {
object Destinations
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Destinations
| object
| \`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`. |
---
##### \`Destinations\`Required
\`\`\`csharp
public object Destinations { get; set; }
\`\`\`
- *Type:* object
\`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations)
---
### RepositoryAttributes
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new RepositoryAttributes {
string RepositoryArn,
string RepositoryName
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| RepositoryArn
| string
| *No description.* |
| RepositoryName
| string
| *No description.* |
---
##### \`RepositoryArn\`Required
\`\`\`csharp
public string RepositoryArn { get; set; }
\`\`\`
- *Type:* string
---
##### \`RepositoryName\`Required
\`\`\`csharp
public string RepositoryName { get; set; }
\`\`\`
- *Type:* string
---
### RepositoryProps
#### Initializer
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
new RepositoryProps {
bool ImageScanOnPush = null,
TagMutability ImageTagMutability = null,
string LifecycleRegistryId = null,
LifecycleRule[] LifecycleRules = null,
RemovalPolicy RemovalPolicy = null,
string RepositoryName = null
};
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| ImageScanOnPush
| bool
| Enable the scan on push when creating the repository. |
| ImageTagMutability
| TagMutability
| The tag mutability setting for the repository. |
| LifecycleRegistryId
| string
| The AWS account ID associated with the registry that contains the repository. |
| LifecycleRules
| LifecycleRule[]
| Life cycle rules to apply to this registry. |
| RemovalPolicy
| RemovalPolicy
| Determine what happens to the repository when the resource/stack is deleted. |
| RepositoryName
| string
| Name for this repository. |
---
##### \`ImageScanOnPush\`Optional
\`\`\`csharp
public bool ImageScanOnPush { get; set; }
\`\`\`
- *Type:* bool
- *Default:* false
Enable the scan on push when creating the repository.
---
##### \`ImageTagMutability\`Optional
\`\`\`csharp
public TagMutability ImageTagMutability { get; set; }
\`\`\`
- *Type:* TagMutability
- *Default:* TagMutability.MUTABLE
The tag mutability setting for the repository.
If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten.
---
##### \`LifecycleRegistryId\`Optional
\`\`\`csharp
public string LifecycleRegistryId { get; set; }
\`\`\`
- *Type:* string
- *Default:* The default registry is assumed.
The AWS account ID associated with the registry that contains the repository.
> [https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html](https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html)
---
##### \`LifecycleRules\`Optional
\`\`\`csharp
public LifecycleRule[] LifecycleRules { get; set; }
\`\`\`
- *Type:* LifecycleRule[]
- *Default:* No life cycle rules
Life cycle rules to apply to this registry.
---
##### \`RemovalPolicy\`Optional
\`\`\`csharp
public RemovalPolicy RemovalPolicy { get; set; }
\`\`\`
- *Type:* RemovalPolicy
- *Default:* RemovalPolicy.Retain
Determine what happens to the repository when the resource/stack is deleted.
---
##### \`RepositoryName\`Optional
\`\`\`csharp
public string RepositoryName { get; set; }
\`\`\`
- *Type:* string
- *Default:* Automatically generated name.
Name for this repository.
---
## Classes
### AuthorizationToken
Authorization token to access private ECR repositories in the current environment via Docker CLI.
> [https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html](https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html)
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| GrantRead
| Grant access to retrieve an authorization token. |
---
##### \`GrantRead\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
AuthorizationToken.GrantRead(IGrantable Grantee);
\`\`\`
Grant access to retrieve an authorization token.
###### \`Grantee\`Required
- *Type:* IGrantable
---
### PublicGalleryAuthorizationToken
Authorization token to access the global public ECR Gallery via Docker CLI.
> [https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth)
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| GrantRead
| Grant access to retrieve an authorization token. |
---
##### \`GrantRead\`
\`\`\`csharp
using Amazon.CDK.AWS.ECR;
PublicGalleryAuthorizationToken.GrantRead(IGrantable Grantee);
\`\`\`
Grant access to retrieve an authorization token.
###### \`Grantee\`Required
- *Type:* IGrantable
---
## Protocols
### IRepository
- *Extends:* IResource
- *Implemented By:* Repository, RepositoryBase, IRepository
Represents an ECR repository.
#### Methods
| **Name** | **Description** |
| --- | --- |
| AddToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| Grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| GrantPull
| Grant the given identity permissions to pull images in this repository. |
| GrantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| OnCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| OnCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| OnEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| OnImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed. |
| RepositoryUriForDigest
| Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`. |
| RepositoryUriForTag
| Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`. |
---
##### \`AddToResourcePolicy\`
\`\`\`csharp
private AddToResourcePolicyResult AddToResourcePolicy(PolicyStatement Statement)
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`Statement\`Required
- *Type:* PolicyStatement
---
##### \`Grant\`
\`\`\`csharp
private Grant Grant(IGrantable Grantee, string Actions)
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
###### \`Actions\`Required
- *Type:* string
---
##### \`GrantPull\`
\`\`\`csharp
private Grant GrantPull(IGrantable Grantee)
\`\`\`
Grant the given identity permissions to pull images in this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
##### \`GrantPullPush\`
\`\`\`csharp
private Grant GrantPullPush(IGrantable Grantee)
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`Grantee\`Required
- *Type:* IGrantable
---
##### \`OnCloudTrailEvent\`
\`\`\`csharp
private Rule OnCloudTrailEvent(string Id, OnEventOptions Options = null)
\`\`\`
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.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`OnCloudTrailImagePushed\`
\`\`\`csharp
private Rule OnCloudTrailImagePushed(string Id, OnCloudTrailImagePushedOptions Options = null)
\`\`\`
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.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`OnEvent\`
\`\`\`csharp
private Rule OnEvent(string Id, OnEventOptions Options = null)
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`Id\`Required
- *Type:* string
---
###### \`Options\`Optional
- *Type:* OnEventOptions
---
##### \`OnImageScanCompleted\`
\`\`\`csharp
private Rule OnImageScanCompleted(string Id, OnImageScanCompletedOptions Options = null)
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed.
###### \`Id\`Required
- *Type:* string
The id of the rule.
---
###### \`Options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`RepositoryUriForDigest\`
\`\`\`csharp
private string RepositoryUriForDigest(string Digest = null)
\`\`\`
Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`Digest\`Optional
- *Type:* string
Image digest to use (tools usually default to the image with the "latest" tag if omitted).
---
##### \`RepositoryUriForTag\`
\`\`\`csharp
private string RepositoryUriForTag(string Tag = null)
\`\`\`
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]
###### \`Tag\`Optional
- *Type:* string
Image tag to use (tools usually default to "latest" if omitted).
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| ConstructNode
| The construct tree node for this construct. |
| Env
| ResourceEnvironment
| The environment this resource belongs to. |
| Stack
| Stack
| The stack in which this resource is defined. |
| RepositoryArn
| string
| The ARN of the repository. |
| RepositoryName
| string
| The name of the repository. |
| RepositoryUri
| string
| The URI of this repository (represents the latest image):. |
---
##### \`Node\`Required
\`\`\`csharp
public ConstructNode Node { get; }
\`\`\`
- *Type:* ConstructNode
The construct tree node for this construct.
---
##### \`Env\`Required
\`\`\`csharp
public ResourceEnvironment Env { get; }
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`Stack\`Required
\`\`\`csharp
public Stack Stack { get; }
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`RepositoryArn\`Required
\`\`\`csharp
public string RepositoryArn { get; }
\`\`\`
- *Type:* string
The ARN of the repository.
---
##### \`RepositoryName\`Required
\`\`\`csharp
public string RepositoryName { get; }
\`\`\`
- *Type:* string
The name of the repository.
---
##### \`RepositoryUri\`Required
\`\`\`csharp
public string RepositoryUri { get; }
\`\`\`
- *Type:* string
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
## Enums
### TagMutability
The tag mutability setting for your repository.
#### Members
| **Name** | **Description** |
| --- | --- |
| MUTABLE
| allow image tags to be overwritten. |
| IMMUTABLE
| all image tags within the repository will be immutable which will prevent them from being overwritten. |
---
##### \`MUTABLE\`
allow image tags to be overwritten.
---
##### \`IMMUTABLE\`
all image tags within the repository will be immutable which will prevent them from being overwritten.
---
### TagStatus
Select images based on tags.
#### Members
| **Name** | **Description** |
| --- | --- |
| ANY
| Rule applies to all images. |
| TAGGED
| Rule applies to tagged images. |
| UNTAGGED
| Rule applies to untagged images. |
---
##### \`ANY\`
Rule applies to all images.
---
##### \`TAGGED\`
Rule applies to tagged images.
---
##### \`UNTAGGED\`
Rule applies to untagged images.
---
"
`;
exports[`simple link formatter go snapshot 1`] = `
"# Constructs
> Software-defined persistent state

[](https://badge.fury.io/js/constructs)
[](https://badge.fury.io/py/constructs)
[](https://badge.fury.io/nu/Constructs)
[](https://maven-badges.herokuapp.com/maven-central/software.constructs/constructs)
## What are constructs?
Constructs are classes which define a "piece of system state". Constructs can be composed together to form higher-level building blocks which represent more complex state.
Constructs are often used to represent the *desired state* of cloud applications. For example, in the AWS CDK, which is used to define the desired state for AWS infrastructure using CloudFormation, the lowest-level construct represents a *resource definition* in a CloudFormation template. These resources are composed to represent higher-level logical units of a cloud application, etc.
## Contributing
This project has adopted the [Amazon Open Source Code of
Conduct](https://aws.github.io/code-of-conduct).
We welcome community contributions and pull requests. See our [contribution
guide](./CONTRIBUTING.md) for more information on how to report issues, set up a
development environment and submit code.
## License
This project is distributed under the [Apache License, Version 2.0](./LICENSE).
# API Reference
## Constructs
### Construct
- *Implements:* IConstruct
Represents the building block of the construct graph.
All constructs besides the root construct must be created within the scope of
another construct.
#### Initializers
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.NewConstruct(scope Construct, id *string) Construct
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| The scope in which to define this construct. |
| id
| *string
| The scoped construct ID. |
---
##### \`scope\`Required
- *Type:* Construct
The scope in which to define this construct.
---
##### \`id\`Required
- *Type:* *string
The scoped construct ID.
Must be unique amongst siblings. If
the ID includes a path separator (\`/\`), then it will be replaced by double
dash \`--\`.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| ToString
| Returns a string representation of this construct. |
---
##### \`ToString\`
\`\`\`go
func ToString() *string
\`\`\`
Returns a string representation of this construct.
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| IsConstruct
| Checks if \`x\` is a construct. |
---
##### ~~\`IsConstruct\`~~
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.Construct_IsConstruct(x interface{}) *bool
\`\`\`
Checks if \`x\` is a construct.
###### \`x\`Required
- *Type:* interface{}
Any object.
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| Node
| The tree node. |
---
##### \`Node\`Required
\`\`\`go
func Node() Node
\`\`\`
- *Type:* Node
The tree node.
---
## Structs
### MetadataEntry
An entry in the construct metadata table.
#### Initializer
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
&constructs.MetadataEntry {
Data: interface{},
Type: *string,
Trace: *[]*string,
}
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Data
| interface{}
| The data. |
| Type
| *string
| The metadata entry type. |
| Trace
| *[]*string
| Stack trace at the point of adding the metadata. |
---
##### \`Data\`Required
\`\`\`go
Data interface{}
\`\`\`
- *Type:* interface{}
The data.
---
##### \`Type\`Required
\`\`\`go
Type *string
\`\`\`
- *Type:* *string
The metadata entry type.
---
##### \`Trace\`Optional
\`\`\`go
Trace *[]*string
\`\`\`
- *Type:* *[]*string
- *Default:* no trace information
Stack trace at the point of adding the metadata.
Only available if \`addMetadata()\` is called with \`stackTrace: true\`.
---
### MetadataOptions
Options for \`construct.addMetadata()\`.
#### Initializer
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
&constructs.MetadataOptions {
StackTrace: *bool,
TraceFromFunction: interface{},
}
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| StackTrace
| *bool
| Include stack trace with metadata entry. |
| TraceFromFunction
| interface{}
| A JavaScript function to begin tracing from. |
---
##### \`StackTrace\`Optional
\`\`\`go
StackTrace *bool
\`\`\`
- *Type:* *bool
- *Default:* false
Include stack trace with metadata entry.
---
##### \`TraceFromFunction\`Optional
\`\`\`go
TraceFromFunction interface{}
\`\`\`
- *Type:* interface{}
- *Default:* addMetadata()
A JavaScript function to begin tracing from.
This option is ignored unless \`stackTrace\` is \`true\`.
---
## Classes
### Dependable
Trait for IDependable.
Traits are interfaces that are privately implemented by objects. Instead of
showing up in the public interface of a class, they need to be queried
explicitly. This is used to implement certain framework features that are
not intended to be used by Construct consumers, and so should be hidden
from accidental use.
*Example*
\`\`\`go
// Example automatically generated from non-compiling source. May contain errors.
// Usage
roots := dependableTrait_Get(construct).dependencyRoots
// Definition
dependableTrait_Implement(construct, map[string]interface{}{
get dependencyRoots() { return []; },
})
\`\`\`
#### Initializers
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.NewDependable() Dependable
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| Get
| Return the matching Dependable for the given class instance. |
| Implement
| Turn any object into an IDependable. |
| Of
| Return the matching Dependable for the given class instance. |
---
##### ~~\`Get\`~~
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.Dependable_Get(instance IDependable) Dependable
\`\`\`
Return the matching Dependable for the given class instance.
###### \`instance\`Required
- *Type:* IDependable
---
##### \`Implement\`
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.Dependable_Implement(instance IDependable, trait Dependable)
\`\`\`
Turn any object into an IDependable.
###### \`instance\`Required
- *Type:* IDependable
---
###### \`trait\`Required
- *Type:* Dependable
---
##### \`Of\`
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.Dependable_Of(instance IDependable) Dependable
\`\`\`
Return the matching Dependable for the given class instance.
###### \`instance\`Required
- *Type:* IDependable
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| DependencyRoots
| *[]IConstruct
| The set of constructs that form the root of this dependable. |
---
##### \`DependencyRoots\`Required
\`\`\`go
func DependencyRoots() *[]IConstruct
\`\`\`
- *Type:* *[]IConstruct
The set of constructs that form the root of this dependable.
All resources under all returned constructs are included in the ordering
dependency.
---
### DependencyGroup
- *Implements:* IDependable
A set of constructs to be used as a dependable.
This class can be used when a set of constructs which are disjoint in the
construct tree needs to be combined to be used as a single dependable.
#### Initializers
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.NewDependencyGroup(deps IDependable) DependencyGroup
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| deps
| IDependable
| *No description.* |
---
##### \`deps\`Required
- *Type:* IDependable
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| Add
| Add a construct to the dependency roots. |
---
##### \`Add\`
\`\`\`go
func Add(scopes IDependable)
\`\`\`
Add a construct to the dependency roots.
###### \`scopes\`Required
- *Type:* IDependable
---
### Node
Represents the construct node in the scope tree.
#### Initializers
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.NewNode(host Construct, scope IConstruct, id *string) Node
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| host
| Construct
| *No description.* |
| scope
| IConstruct
| *No description.* |
| id
| *string
| *No description.* |
---
##### \`host\`Required
- *Type:* Construct
---
##### \`scope\`Required
- *Type:* IConstruct
---
##### \`id\`Required
- *Type:* *string
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| AddDependency
| Add an ordering dependency on another construct. |
| AddMetadata
| Adds a metadata entry to this construct. |
| AddValidation
| Adds a validation to this construct. |
| FindAll
| Return this construct and all of its children in the given order. |
| FindChild
| Return a direct child by id. |
| Lock
| Locks this construct from allowing more children to be added. |
| SetContext
| This can be used to set contextual values. |
| TryFindChild
| Return a direct child by id, or undefined. |
| TryGetContext
| Retrieves a value from tree context. |
| TryRemoveChild
| Remove the child with the given name, if present. |
| Validate
| Validates this construct. |
---
##### \`AddDependency\`
\`\`\`go
func AddDependency(deps IDependable)
\`\`\`
Add an ordering dependency on another construct.
An \`IDependable\`
###### \`deps\`Required
- *Type:* IDependable
---
##### \`AddMetadata\`
\`\`\`go
func AddMetadata(type *string, data interface{}, options MetadataOptions)
\`\`\`
Adds a metadata entry to this construct.
Entries are arbitrary values and will also include a stack trace to allow tracing back to
the code location for when the entry was added. It can be used, for example, to include source
mapping in CloudFormation templates to improve diagnostics.
###### \`type\`Required
- *Type:* *string
a string denoting the type of metadata.
---
###### \`data\`Required
- *Type:* interface{}
the value of the metadata (can be a Token).
If null/undefined, metadata will not be added.
---
###### \`options\`Optional
- *Type:* MetadataOptions
options.
---
##### \`AddValidation\`
\`\`\`go
func AddValidation(validation IValidation)
\`\`\`
Adds a validation to this construct.
When \`node.validate()\` is called, the \`validate()\` method will be called on
all validations and all errors will be returned.
###### \`validation\`Required
- *Type:* IValidation
The validation object.
---
##### \`FindAll\`
\`\`\`go
func FindAll(order ConstructOrder) *[]IConstruct
\`\`\`
Return this construct and all of its children in the given order.
###### \`order\`Optional
- *Type:* ConstructOrder
---
##### \`FindChild\`
\`\`\`go
func FindChild(id *string) IConstruct
\`\`\`
Return a direct child by id.
Throws an error if the child is not found.
###### \`id\`Required
- *Type:* *string
Identifier of direct child.
---
##### \`Lock\`
\`\`\`go
func Lock()
\`\`\`
Locks this construct from allowing more children to be added.
After this
call, no more children can be added to this construct or to any children.
##### \`SetContext\`
\`\`\`go
func SetContext(key *string, value interface{})
\`\`\`
This can be used to set contextual values.
Context must be set before any children are added, since children may consult context info during construction.
If the key already exists, it will be overridden.
###### \`key\`Required
- *Type:* *string
The context key.
---
###### \`value\`Required
- *Type:* interface{}
The context value.
---
##### \`TryFindChild\`
\`\`\`go
func TryFindChild(id *string) IConstruct
\`\`\`
Return a direct child by id, or undefined.
###### \`id\`Required
- *Type:* *string
Identifier of direct child.
---
##### \`TryGetContext\`
\`\`\`go
func TryGetContext(key *string) interface{}
\`\`\`
Retrieves a value from tree context.
Context is usually initialized at the root, but can be overridden at any point in the tree.
###### \`key\`Required
- *Type:* *string
The context key.
---
##### \`TryRemoveChild\`
\`\`\`go
func TryRemoveChild(childName *string) *bool
\`\`\`
Remove the child with the given name, if present.
###### \`childName\`Required
- *Type:* *string
---
##### \`Validate\`
\`\`\`go
func Validate() *[]*string
\`\`\`
Validates this construct.
Invokes the \`validate()\` method on all validations added through
\`addValidation()\`.
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| Of
| Returns the node associated with a construct. |
---
##### ~~\`Of\`~~
\`\`\`go
import "github.com/aws/constructs-go/constructs/v10"
constructs.Node_Of(construct IConstruct) Node
\`\`\`
Returns the node associated with a construct.
###### \`construct\`Required
- *Type:* IConstruct
the construct.
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Addr
| *string
| Returns an opaque tree-unique address for this construct. |
| Children
| *[]IConstruct
| All direct children of this construct. |
| Dependencies
| *[]IConstruct
| Return all dependencies registered on this node (non-recursive). |
| Id
| *string
| The id of this construct within the current scope. |
| Locked
| *bool
| Returns true if this construct or the scopes in which it is defined are locked. |
| Metadata
| *[]MetadataEntry
| An immutable array of metadata objects associated with this construct. |
| Path
| *string
| The full, absolute path of this construct in the tree. |
| Root
| IConstruct
| Returns the root of the construct tree. |
| Scopes
| *[]IConstruct
| All parent scopes of this construct. |
| Scope
| IConstruct
| Returns the scope in which this construct is defined. |
| DefaultChild
| IConstruct
| Returns the child construct that has the id \`Default\` or \`Resource"\`. |
---
##### \`Addr\`Required
\`\`\`go
func Addr() *string
\`\`\`
- *Type:* *string
Returns an opaque tree-unique address for this construct.
Addresses are 42 characters hexadecimal strings. They begin with "c8"
followed by 40 lowercase hexadecimal characters (0-9a-f).
Addresses are calculated using a SHA-1 of the components of the construct
path.
To enable refactorings of construct trees, constructs with the ID \`Default\`
will be excluded from the calculation. In those cases constructs in the
same tree may have the same addreess.
---
*Example*
\`\`\`go
// Example automatically generated from non-compiling source. May contain errors.
c83a2846e506bcc5f10682b564084bca2d275709ee
\`\`\`
##### \`Children\`Required
\`\`\`go
func Children() *[]IConstruct
\`\`\`
- *Type:* *[]IConstruct
All direct children of this construct.
---
##### \`Dependencies\`Required
\`\`\`go
func Dependencies() *[]IConstruct
\`\`\`
- *Type:* *[]IConstruct
Return all dependencies registered on this node (non-recursive).
---
##### \`Id\`Required
\`\`\`go
func Id() *string
\`\`\`
- *Type:* *string
The id of this construct within the current scope.
This is a a scope-unique id. To obtain an app-unique id for this construct, use \`addr\`.
---
##### \`Locked\`Required
\`\`\`go
func Locked() *bool
\`\`\`
- *Type:* *bool
Returns true if this construct or the scopes in which it is defined are locked.
---
##### \`Metadata\`Required
\`\`\`go
func Metadata() *[]MetadataEntry
\`\`\`
- *Type:* *[]MetadataEntry
An immutable array of metadata objects associated with this construct.
This can be used, for example, to implement support for deprecation notices, source mapping, etc.
---
##### \`Path\`Required
\`\`\`go
func Path() *string
\`\`\`
- *Type:* *string
The full, absolute path of this construct in the tree.
Components are separated by '/'.
---
##### \`Root\`Required
\`\`\`go
func Root() IConstruct
\`\`\`
- *Type:* IConstruct
Returns the root of the construct tree.
---
##### \`Scopes\`Required
\`\`\`go
func Scopes() *[]IConstruct
\`\`\`
- *Type:* *[]IConstruct
All parent scopes of this construct.
---
##### \`Scope\`Optional
\`\`\`go
func Scope() IConstruct
\`\`\`
- *Type:* IConstruct
Returns the scope in which this construct is defined.
The value is \`undefined\` at the root of the construct scope tree.
---
##### \`DefaultChild\`Optional
\`\`\`go
func DefaultChild() IConstruct
\`\`\`
- *Type:* IConstruct
Returns the child construct that has the id \`Default\` or \`Resource"\`.
This is usually the construct that provides the bulk of the underlying functionality.
Useful for modifications of the underlying construct that are not available at the higher levels.
Override the defaultChild property.
This should only be used in the cases where the correct
default child is not named 'Resource' or 'Default' as it
should be.
If you set this to undefined, the default behavior of finding
the child named 'Resource' or 'Default' will be used.
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| PathSep
| *string
| Separator used to delimit construct path components. |
---
##### \`PathSep\`Required
\`\`\`go
func PathSep() *string
\`\`\`
- *Type:* *string
Separator used to delimit construct path components.
---
## Protocols
### IConstruct
- *Extends:* IDependable
- *Implemented By:* Construct, IConstruct
Represents a construct.
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| Node
| Node
| The tree node. |
---
##### \`Node\`Required
\`\`\`go
func Node() Node
\`\`\`
- *Type:* Node
The tree node.
---
### IDependable
- *Implemented By:* Construct, DependencyGroup, IConstruct, IDependable
Trait marker for classes that can be depended upon.
The presence of this interface indicates that an object has
an \`IDependableTrait\` implementation.
This interface can be used to take an (ordering) dependency on a set of
constructs. An ordering dependency implies that the resources represented by
those constructs are deployed before the resources depending ON them are
deployed.
### IValidation
- *Implemented By:* IValidation
Implement this interface in order for the construct to be able to validate itself.
Implement this interface in order for the construct to be able to validate itself.
#### Methods
| **Name** | **Description** |
| --- | --- |
| Validate
| Validate the current construct. |
---
##### \`Validate\`
\`\`\`go
func Validate() *[]*string
\`\`\`
Validate the current construct.
This method can be implemented by derived constructs in order to perform
validation logic. It is called on all constructs before synthesis.
Validate the current construct.
This method can be implemented by derived constructs in order to perform
validation logic. It is called on all constructs before synthesis.
## Enums
### ConstructOrder
In what order to return constructs.
#### Members
| **Name** | **Description** |
| --- | --- |
| ConstructOrder_PREORDER
| Depth-first, pre-order. |
| ConstructOrder_POSTORDER
| Depth-first, post-order (leaf nodes first). |
---
##### \`ConstructOrder_PREORDER\`
Depth-first, pre-order.
---
##### \`ConstructOrder_POSTORDER\`
Depth-first, post-order (leaf nodes first).
---
"
`;
exports[`simple link formatter java snapshot 1`] = `
"# Amazon ECR Construct Library
---


---
This package contains constructs for working with Amazon Elastic Container Registry.
## Repositories
Define a repository by creating a new instance of \`Repository\`. A repository
holds multiple verions of a single container image.
\`\`\`java
// Example automatically generated from non-compiling source. May contain errors.
Object repository = new Repository(this, "Repository");
\`\`\`
## Image scanning
Amazon ECR image scanning helps in identifying software vulnerabilities in your container images. You can manually scan container images stored in Amazon ECR, or you can configure your repositories to scan images when you push them to a repository. To create a new repository to scan on push, simply enable \`imageScanOnPush\` in the properties
\`\`\`java
// Example automatically generated from non-compiling source. May contain errors.
Object repository = Repository.Builder.create(stack, "Repo")
.imageScanOnPush(true)
.build();
\`\`\`
To create an \`onImageScanCompleted\` event rule and trigger the event target
\`\`\`java
// Example automatically generated from non-compiling source. May contain errors.
repository.onImageScanCompleted("ImageScanComplete").addTarget(...);
\`\`\`
### Authorization Token
Besides the Amazon ECR APIs, ECR also allows the Docker CLI or a language-specific Docker library to push and pull
images from an ECR repository. However, the Docker CLI does not support native IAM authentication methods and
additional steps must be taken so that Amazon ECR can authenticate and authorize Docker push and pull requests.
More information can be found at at [Registry Authentication](https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html#registry_auth).
A Docker authorization token can be obtained using the \`GetAuthorizationToken\` ECR API. The following code snippets
grants an IAM user access to call this API.
\`\`\`java
// Example automatically generated from non-compiling source. May contain errors.
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.services.ecr.*;
User user = new User(this, "User", new UserProps()...);
AuthorizationToken.grantRead(user);
\`\`\`
If you access images in the [Public ECR Gallery](https://gallery.ecr.aws/) as well, it is recommended you authenticate to the registry to benefit from
higher rate and bandwidth limits.
> See \`Pricing\` in https://aws.amazon.com/blogs/aws/amazon-ecr-public-a-new-public-container-registry/ and [Service quotas](https://docs.aws.amazon.com/AmazonECR/latest/public/public-service-quotas.html).
The following code snippet grants an IAM user access to retrieve an authorization token for the public gallery.
\`\`\`java
// Example automatically generated from non-compiling source. May contain errors.
import software.amazon.awscdk.services.iam.*;
import software.amazon.awscdk.services.ecr.*;
User user = new User(this, "User", new UserProps()...);
PublicGalleryAuthorizationToken.grantRead(user);
\`\`\`
This user can then proceed to login to the registry using one of the [authentication methods](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth).
### Image tag immutability
You can set tag immutability on images in our repository using the \`imageTagMutability\` construct prop.
\`\`\`java
// Example automatically generated from non-compiling source. May contain errors.
Repository.Builder.create(stack, "Repo").imageTagMutability(ecr.getTagMutability().getIMMUTABLE()).build();
\`\`\`
## Automatically clean up repositories
You can set life cycle rules to automatically clean up old images from your
repository. The first life cycle rule that matches an image will be applied
against that image. For example, the following deletes images older than
30 days, while keeping all images tagged with prod (note that the order
is important here):
\`\`\`java
// Example automatically generated from non-compiling source. May contain errors.
repository.addLifecycleRule(Map.of("tagPrefixList", List.of("prod"), "maxImageCount", 9999));
repository.addLifecycleRule(Map.of("maxImageAge", cdk.Duration.days(30)));
\`\`\`
# API Reference
## Constructs
### CfnPublicRepository
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::PublicRepository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
#### Initializers
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnPublicRepository;
CfnPublicRepository.Builder.create(Construct scope, java.lang.String id)
// .repositoryCatalogData(java.lang.Object)
// .repositoryName(java.lang.String)
// .repositoryPolicyText(java.lang.Object)
// .tags(java.util.Listscope
| Construct
| - scope in which this resource is defined. |
| id
| java.lang.String
| - scoped id of the resource. |
| repositoryCatalogData
| java.lang.Object
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| repositoryName
| java.lang.String
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
| repositoryPolicyText
| java.lang.Object
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| tags
| java.util.List<CfnTag>
| \`AWS::ECR::PublicRepository.Tags\`. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* java.lang.String
scoped id of the resource.
---
##### \`repositoryCatalogData\`Optional
- *Type:* java.lang.Object
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`repositoryName\`Optional
- *Type:* java.lang.String
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
##### \`repositoryPolicyText\`Optional
- *Type:* java.lang.Object
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`tags\`Optional
- *Type:* java.util.List<CfnTag>
\`AWS::ECR::PublicRepository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| overrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| addDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| addDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| addMetadata
| Add a value to the CloudFormation Resource Metadata. |
| addOverride
| Adds an override to the synthesized CloudFormation resource. |
| addPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| addPropertyOverride
| Adds an override to a resource property. |
| applyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| getAtt
| Returns a token for an runtime attribute of this resource. |
| getMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`toString\`
\`\`\`java
public java.lang.String toString()
\`\`\`
Returns a string representation of this construct.
##### \`overrideLogicalId\`
\`\`\`java
public void overrideLogicalId(java.lang.String newLogicalId)
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`newLogicalId\`Required
- *Type:* java.lang.String
The new logical ID to use for this stack element.
---
##### \`addDeletionOverride\`
\`\`\`java
public void addDeletionOverride(java.lang.String path)
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* java.lang.String
The path of the value to delete.
---
##### \`addDependsOn\`
\`\`\`java
public void addDependsOn(CfnResource target)
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`addMetadata\`
\`\`\`java
public void addMetadata(java.lang.String key, java.lang.Object value)
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* java.lang.String
---
###### \`value\`Required
- *Type:* java.lang.Object
---
##### \`addOverride\`
\`\`\`java
public void addOverride(java.lang.String path, java.lang.Object value)
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* java.lang.String
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* java.lang.Object
The value.
Could be primitive or complex.
---
##### \`addPropertyDeletionOverride\`
\`\`\`java
public void addPropertyDeletionOverride(java.lang.String propertyPath)
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`propertyPath\`Required
- *Type:* java.lang.String
The path to the property.
---
##### \`addPropertyOverride\`
\`\`\`java
public void addPropertyOverride(java.lang.String propertyPath, java.lang.Object value)
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`propertyPath\`Required
- *Type:* java.lang.String
The path of the property.
---
###### \`value\`Required
- *Type:* java.lang.Object
The value.
---
##### \`applyRemovalPolicy\`
\`\`\`java
public void applyRemovalPolicy()
public void applyRemovalPolicy(RemovalPolicy policy)
public void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`getAtt\`
\`\`\`java
public Reference getAtt(java.lang.String attributeName)
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attributeName\`Required
- *Type:* java.lang.String
The name of the attribute.
---
##### \`getMetadata\`
\`\`\`java
public java.lang.Object getMetadata(java.lang.String key)
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* java.lang.String
---
##### \`inspect\`
\`\`\`java
public void inspect(TreeInspector inspector)
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| isCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`isConstruct\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnPublicRepository;
CfnPublicRepository.isConstruct(java.lang.Object x)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isCfnElement\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnPublicRepository;
CfnPublicRepository.isCfnElement(java.lang.Object x)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isCfnResource\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnPublicRepository;
CfnPublicRepository.isCfnResource(IConstruct construct)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creationStack
| java.util.List
| *No description.* |
| logicalId
| java.lang.String
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| java.lang.String
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfnResourceType
| java.lang.String
| AWS resource type. |
| attrArn
| java.lang.String
| *No description.* |
| tags
| TagManager
| \`AWS::ECR::PublicRepository.Tags\`. |
| repositoryCatalogData
| java.lang.Object
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| repositoryPolicyText
| java.lang.Object
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| repositoryName
| java.lang.String
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
---
##### \`node\`Required
\`\`\`java
public ConstructNode getNode();
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creationStack\`Required
\`\`\`java
public java.util.ListCFN_RESOURCE_TYPE_NAME
| java.lang.String
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`java
public java.lang.String getCfnResourceTypeName();
\`\`\`
- *Type:* java.lang.String
The CloudFormation resource type name for this resource class.
---
### CfnRegistryPolicy
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::RegistryPolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html)
#### Initializers
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRegistryPolicy;
CfnRegistryPolicy.Builder.create(Construct scope, java.lang.String id)
.policyText(java.lang.Object)
.build();
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| java.lang.String
| - scoped id of the resource. |
| policyText
| java.lang.Object
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* java.lang.String
scoped id of the resource.
---
##### \`policyText\`Required
- *Type:* java.lang.Object
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| overrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| addDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| addDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| addMetadata
| Add a value to the CloudFormation Resource Metadata. |
| addOverride
| Adds an override to the synthesized CloudFormation resource. |
| addPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| addPropertyOverride
| Adds an override to a resource property. |
| applyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| getAtt
| Returns a token for an runtime attribute of this resource. |
| getMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`toString\`
\`\`\`java
public java.lang.String toString()
\`\`\`
Returns a string representation of this construct.
##### \`overrideLogicalId\`
\`\`\`java
public void overrideLogicalId(java.lang.String newLogicalId)
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`newLogicalId\`Required
- *Type:* java.lang.String
The new logical ID to use for this stack element.
---
##### \`addDeletionOverride\`
\`\`\`java
public void addDeletionOverride(java.lang.String path)
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* java.lang.String
The path of the value to delete.
---
##### \`addDependsOn\`
\`\`\`java
public void addDependsOn(CfnResource target)
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`addMetadata\`
\`\`\`java
public void addMetadata(java.lang.String key, java.lang.Object value)
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* java.lang.String
---
###### \`value\`Required
- *Type:* java.lang.Object
---
##### \`addOverride\`
\`\`\`java
public void addOverride(java.lang.String path, java.lang.Object value)
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* java.lang.String
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* java.lang.Object
The value.
Could be primitive or complex.
---
##### \`addPropertyDeletionOverride\`
\`\`\`java
public void addPropertyDeletionOverride(java.lang.String propertyPath)
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`propertyPath\`Required
- *Type:* java.lang.String
The path to the property.
---
##### \`addPropertyOverride\`
\`\`\`java
public void addPropertyOverride(java.lang.String propertyPath, java.lang.Object value)
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`propertyPath\`Required
- *Type:* java.lang.String
The path of the property.
---
###### \`value\`Required
- *Type:* java.lang.Object
The value.
---
##### \`applyRemovalPolicy\`
\`\`\`java
public void applyRemovalPolicy()
public void applyRemovalPolicy(RemovalPolicy policy)
public void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`getAtt\`
\`\`\`java
public Reference getAtt(java.lang.String attributeName)
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attributeName\`Required
- *Type:* java.lang.String
The name of the attribute.
---
##### \`getMetadata\`
\`\`\`java
public java.lang.Object getMetadata(java.lang.String key)
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* java.lang.String
---
##### \`inspect\`
\`\`\`java
public void inspect(TreeInspector inspector)
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| isCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`isConstruct\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRegistryPolicy;
CfnRegistryPolicy.isConstruct(java.lang.Object x)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isCfnElement\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRegistryPolicy;
CfnRegistryPolicy.isCfnElement(java.lang.Object x)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isCfnResource\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRegistryPolicy;
CfnRegistryPolicy.isCfnResource(IConstruct construct)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creationStack
| java.util.List
| *No description.* |
| logicalId
| java.lang.String
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| java.lang.String
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfnResourceType
| java.lang.String
| AWS resource type. |
| attrRegistryId
| java.lang.String
| *No description.* |
| policyText
| java.lang.Object
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`node\`Required
\`\`\`java
public ConstructNode getNode();
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creationStack\`Required
\`\`\`java
public java.util.ListCFN_RESOURCE_TYPE_NAME
| java.lang.String
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`java
public java.lang.String getCfnResourceTypeName();
\`\`\`
- *Type:* java.lang.String
The CloudFormation resource type name for this resource class.
---
### CfnReplicationConfiguration
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
#### Initializers
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnReplicationConfiguration;
CfnReplicationConfiguration.Builder.create(Construct scope, java.lang.String id)
.replicationConfiguration(IResolvable)
.replicationConfiguration(ReplicationConfigurationProperty)
.build();
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| java.lang.String
| - scoped id of the resource. |
| replicationConfiguration
| IResolvable OR ReplicationConfigurationProperty
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* java.lang.String
scoped id of the resource.
---
##### \`replicationConfiguration\`Required
- *Type:* IResolvable OR ReplicationConfigurationProperty
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| overrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| addDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| addDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| addMetadata
| Add a value to the CloudFormation Resource Metadata. |
| addOverride
| Adds an override to the synthesized CloudFormation resource. |
| addPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| addPropertyOverride
| Adds an override to a resource property. |
| applyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| getAtt
| Returns a token for an runtime attribute of this resource. |
| getMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`toString\`
\`\`\`java
public java.lang.String toString()
\`\`\`
Returns a string representation of this construct.
##### \`overrideLogicalId\`
\`\`\`java
public void overrideLogicalId(java.lang.String newLogicalId)
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`newLogicalId\`Required
- *Type:* java.lang.String
The new logical ID to use for this stack element.
---
##### \`addDeletionOverride\`
\`\`\`java
public void addDeletionOverride(java.lang.String path)
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* java.lang.String
The path of the value to delete.
---
##### \`addDependsOn\`
\`\`\`java
public void addDependsOn(CfnResource target)
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`addMetadata\`
\`\`\`java
public void addMetadata(java.lang.String key, java.lang.Object value)
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* java.lang.String
---
###### \`value\`Required
- *Type:* java.lang.Object
---
##### \`addOverride\`
\`\`\`java
public void addOverride(java.lang.String path, java.lang.Object value)
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* java.lang.String
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* java.lang.Object
The value.
Could be primitive or complex.
---
##### \`addPropertyDeletionOverride\`
\`\`\`java
public void addPropertyDeletionOverride(java.lang.String propertyPath)
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`propertyPath\`Required
- *Type:* java.lang.String
The path to the property.
---
##### \`addPropertyOverride\`
\`\`\`java
public void addPropertyOverride(java.lang.String propertyPath, java.lang.Object value)
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`propertyPath\`Required
- *Type:* java.lang.String
The path of the property.
---
###### \`value\`Required
- *Type:* java.lang.Object
The value.
---
##### \`applyRemovalPolicy\`
\`\`\`java
public void applyRemovalPolicy()
public void applyRemovalPolicy(RemovalPolicy policy)
public void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`getAtt\`
\`\`\`java
public Reference getAtt(java.lang.String attributeName)
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attributeName\`Required
- *Type:* java.lang.String
The name of the attribute.
---
##### \`getMetadata\`
\`\`\`java
public java.lang.Object getMetadata(java.lang.String key)
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* java.lang.String
---
##### \`inspect\`
\`\`\`java
public void inspect(TreeInspector inspector)
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| isCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`isConstruct\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnReplicationConfiguration;
CfnReplicationConfiguration.isConstruct(java.lang.Object x)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isCfnElement\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnReplicationConfiguration;
CfnReplicationConfiguration.isCfnElement(java.lang.Object x)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isCfnResource\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnReplicationConfiguration;
CfnReplicationConfiguration.isCfnResource(IConstruct construct)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creationStack
| java.util.List
| *No description.* |
| logicalId
| java.lang.String
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| java.lang.String
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfnResourceType
| java.lang.String
| AWS resource type. |
| attrRegistryId
| java.lang.String
| *No description.* |
| replicationConfiguration
| IResolvable OR ReplicationConfigurationProperty
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`node\`Required
\`\`\`java
public ConstructNode getNode();
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creationStack\`Required
\`\`\`java
public java.util.ListCFN_RESOURCE_TYPE_NAME
| java.lang.String
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`java
public java.lang.String getCfnResourceTypeName();
\`\`\`
- *Type:* java.lang.String
The CloudFormation resource type name for this resource class.
---
### CfnRepository
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::Repository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
#### Initializers
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRepository;
CfnRepository.Builder.create(Construct scope, java.lang.String id)
// .encryptionConfiguration(java.lang.Object)
// .imageScanningConfiguration(java.lang.Object)
// .imageTagMutability(java.lang.String)
// .lifecyclePolicy(IResolvable)
// .lifecyclePolicy(LifecyclePolicyProperty)
// .repositoryName(java.lang.String)
// .repositoryPolicyText(java.lang.Object)
// .tags(java.util.Listscope
| Construct
| - scope in which this resource is defined. |
| id
| java.lang.String
| - scoped id of the resource. |
| encryptionConfiguration
| java.lang.Object
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| imageScanningConfiguration
| java.lang.Object
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| imageTagMutability
| java.lang.String
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| lifecyclePolicy
| IResolvable OR LifecyclePolicyProperty
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| repositoryName
| java.lang.String
| \`AWS::ECR::Repository.RepositoryName\`. |
| repositoryPolicyText
| java.lang.Object
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| tags
| java.util.List<CfnTag>
| \`AWS::ECR::Repository.Tags\`. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* java.lang.String
scoped id of the resource.
---
##### \`encryptionConfiguration\`Optional
- *Type:* java.lang.Object
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`imageScanningConfiguration\`Optional
- *Type:* java.lang.Object
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`imageTagMutability\`Optional
- *Type:* java.lang.String
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`lifecyclePolicy\`Optional
- *Type:* IResolvable OR LifecyclePolicyProperty
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`repositoryName\`Optional
- *Type:* java.lang.String
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
##### \`repositoryPolicyText\`Optional
- *Type:* java.lang.Object
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`tags\`Optional
- *Type:* java.util.List<CfnTag>
\`AWS::ECR::Repository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| overrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| addDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| addDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| addMetadata
| Add a value to the CloudFormation Resource Metadata. |
| addOverride
| Adds an override to the synthesized CloudFormation resource. |
| addPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| addPropertyOverride
| Adds an override to a resource property. |
| applyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| getAtt
| Returns a token for an runtime attribute of this resource. |
| getMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`toString\`
\`\`\`java
public java.lang.String toString()
\`\`\`
Returns a string representation of this construct.
##### \`overrideLogicalId\`
\`\`\`java
public void overrideLogicalId(java.lang.String newLogicalId)
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`newLogicalId\`Required
- *Type:* java.lang.String
The new logical ID to use for this stack element.
---
##### \`addDeletionOverride\`
\`\`\`java
public void addDeletionOverride(java.lang.String path)
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* java.lang.String
The path of the value to delete.
---
##### \`addDependsOn\`
\`\`\`java
public void addDependsOn(CfnResource target)
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`addMetadata\`
\`\`\`java
public void addMetadata(java.lang.String key, java.lang.Object value)
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* java.lang.String
---
###### \`value\`Required
- *Type:* java.lang.Object
---
##### \`addOverride\`
\`\`\`java
public void addOverride(java.lang.String path, java.lang.Object value)
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* java.lang.String
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* java.lang.Object
The value.
Could be primitive or complex.
---
##### \`addPropertyDeletionOverride\`
\`\`\`java
public void addPropertyDeletionOverride(java.lang.String propertyPath)
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`propertyPath\`Required
- *Type:* java.lang.String
The path to the property.
---
##### \`addPropertyOverride\`
\`\`\`java
public void addPropertyOverride(java.lang.String propertyPath, java.lang.Object value)
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`propertyPath\`Required
- *Type:* java.lang.String
The path of the property.
---
###### \`value\`Required
- *Type:* java.lang.Object
The value.
---
##### \`applyRemovalPolicy\`
\`\`\`java
public void applyRemovalPolicy()
public void applyRemovalPolicy(RemovalPolicy policy)
public void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`getAtt\`
\`\`\`java
public Reference getAtt(java.lang.String attributeName)
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attributeName\`Required
- *Type:* java.lang.String
The name of the attribute.
---
##### \`getMetadata\`
\`\`\`java
public java.lang.Object getMetadata(java.lang.String key)
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* java.lang.String
---
##### \`inspect\`
\`\`\`java
public void inspect(TreeInspector inspector)
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| isCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`isConstruct\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRepository;
CfnRepository.isConstruct(java.lang.Object x)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isCfnElement\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRepository;
CfnRepository.isCfnElement(java.lang.Object x)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isCfnResource\`
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRepository;
CfnRepository.isCfnResource(IConstruct construct)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creationStack
| java.util.List
| *No description.* |
| logicalId
| java.lang.String
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| java.lang.String
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfnResourceType
| java.lang.String
| AWS resource type. |
| attrArn
| java.lang.String
| *No description.* |
| attrRepositoryUri
| java.lang.String
| *No description.* |
| tags
| TagManager
| \`AWS::ECR::Repository.Tags\`. |
| encryptionConfiguration
| java.lang.Object
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| imageScanningConfiguration
| java.lang.Object
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| repositoryPolicyText
| java.lang.Object
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| imageTagMutability
| java.lang.String
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| lifecyclePolicy
| IResolvable OR LifecyclePolicyProperty
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| repositoryName
| java.lang.String
| \`AWS::ECR::Repository.RepositoryName\`. |
---
##### \`node\`Required
\`\`\`java
public ConstructNode getNode();
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creationStack\`Required
\`\`\`java
public java.util.ListCFN_RESOURCE_TYPE_NAME
| java.lang.String
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`java
public java.lang.String getCfnResourceTypeName();
\`\`\`
- *Type:* java.lang.String
The CloudFormation resource type name for this resource class.
---
### Repository
Define an ECR repository.
#### Initializers
\`\`\`java
import software.amazon.awscdk.services.ecr.Repository;
Repository.Builder.create(Construct scope, java.lang.String id)
// .imageScanOnPush(java.lang.Boolean)
// .imageTagMutability(TagMutability)
// .lifecycleRegistryId(java.lang.String)
// .lifecycleRules(java.util.Listscope
| Construct
| *No description.* |
| id
| java.lang.String
| *No description.* |
| imageScanOnPush
| java.lang.Boolean
| Enable the scan on push when creating the repository. |
| imageTagMutability
| TagMutability
| The tag mutability setting for the repository. |
| lifecycleRegistryId
| java.lang.String
| The AWS account ID associated with the registry that contains the repository. |
| lifecycleRules
| java.util.List<LifecycleRule>
| Life cycle rules to apply to this registry. |
| removalPolicy
| RemovalPolicy
| Determine what happens to the repository when the resource/stack is deleted. |
| repositoryName
| java.lang.String
| Name for this repository. |
---
##### \`scope\`Required
- *Type:* Construct
---
##### \`id\`Required
- *Type:* java.lang.String
---
##### \`imageScanOnPush\`Optional
- *Type:* java.lang.Boolean
- *Default:* false
Enable the scan on push when creating the repository.
---
##### \`imageTagMutability\`Optional
- *Type:* TagMutability
- *Default:* TagMutability.MUTABLE
The tag mutability setting for the repository.
If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten.
---
##### \`lifecycleRegistryId\`Optional
- *Type:* java.lang.String
- *Default:* The default registry is assumed.
The AWS account ID associated with the registry that contains the repository.
> [https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html](https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html)
---
##### \`lifecycleRules\`Optional
- *Type:* java.util.List<LifecycleRule>
- *Default:* No life cycle rules
Life cycle rules to apply to this registry.
---
##### \`removalPolicy\`Optional
- *Type:* RemovalPolicy
- *Default:* RemovalPolicy.Retain
Determine what happens to the repository when the resource/stack is deleted.
---
##### \`repositoryName\`Optional
- *Type:* java.lang.String
- *Default:* Automatically generated name.
Name for this repository.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| applyRemovalPolicy
| Apply the given removal policy to this resource. |
| addToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grantPull
| Grant the given identity permissions to use the images in this repository. |
| grantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| onCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| onCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| onEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| onImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed. |
| repositoryUriForDigest
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| repositoryUriForTag
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| addLifecycleRule
| Add a life cycle rule to the repository. |
---
##### \`toString\`
\`\`\`java
public java.lang.String toString()
\`\`\`
Returns a string representation of this construct.
##### \`applyRemovalPolicy\`
\`\`\`java
public void applyRemovalPolicy(RemovalPolicy policy)
\`\`\`
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (\`RemovalPolicy.DELETE\`), or left in your AWS
account for data recovery and cleanup later (\`RemovalPolicy.RETAIN\`).
###### \`policy\`Required
- *Type:* RemovalPolicy
---
##### \`addToResourcePolicy\`
\`\`\`java
public AddToResourcePolicyResult addToResourcePolicy(PolicyStatement statement)
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`java
public Grant grant(IGrantable grantee, java.lang.String actions)
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* java.lang.String
---
##### \`grantPull\`
\`\`\`java
public Grant grantPull(IGrantable grantee)
\`\`\`
Grant the given identity permissions to use the images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grantPullPush\`
\`\`\`java
public Grant grantPullPush(IGrantable grantee)
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`onCloudTrailEvent\`
\`\`\`java
public Rule onCloudTrailEvent(java.lang.String id)
public Rule onCloudTrailEvent(java.lang.String id, 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.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`onCloudTrailImagePushed\`
\`\`\`java
public Rule onCloudTrailImagePushed(java.lang.String id)
public Rule onCloudTrailImagePushed(java.lang.String id, 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.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`onEvent\`
\`\`\`java
public Rule onEvent(java.lang.String id)
public Rule onEvent(java.lang.String id, OnEventOptions options)
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* java.lang.String
---
###### \`options\`Optional
- *Type:* OnEventOptions
---
##### \`onImageScanCompleted\`
\`\`\`java
public Rule onImageScanCompleted(java.lang.String id)
public Rule onImageScanCompleted(java.lang.String id, OnImageScanCompletedOptions options)
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`repositoryUriForDigest\`
\`\`\`java
public java.lang.String repositoryUriForDigest()
public java.lang.String repositoryUriForDigest(java.lang.String digest)
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* java.lang.String
Optional image digest.
---
##### \`repositoryUriForTag\`
\`\`\`java
public java.lang.String repositoryUriForTag()
public java.lang.String repositoryUriForTag(java.lang.String tag)
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
###### \`tag\`Optional
- *Type:* java.lang.String
Optional image tag.
---
##### \`addLifecycleRule\`
\`\`\`java
public void addLifecycleRule(LifecycleRule rule)
\`\`\`
Add a life cycle rule to the repository.
Life cycle rules automatically expire images from the repository that match
certain conditions.
###### \`rule\`Required
- *Type:* LifecycleRule
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isResource
| Check whether the given construct is a Resource. |
| arnForLocalRepository
| Returns an ECR ARN for a repository that resides in the same account/region as the current stack. |
| fromRepositoryArn
| *No description.* |
| fromRepositoryAttributes
| Import a repository. |
| fromRepositoryName
| *No description.* |
---
##### \`isConstruct\`
\`\`\`java
import software.amazon.awscdk.services.ecr.Repository;
Repository.isConstruct(java.lang.Object x)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isResource\`
\`\`\`java
import software.amazon.awscdk.services.ecr.Repository;
Repository.isResource(IConstruct construct)
\`\`\`
Check whether the given construct is a Resource.
###### \`construct\`Required
- *Type:* IConstruct
---
##### \`arnForLocalRepository\`
\`\`\`java
import software.amazon.awscdk.services.ecr.Repository;
Repository.arnForLocalRepository(java.lang.String repositoryName, IConstruct scope),Repository.arnForLocalRepository(java.lang.String repositoryName, IConstruct scope, java.lang.String account)
\`\`\`
Returns an ECR ARN for a repository that resides in the same account/region as the current stack.
###### \`repositoryName\`Required
- *Type:* java.lang.String
---
###### \`scope\`Required
- *Type:* IConstruct
---
###### \`account\`Optional
- *Type:* java.lang.String
---
##### \`fromRepositoryArn\`
\`\`\`java
import software.amazon.awscdk.services.ecr.Repository;
Repository.fromRepositoryArn(Construct scope, java.lang.String id, java.lang.String repositoryArn)
\`\`\`
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* java.lang.String
---
###### \`repositoryArn\`Required
- *Type:* java.lang.String
---
##### \`fromRepositoryAttributes\`
\`\`\`java
import software.amazon.awscdk.services.ecr.Repository;
Repository.fromRepositoryAttributes(Construct scope, java.lang.String id, RepositoryAttributes attrs)
\`\`\`
Import a repository.
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* java.lang.String
---
###### \`attrs\`Required
- *Type:* RepositoryAttributes
---
##### \`fromRepositoryName\`
\`\`\`java
import software.amazon.awscdk.services.ecr.Repository;
Repository.fromRepositoryName(Construct scope, java.lang.String id, java.lang.String repositoryName)
\`\`\`
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* java.lang.String
---
###### \`repositoryName\`Required
- *Type:* java.lang.String
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repositoryArn
| java.lang.String
| The ARN of the repository. |
| repositoryName
| java.lang.String
| The name of the repository. |
| repositoryUri
| java.lang.String
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`java
public ConstructNode getNode();
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`env\`Required
\`\`\`java
public ResourceEnvironment getEnv();
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`java
public Stack getStack();
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repositoryArn\`Required
\`\`\`java
public java.lang.String getRepositoryArn();
\`\`\`
- *Type:* java.lang.String
The ARN of the repository.
---
##### \`repositoryName\`Required
\`\`\`java
public java.lang.String getRepositoryName();
\`\`\`
- *Type:* java.lang.String
The name of the repository.
---
##### \`repositoryUri\`Required
\`\`\`java
public java.lang.String getRepositoryUri();
\`\`\`
- *Type:* java.lang.String
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
### RepositoryBase
- *Implements:* IRepository
Base class for ECR repository.
Reused between imported repositories and owned repositories.
#### Initializers
\`\`\`java
import software.amazon.awscdk.services.ecr.RepositoryBase;
RepositoryBase.Builder.create(Construct scope, java.lang.String id)
// .account(java.lang.String)
// .environmentFromArn(java.lang.String)
// .physicalName(java.lang.String)
// .region(java.lang.String)
.build();
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| *No description.* |
| id
| java.lang.String
| *No description.* |
| account
| java.lang.String
| The AWS account ID this resource belongs to. |
| environmentFromArn
| java.lang.String
| ARN to deduce region and account from. |
| physicalName
| java.lang.String
| The value passed in by users to the physical name prop of the resource. |
| region
| java.lang.String
| The AWS region this resource belongs to. |
---
##### \`scope\`Required
- *Type:* Construct
---
##### \`id\`Required
- *Type:* java.lang.String
---
##### \`account\`Optional
- *Type:* java.lang.String
- *Default:* the resource is in the same account as the stack it belongs to
The AWS account ID this resource belongs to.
---
##### \`environmentFromArn\`Optional
- *Type:* java.lang.String
- *Default:* take environment from \`account\`, \`region\` parameters, or use Stack environment.
ARN to deduce region and account from.
The ARN is parsed and the account and region are taken from the ARN.
This should be used for imported resources.
Cannot be supplied together with either \`account\` or \`region\`.
---
##### \`physicalName\`Optional
- *Type:* java.lang.String
- *Default:* The physical name will be allocated by CloudFormation at deployment time
The value passed in by users to the physical name prop of the resource.
\`undefined\` implies that a physical name will be allocated by
CloudFormation during deployment.
- a concrete value implies a specific physical name
- \`PhysicalName.GENERATE_IF_NEEDED\` is a marker that indicates that a physical will only be generated
by the CDK if it is needed for cross-environment references. Otherwise, it will be allocated by CloudFormation.
---
##### \`region\`Optional
- *Type:* java.lang.String
- *Default:* the resource is in the same region as the stack it belongs to
The AWS region this resource belongs to.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| applyRemovalPolicy
| Apply the given removal policy to this resource. |
| addToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grantPull
| Grant the given identity permissions to use the images in this repository. |
| grantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| onCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| onCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| onEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| onImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed. |
| repositoryUriForDigest
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| repositoryUriForTag
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
---
##### \`toString\`
\`\`\`java
public java.lang.String toString()
\`\`\`
Returns a string representation of this construct.
##### \`applyRemovalPolicy\`
\`\`\`java
public void applyRemovalPolicy(RemovalPolicy policy)
\`\`\`
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (\`RemovalPolicy.DELETE\`), or left in your AWS
account for data recovery and cleanup later (\`RemovalPolicy.RETAIN\`).
###### \`policy\`Required
- *Type:* RemovalPolicy
---
##### \`addToResourcePolicy\`
\`\`\`java
public AddToResourcePolicyResult addToResourcePolicy(PolicyStatement statement)
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`java
public Grant grant(IGrantable grantee, java.lang.String actions)
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* java.lang.String
---
##### \`grantPull\`
\`\`\`java
public Grant grantPull(IGrantable grantee)
\`\`\`
Grant the given identity permissions to use the images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grantPullPush\`
\`\`\`java
public Grant grantPullPush(IGrantable grantee)
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`onCloudTrailEvent\`
\`\`\`java
public Rule onCloudTrailEvent(java.lang.String id)
public Rule onCloudTrailEvent(java.lang.String id, 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.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`onCloudTrailImagePushed\`
\`\`\`java
public Rule onCloudTrailImagePushed(java.lang.String id)
public Rule onCloudTrailImagePushed(java.lang.String id, 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.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`onEvent\`
\`\`\`java
public Rule onEvent(java.lang.String id)
public Rule onEvent(java.lang.String id, OnEventOptions options)
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* java.lang.String
---
###### \`options\`Optional
- *Type:* OnEventOptions
---
##### \`onImageScanCompleted\`
\`\`\`java
public Rule onImageScanCompleted(java.lang.String id)
public Rule onImageScanCompleted(java.lang.String id, OnImageScanCompletedOptions options)
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`repositoryUriForDigest\`
\`\`\`java
public java.lang.String repositoryUriForDigest()
public java.lang.String repositoryUriForDigest(java.lang.String digest)
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* java.lang.String
Optional image digest.
---
##### \`repositoryUriForTag\`
\`\`\`java
public java.lang.String repositoryUriForTag()
public java.lang.String repositoryUriForTag(java.lang.String tag)
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
###### \`tag\`Optional
- *Type:* java.lang.String
Optional image tag.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isResource
| Check whether the given construct is a Resource. |
---
##### \`isConstruct\`
\`\`\`java
import software.amazon.awscdk.services.ecr.RepositoryBase;
RepositoryBase.isConstruct(java.lang.Object x)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* java.lang.Object
---
##### \`isResource\`
\`\`\`java
import software.amazon.awscdk.services.ecr.RepositoryBase;
RepositoryBase.isResource(IConstruct construct)
\`\`\`
Check whether the given construct is a Resource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repositoryArn
| java.lang.String
| The ARN of the repository. |
| repositoryName
| java.lang.String
| The name of the repository. |
| repositoryUri
| java.lang.String
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`java
public ConstructNode getNode();
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`env\`Required
\`\`\`java
public ResourceEnvironment getEnv();
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`java
public Stack getStack();
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repositoryArn\`Required
\`\`\`java
public java.lang.String getRepositoryArn();
\`\`\`
- *Type:* java.lang.String
The ARN of the repository.
---
##### \`repositoryName\`Required
\`\`\`java
public java.lang.String getRepositoryName();
\`\`\`
- *Type:* java.lang.String
The name of the repository.
---
##### \`repositoryUri\`Required
\`\`\`java
public java.lang.String getRepositoryUri();
\`\`\`
- *Type:* java.lang.String
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
## Structs
### CfnPublicRepositoryProps
Properties for defining a \`AWS::ECR::PublicRepository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnPublicRepositoryProps;
CfnPublicRepositoryProps.builder()
// .repositoryCatalogData(java.lang.Object)
// .repositoryName(java.lang.String)
// .repositoryPolicyText(java.lang.Object)
// .tags(java.util.ListrepositoryCatalogData
| java.lang.Object
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| repositoryName
| java.lang.String
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
| repositoryPolicyText
| java.lang.Object
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| tags
| java.util.List<CfnTag>
| \`AWS::ECR::PublicRepository.Tags\`. |
---
##### \`repositoryCatalogData\`Optional
\`\`\`java
public java.lang.Object getRepositoryCatalogData();
\`\`\`
- *Type:* java.lang.Object
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`repositoryName\`Optional
\`\`\`java
public java.lang.String getRepositoryName();
\`\`\`
- *Type:* java.lang.String
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
##### \`repositoryPolicyText\`Optional
\`\`\`java
public java.lang.Object getRepositoryPolicyText();
\`\`\`
- *Type:* java.lang.Object
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`tags\`Optional
\`\`\`java
public java.util.ListpolicyText
| java.lang.Object
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`policyText\`Required
\`\`\`java
public java.lang.Object getPolicyText();
\`\`\`
- *Type:* java.lang.Object
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
### CfnReplicationConfigurationProps
Properties for defining a \`AWS::ECR::ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnReplicationConfigurationProps;
CfnReplicationConfigurationProps.builder()
.replicationConfiguration(IResolvable)
.replicationConfiguration(ReplicationConfigurationProperty)
.build();
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| replicationConfiguration
| IResolvable OR ReplicationConfigurationProperty
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`replicationConfiguration\`Required
\`\`\`java
public java.lang.Object getReplicationConfiguration();
\`\`\`
- *Type:* IResolvable OR ReplicationConfigurationProperty
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
### CfnRepositoryProps
Properties for defining a \`AWS::ECR::Repository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnRepositoryProps;
CfnRepositoryProps.builder()
// .encryptionConfiguration(java.lang.Object)
// .imageScanningConfiguration(java.lang.Object)
// .imageTagMutability(java.lang.String)
// .lifecyclePolicy(IResolvable)
// .lifecyclePolicy(LifecyclePolicyProperty)
// .repositoryName(java.lang.String)
// .repositoryPolicyText(java.lang.Object)
// .tags(java.util.ListencryptionConfiguration
| java.lang.Object
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| imageScanningConfiguration
| java.lang.Object
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| imageTagMutability
| java.lang.String
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| lifecyclePolicy
| IResolvable OR LifecyclePolicyProperty
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| repositoryName
| java.lang.String
| \`AWS::ECR::Repository.RepositoryName\`. |
| repositoryPolicyText
| java.lang.Object
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| tags
| java.util.List<CfnTag>
| \`AWS::ECR::Repository.Tags\`. |
---
##### \`encryptionConfiguration\`Optional
\`\`\`java
public java.lang.Object getEncryptionConfiguration();
\`\`\`
- *Type:* java.lang.Object
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`imageScanningConfiguration\`Optional
\`\`\`java
public java.lang.Object getImageScanningConfiguration();
\`\`\`
- *Type:* java.lang.Object
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`imageTagMutability\`Optional
\`\`\`java
public java.lang.String getImageTagMutability();
\`\`\`
- *Type:* java.lang.String
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`lifecyclePolicy\`Optional
\`\`\`java
public java.lang.Object getLifecyclePolicy();
\`\`\`
- *Type:* IResolvable OR LifecyclePolicyProperty
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`repositoryName\`Optional
\`\`\`java
public java.lang.String getRepositoryName();
\`\`\`
- *Type:* java.lang.String
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
##### \`repositoryPolicyText\`Optional
\`\`\`java
public java.lang.Object getRepositoryPolicyText();
\`\`\`
- *Type:* java.lang.Object
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`tags\`Optional
\`\`\`java
public java.util.ListlifecyclePolicyText
| java.lang.String
| \`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`. |
| registryId
| java.lang.String
| \`CfnRepository.LifecyclePolicyProperty.RegistryId\`. |
---
##### \`lifecyclePolicyText\`Optional
\`\`\`java
public java.lang.String getLifecyclePolicyText();
\`\`\`
- *Type:* java.lang.String
\`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext)
---
##### \`registryId\`Optional
\`\`\`java
public java.lang.String getRegistryId();
\`\`\`
- *Type:* java.lang.String
\`CfnRepository.LifecyclePolicyProperty.RegistryId\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid)
---
### LifecycleRule
An ECR life cycle rule.
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.LifecycleRule;
LifecycleRule.builder()
// .description(java.lang.String)
// .maxImageAge(Duration)
// .maxImageCount(java.lang.Number)
// .rulePriority(java.lang.Number)
// .tagPrefixList(java.util.Listdescription
| java.lang.String
| Describes the purpose of the rule. |
| maxImageAge
| Duration
| The maximum age of images to retain. The value must represent a number of days. |
| maxImageCount
| java.lang.Number
| The maximum number of images to retain. |
| rulePriority
| java.lang.Number
| Controls the order in which rules are evaluated (low to high). |
| tagPrefixList
| java.util.List
| Select images that have ALL the given prefixes in their tag. |
| tagStatus
| TagStatus
| Select images based on tags. |
---
##### \`description\`Optional
\`\`\`java
public java.lang.String getDescription();
\`\`\`
- *Type:* java.lang.String
- *Default:* No description
Describes the purpose of the rule.
---
##### \`maxImageAge\`Optional
\`\`\`java
public Duration getMaxImageAge();
\`\`\`
- *Type:* Duration
The maximum age of images to retain. The value must represent a number of days.
Specify exactly one of maxImageCount and maxImageAge.
---
##### \`maxImageCount\`Optional
\`\`\`java
public java.lang.Number getMaxImageCount();
\`\`\`
- *Type:* java.lang.Number
The maximum number of images to retain.
Specify exactly one of maxImageCount and maxImageAge.
---
##### \`rulePriority\`Optional
\`\`\`java
public java.lang.Number getRulePriority();
\`\`\`
- *Type:* java.lang.Number
- *Default:* Automatically assigned
Controls the order in which rules are evaluated (low to high).
All rules must have a unique priority, where lower numbers have
higher precedence. The first rule that matches is applied to an image.
There can only be one rule with a tagStatus of Any, and it must have
the highest rulePriority.
All rules without a specified priority will have incrementing priorities
automatically assigned to them, higher than any rules that DO have priorities.
---
##### \`tagPrefixList\`Optional
\`\`\`java
public java.util.Listdescription
| java.lang.String
| A description of the rule's purpose. |
| eventPattern
| EventPattern
| Additional restrictions for the event to route to the specified target. |
| ruleName
| java.lang.String
| A name for the rule. |
| target
| IRuleTarget
| The target to register for the event. |
| imageTag
| java.lang.String
| Only watch changes to this image tag. |
---
##### \`description\`Optional
\`\`\`java
public java.lang.String getDescription();
\`\`\`
- *Type:* java.lang.String
- *Default:* No description
A description of the rule's purpose.
---
##### \`eventPattern\`Optional
\`\`\`java
public EventPattern getEventPattern();
\`\`\`
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
##### \`ruleName\`Optional
\`\`\`java
public java.lang.String getRuleName();
\`\`\`
- *Type:* java.lang.String
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
##### \`target\`Optional
\`\`\`java
public IRuleTarget getTarget();
\`\`\`
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`imageTag\`Optional
\`\`\`java
public java.lang.String getImageTag();
\`\`\`
- *Type:* java.lang.String
- *Default:* Watch changes to all tags
Only watch changes to this image tag.
---
### OnImageScanCompletedOptions
Options for the OnImageScanCompleted method.
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.OnImageScanCompletedOptions;
OnImageScanCompletedOptions.builder()
// .description(java.lang.String)
// .eventPattern(EventPattern)
// .ruleName(java.lang.String)
// .target(IRuleTarget)
// .imageTags(java.util.Listdescription
| java.lang.String
| A description of the rule's purpose. |
| eventPattern
| EventPattern
| Additional restrictions for the event to route to the specified target. |
| ruleName
| java.lang.String
| A name for the rule. |
| target
| IRuleTarget
| The target to register for the event. |
| imageTags
| java.util.List
| Only watch changes to the image tags spedified. |
---
##### \`description\`Optional
\`\`\`java
public java.lang.String getDescription();
\`\`\`
- *Type:* java.lang.String
- *Default:* No description
A description of the rule's purpose.
---
##### \`eventPattern\`Optional
\`\`\`java
public EventPattern getEventPattern();
\`\`\`
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
##### \`ruleName\`Optional
\`\`\`java
public java.lang.String getRuleName();
\`\`\`
- *Type:* java.lang.String
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
##### \`target\`Optional
\`\`\`java
public IRuleTarget getTarget();
\`\`\`
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`imageTags\`Optional
\`\`\`java
public java.util.Listrules
| IResolvable OR java.util.List<IResolvable OR ReplicationRuleProperty>
| \`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`. |
---
##### \`rules\`Required
\`\`\`java
public java.lang.Object getRules();
\`\`\`
- *Type:* IResolvable OR java.util.List<IResolvable OR ReplicationRuleProperty>
\`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules)
---
### ReplicationDestinationProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html)
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnReplicationConfiguration.ReplicationDestinationProperty;
ReplicationDestinationProperty.builder()
.region(java.lang.String)
.registryId(java.lang.String)
.build();
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| region
| java.lang.String
| \`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`. |
| registryId
| java.lang.String
| \`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`. |
---
##### \`region\`Required
\`\`\`java
public java.lang.String getRegion();
\`\`\`
- *Type:* java.lang.String
\`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region)
---
##### \`registryId\`Required
\`\`\`java
public java.lang.String getRegistryId();
\`\`\`
- *Type:* java.lang.String
\`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid)
---
### ReplicationRuleProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html)
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.CfnReplicationConfiguration.ReplicationRuleProperty;
ReplicationRuleProperty.builder()
.destinations(IResolvable)
.destinations(java.util.Listdestinations
| IResolvable OR java.util.List<IResolvable OR ReplicationDestinationProperty>
| \`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`. |
---
##### \`destinations\`Required
\`\`\`java
public java.lang.Object getDestinations();
\`\`\`
- *Type:* IResolvable OR java.util.List<IResolvable OR ReplicationDestinationProperty>
\`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations)
---
### RepositoryAttributes
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.RepositoryAttributes;
RepositoryAttributes.builder()
.repositoryArn(java.lang.String)
.repositoryName(java.lang.String)
.build();
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| repositoryArn
| java.lang.String
| *No description.* |
| repositoryName
| java.lang.String
| *No description.* |
---
##### \`repositoryArn\`Required
\`\`\`java
public java.lang.String getRepositoryArn();
\`\`\`
- *Type:* java.lang.String
---
##### \`repositoryName\`Required
\`\`\`java
public java.lang.String getRepositoryName();
\`\`\`
- *Type:* java.lang.String
---
### RepositoryProps
#### Initializer
\`\`\`java
import software.amazon.awscdk.services.ecr.RepositoryProps;
RepositoryProps.builder()
// .imageScanOnPush(java.lang.Boolean)
// .imageTagMutability(TagMutability)
// .lifecycleRegistryId(java.lang.String)
// .lifecycleRules(java.util.ListimageScanOnPush
| java.lang.Boolean
| Enable the scan on push when creating the repository. |
| imageTagMutability
| TagMutability
| The tag mutability setting for the repository. |
| lifecycleRegistryId
| java.lang.String
| The AWS account ID associated with the registry that contains the repository. |
| lifecycleRules
| java.util.List<LifecycleRule>
| Life cycle rules to apply to this registry. |
| removalPolicy
| RemovalPolicy
| Determine what happens to the repository when the resource/stack is deleted. |
| repositoryName
| java.lang.String
| Name for this repository. |
---
##### \`imageScanOnPush\`Optional
\`\`\`java
public java.lang.Boolean getImageScanOnPush();
\`\`\`
- *Type:* java.lang.Boolean
- *Default:* false
Enable the scan on push when creating the repository.
---
##### \`imageTagMutability\`Optional
\`\`\`java
public TagMutability getImageTagMutability();
\`\`\`
- *Type:* TagMutability
- *Default:* TagMutability.MUTABLE
The tag mutability setting for the repository.
If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten.
---
##### \`lifecycleRegistryId\`Optional
\`\`\`java
public java.lang.String getLifecycleRegistryId();
\`\`\`
- *Type:* java.lang.String
- *Default:* The default registry is assumed.
The AWS account ID associated with the registry that contains the repository.
> [https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html](https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html)
---
##### \`lifecycleRules\`Optional
\`\`\`java
public java.util.ListgrantRead
| Grant access to retrieve an authorization token. |
---
##### \`grantRead\`
\`\`\`java
import software.amazon.awscdk.services.ecr.AuthorizationToken;
AuthorizationToken.grantRead(IGrantable grantee)
\`\`\`
Grant access to retrieve an authorization token.
###### \`grantee\`Required
- *Type:* IGrantable
---
### PublicGalleryAuthorizationToken
Authorization token to access the global public ECR Gallery via Docker CLI.
> [https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth)
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| grantRead
| Grant access to retrieve an authorization token. |
---
##### \`grantRead\`
\`\`\`java
import software.amazon.awscdk.services.ecr.PublicGalleryAuthorizationToken;
PublicGalleryAuthorizationToken.grantRead(IGrantable grantee)
\`\`\`
Grant access to retrieve an authorization token.
###### \`grantee\`Required
- *Type:* IGrantable
---
## Protocols
### IRepository
- *Extends:* IResource
- *Implemented By:* Repository, RepositoryBase, IRepository
Represents an ECR repository.
#### Methods
| **Name** | **Description** |
| --- | --- |
| addToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grantPull
| Grant the given identity permissions to pull images in this repository. |
| grantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| onCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| onCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| onEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| onImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed. |
| repositoryUriForDigest
| Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`. |
| repositoryUriForTag
| Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`. |
---
##### \`addToResourcePolicy\`
\`\`\`java
public AddToResourcePolicyResult addToResourcePolicy(PolicyStatement statement)
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`java
public Grant grant(IGrantable grantee, java.lang.String actions)
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* java.lang.String
---
##### \`grantPull\`
\`\`\`java
public Grant grantPull(IGrantable grantee)
\`\`\`
Grant the given identity permissions to pull images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grantPullPush\`
\`\`\`java
public Grant grantPullPush(IGrantable grantee)
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`onCloudTrailEvent\`
\`\`\`java
public Rule onCloudTrailEvent(java.lang.String id)
public Rule onCloudTrailEvent(java.lang.String id, 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.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`onCloudTrailImagePushed\`
\`\`\`java
public Rule onCloudTrailImagePushed(java.lang.String id)
public Rule onCloudTrailImagePushed(java.lang.String id, 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.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`onEvent\`
\`\`\`java
public Rule onEvent(java.lang.String id)
public Rule onEvent(java.lang.String id, OnEventOptions options)
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* java.lang.String
---
###### \`options\`Optional
- *Type:* OnEventOptions
---
##### \`onImageScanCompleted\`
\`\`\`java
public Rule onImageScanCompleted(java.lang.String id)
public Rule onImageScanCompleted(java.lang.String id, OnImageScanCompletedOptions options)
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed.
###### \`id\`Required
- *Type:* java.lang.String
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`repositoryUriForDigest\`
\`\`\`java
public java.lang.String repositoryUriForDigest()
public java.lang.String repositoryUriForDigest(java.lang.String digest)
\`\`\`
Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* java.lang.String
Image digest to use (tools usually default to the image with the "latest" tag if omitted).
---
##### \`repositoryUriForTag\`
\`\`\`java
public java.lang.String repositoryUriForTag()
public java.lang.String repositoryUriForTag(java.lang.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]
###### \`tag\`Optional
- *Type:* java.lang.String
Image tag to use (tools usually default to "latest" if omitted).
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node for this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repositoryArn
| java.lang.String
| The ARN of the repository. |
| repositoryName
| java.lang.String
| The name of the repository. |
| repositoryUri
| java.lang.String
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`java
public ConstructNode getNode();
\`\`\`
- *Type:* ConstructNode
The construct tree node for this construct.
---
##### \`env\`Required
\`\`\`java
public ResourceEnvironment getEnv();
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`java
public Stack getStack();
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repositoryArn\`Required
\`\`\`java
public java.lang.String getRepositoryArn();
\`\`\`
- *Type:* java.lang.String
The ARN of the repository.
---
##### \`repositoryName\`Required
\`\`\`java
public java.lang.String getRepositoryName();
\`\`\`
- *Type:* java.lang.String
The name of the repository.
---
##### \`repositoryUri\`Required
\`\`\`java
public java.lang.String getRepositoryUri();
\`\`\`
- *Type:* java.lang.String
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
## Enums
### TagMutability
The tag mutability setting for your repository.
#### Members
| **Name** | **Description** |
| --- | --- |
| MUTABLE
| allow image tags to be overwritten. |
| IMMUTABLE
| all image tags within the repository will be immutable which will prevent them from being overwritten. |
---
##### \`MUTABLE\`
allow image tags to be overwritten.
---
##### \`IMMUTABLE\`
all image tags within the repository will be immutable which will prevent them from being overwritten.
---
### TagStatus
Select images based on tags.
#### Members
| **Name** | **Description** |
| --- | --- |
| ANY
| Rule applies to all images. |
| TAGGED
| Rule applies to tagged images. |
| UNTAGGED
| Rule applies to untagged images. |
---
##### \`ANY\`
Rule applies to all images.
---
##### \`TAGGED\`
Rule applies to tagged images.
---
##### \`UNTAGGED\`
Rule applies to untagged images.
---
"
`;
exports[`simple link formatter python snapshot 1`] = `
"# Amazon ECR Construct Library
---


---
This package contains constructs for working with Amazon Elastic Container Registry.
## Repositories
Define a repository by creating a new instance of \`Repository\`. A repository
holds multiple verions of a single container image.
\`\`\`python
# Example automatically generated from non-compiling source. May contain errors.
repository = ecr.Repository(self, "Repository")
\`\`\`
## Image scanning
Amazon ECR image scanning helps in identifying software vulnerabilities in your container images. You can manually scan container images stored in Amazon ECR, or you can configure your repositories to scan images when you push them to a repository. To create a new repository to scan on push, simply enable \`imageScanOnPush\` in the properties
\`\`\`python
# Example automatically generated from non-compiling source. May contain errors.
repository = ecr.Repository(stack, "Repo",
image_scan_on_push=True
)
\`\`\`
To create an \`onImageScanCompleted\` event rule and trigger the event target
\`\`\`python
# Example automatically generated from non-compiling source. May contain errors.
repository.on_image_scan_completed("ImageScanComplete").add_target(...)
\`\`\`
### Authorization Token
Besides the Amazon ECR APIs, ECR also allows the Docker CLI or a language-specific Docker library to push and pull
images from an ECR repository. However, the Docker CLI does not support native IAM authentication methods and
additional steps must be taken so that Amazon ECR can authenticate and authorize Docker push and pull requests.
More information can be found at at [Registry Authentication](https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html#registry_auth).
A Docker authorization token can be obtained using the \`GetAuthorizationToken\` ECR API. The following code snippets
grants an IAM user access to call this API.
\`\`\`python
# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.aws_iam as iam
import aws_cdk.aws_ecr as ecr
user = iam.User(self, "User", ...)
ecr.AuthorizationToken.grant_read(user)
\`\`\`
If you access images in the [Public ECR Gallery](https://gallery.ecr.aws/) as well, it is recommended you authenticate to the registry to benefit from
higher rate and bandwidth limits.
> See \`Pricing\` in https://aws.amazon.com/blogs/aws/amazon-ecr-public-a-new-public-container-registry/ and [Service quotas](https://docs.aws.amazon.com/AmazonECR/latest/public/public-service-quotas.html).
The following code snippet grants an IAM user access to retrieve an authorization token for the public gallery.
\`\`\`python
# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.aws_iam as iam
import aws_cdk.aws_ecr as ecr
user = iam.User(self, "User", ...)
ecr.PublicGalleryAuthorizationToken.grant_read(user)
\`\`\`
This user can then proceed to login to the registry using one of the [authentication methods](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth).
### Image tag immutability
You can set tag immutability on images in our repository using the \`imageTagMutability\` construct prop.
\`\`\`python
# Example automatically generated from non-compiling source. May contain errors.
ecr.Repository(stack, "Repo", image_tag_mutability=ecr.TagMutability.IMMUTABLE)
\`\`\`
## Automatically clean up repositories
You can set life cycle rules to automatically clean up old images from your
repository. The first life cycle rule that matches an image will be applied
against that image. For example, the following deletes images older than
30 days, while keeping all images tagged with prod (note that the order
is important here):
\`\`\`python
# Example automatically generated from non-compiling source. May contain errors.
repository.add_lifecycle_rule(tag_prefix_list=["prod"], max_image_count=9999)
repository.add_lifecycle_rule(max_image_age=cdk.Duration.days(30))
\`\`\`
# API Reference
## Constructs
### CfnPublicRepository
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::PublicRepository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
#### Initializers
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnPublicRepository(
scope: Construct,
id: str,
repository_catalog_data: typing.Any = None,
repository_name: str = None,
repository_policy_text: typing.Any = None,
tags: typing.List[CfnTag] = None
)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| str
| - scoped id of the resource. |
| repository_catalog_data
| typing.Any
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| repository_name
| str
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
| repository_policy_text
| typing.Any
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| tags
| typing.List[CfnTag]
| \`AWS::ECR::PublicRepository.Tags\`. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* str
scoped id of the resource.
---
##### \`repository_catalog_data\`Optional
- *Type:* typing.Any
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`repository_name\`Optional
- *Type:* str
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
##### \`repository_policy_text\`Optional
- *Type:* typing.Any
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`tags\`Optional
- *Type:* typing.List[CfnTag]
\`AWS::ECR::PublicRepository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| to_string
| Returns a string representation of this construct. |
| override_logical_id
| Overrides the auto-generated logical ID with a specific ID. |
| add_deletion_override
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| add_depends_on
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| add_metadata
| Add a value to the CloudFormation Resource Metadata. |
| add_override
| Adds an override to the synthesized CloudFormation resource. |
| add_property_deletion_override
| Adds an override that deletes the value of a property from the resource definition. |
| add_property_override
| Adds an override to a resource property. |
| apply_removal_policy
| Sets the deletion policy of the resource based on the removal policy specified. |
| get_att
| Returns a token for an runtime attribute of this resource. |
| get_metadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`to_string\`
\`\`\`python
def to_string() -> str
\`\`\`
Returns a string representation of this construct.
##### \`override_logical_id\`
\`\`\`python
def override_logical_id(
new_logical_id: str
) -> None
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`new_logical_id\`Required
- *Type:* str
The new logical ID to use for this stack element.
---
##### \`add_deletion_override\`
\`\`\`python
def add_deletion_override(
path: str
) -> None
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* str
The path of the value to delete.
---
##### \`add_depends_on\`
\`\`\`python
def add_depends_on(
target: CfnResource
) -> None
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`add_metadata\`
\`\`\`python
def add_metadata(
key: str,
value: typing.Any
) -> None
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* str
---
###### \`value\`Required
- *Type:* typing.Any
---
##### \`add_override\`
\`\`\`python
def add_override(
path: str,
value: typing.Any
) -> None
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* str
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* typing.Any
The value.
Could be primitive or complex.
---
##### \`add_property_deletion_override\`
\`\`\`python
def add_property_deletion_override(
property_path: str
) -> None
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`property_path\`Required
- *Type:* str
The path to the property.
---
##### \`add_property_override\`
\`\`\`python
def add_property_override(
property_path: str,
value: typing.Any
) -> None
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`property_path\`Required
- *Type:* str
The path of the property.
---
###### \`value\`Required
- *Type:* typing.Any
The value.
---
##### \`apply_removal_policy\`
\`\`\`python
def apply_removal_policy(
policy: RemovalPolicy = None,
apply_to_update_replace_policy: bool = None,
default: RemovalPolicy = None
) -> None
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`apply_to_update_replace_policy\`Optional
- *Type:* bool
- *Default:* true
Apply the same deletion policy to the resource's "UpdateReplacePolicy".
---
###### \`default\`Optional
- *Type:* RemovalPolicy
- *Default:* Default value is resource specific. To determine the default value for a resoure, please consult that specific resource's documentation.
The default policy to apply in case the removal policy is not defined.
---
##### \`get_att\`
\`\`\`python
def get_att(
attribute_name: str
) -> Reference
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attribute_name\`Required
- *Type:* str
The name of the attribute.
---
##### \`get_metadata\`
\`\`\`python
def get_metadata(
key: str
) -> typing.Any
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* str
---
##### \`inspect\`
\`\`\`python
def inspect(
inspector: TreeInspector
) -> None
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| is_construct
| Return whether the given object is a Construct. |
| is_cfn_element
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| is_cfn_resource
| Check whether the given construct is a CfnResource. |
---
##### \`is_construct\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnPublicRepository.is_construct(
x: typing.Any
)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_cfn_element\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnPublicRepository.is_cfn_element(
x: typing.Any
)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_cfn_resource\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnPublicRepository.is_cfn_resource(
construct: IConstruct
)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creation_stack
| typing.List[str]
| *No description.* |
| logical_id
| str
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| str
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfn_options
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfn_resource_type
| str
| AWS resource type. |
| attr_arn
| str
| *No description.* |
| tags
| TagManager
| \`AWS::ECR::PublicRepository.Tags\`. |
| repository_catalog_data
| typing.Any
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| repository_policy_text
| typing.Any
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| repository_name
| str
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
---
##### \`node\`Required
\`\`\`python
node: ConstructNode
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creation_stack\`Required
\`\`\`python
creation_stack: typing.List[str]
\`\`\`
- *Type:* typing.List[str]
---
##### \`logical_id\`Required
\`\`\`python
logical_id: str
\`\`\`
- *Type:* str
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`stack\`Required
\`\`\`python
stack: Stack
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`ref\`Required
\`\`\`python
ref: str
\`\`\`
- *Type:* str
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`cfn_options\`Required
\`\`\`python
cfn_options: ICfnResourceOptions
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`cfn_resource_type\`Required
\`\`\`python
cfn_resource_type: str
\`\`\`
- *Type:* str
AWS resource type.
---
##### \`attr_arn\`Required
\`\`\`python
attr_arn: str
\`\`\`
- *Type:* str
---
##### \`tags\`Required
\`\`\`python
tags: TagManager
\`\`\`
- *Type:* TagManager
\`AWS::ECR::PublicRepository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
---
##### \`repository_catalog_data\`Required
\`\`\`python
repository_catalog_data: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`repository_policy_text\`Required
\`\`\`python
repository_policy_text: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`repository_name\`Optional
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CFN_RESOURCE_TYPE_NAME
| str
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`python
CFN_RESOURCE_TYPE_NAME: str
\`\`\`
- *Type:* str
The CloudFormation resource type name for this resource class.
---
### CfnRegistryPolicy
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::RegistryPolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html)
#### Initializers
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRegistryPolicy(
scope: Construct,
id: str,
policy_text: typing.Any
)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| str
| - scoped id of the resource. |
| policy_text
| typing.Any
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* str
scoped id of the resource.
---
##### \`policy_text\`Required
- *Type:* typing.Any
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| to_string
| Returns a string representation of this construct. |
| override_logical_id
| Overrides the auto-generated logical ID with a specific ID. |
| add_deletion_override
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| add_depends_on
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| add_metadata
| Add a value to the CloudFormation Resource Metadata. |
| add_override
| Adds an override to the synthesized CloudFormation resource. |
| add_property_deletion_override
| Adds an override that deletes the value of a property from the resource definition. |
| add_property_override
| Adds an override to a resource property. |
| apply_removal_policy
| Sets the deletion policy of the resource based on the removal policy specified. |
| get_att
| Returns a token for an runtime attribute of this resource. |
| get_metadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`to_string\`
\`\`\`python
def to_string() -> str
\`\`\`
Returns a string representation of this construct.
##### \`override_logical_id\`
\`\`\`python
def override_logical_id(
new_logical_id: str
) -> None
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`new_logical_id\`Required
- *Type:* str
The new logical ID to use for this stack element.
---
##### \`add_deletion_override\`
\`\`\`python
def add_deletion_override(
path: str
) -> None
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* str
The path of the value to delete.
---
##### \`add_depends_on\`
\`\`\`python
def add_depends_on(
target: CfnResource
) -> None
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`add_metadata\`
\`\`\`python
def add_metadata(
key: str,
value: typing.Any
) -> None
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* str
---
###### \`value\`Required
- *Type:* typing.Any
---
##### \`add_override\`
\`\`\`python
def add_override(
path: str,
value: typing.Any
) -> None
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* str
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* typing.Any
The value.
Could be primitive or complex.
---
##### \`add_property_deletion_override\`
\`\`\`python
def add_property_deletion_override(
property_path: str
) -> None
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`property_path\`Required
- *Type:* str
The path to the property.
---
##### \`add_property_override\`
\`\`\`python
def add_property_override(
property_path: str,
value: typing.Any
) -> None
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`property_path\`Required
- *Type:* str
The path of the property.
---
###### \`value\`Required
- *Type:* typing.Any
The value.
---
##### \`apply_removal_policy\`
\`\`\`python
def apply_removal_policy(
policy: RemovalPolicy = None,
apply_to_update_replace_policy: bool = None,
default: RemovalPolicy = None
) -> None
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`apply_to_update_replace_policy\`Optional
- *Type:* bool
- *Default:* true
Apply the same deletion policy to the resource's "UpdateReplacePolicy".
---
###### \`default\`Optional
- *Type:* RemovalPolicy
- *Default:* Default value is resource specific. To determine the default value for a resoure, please consult that specific resource's documentation.
The default policy to apply in case the removal policy is not defined.
---
##### \`get_att\`
\`\`\`python
def get_att(
attribute_name: str
) -> Reference
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attribute_name\`Required
- *Type:* str
The name of the attribute.
---
##### \`get_metadata\`
\`\`\`python
def get_metadata(
key: str
) -> typing.Any
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* str
---
##### \`inspect\`
\`\`\`python
def inspect(
inspector: TreeInspector
) -> None
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| is_construct
| Return whether the given object is a Construct. |
| is_cfn_element
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| is_cfn_resource
| Check whether the given construct is a CfnResource. |
---
##### \`is_construct\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRegistryPolicy.is_construct(
x: typing.Any
)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_cfn_element\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRegistryPolicy.is_cfn_element(
x: typing.Any
)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_cfn_resource\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRegistryPolicy.is_cfn_resource(
construct: IConstruct
)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creation_stack
| typing.List[str]
| *No description.* |
| logical_id
| str
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| str
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfn_options
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfn_resource_type
| str
| AWS resource type. |
| attr_registry_id
| str
| *No description.* |
| policy_text
| typing.Any
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`node\`Required
\`\`\`python
node: ConstructNode
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creation_stack\`Required
\`\`\`python
creation_stack: typing.List[str]
\`\`\`
- *Type:* typing.List[str]
---
##### \`logical_id\`Required
\`\`\`python
logical_id: str
\`\`\`
- *Type:* str
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`stack\`Required
\`\`\`python
stack: Stack
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`ref\`Required
\`\`\`python
ref: str
\`\`\`
- *Type:* str
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`cfn_options\`Required
\`\`\`python
cfn_options: ICfnResourceOptions
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`cfn_resource_type\`Required
\`\`\`python
cfn_resource_type: str
\`\`\`
- *Type:* str
AWS resource type.
---
##### \`attr_registry_id\`Required
\`\`\`python
attr_registry_id: str
\`\`\`
- *Type:* str
---
##### \`policy_text\`Required
\`\`\`python
policy_text: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CFN_RESOURCE_TYPE_NAME
| str
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`python
CFN_RESOURCE_TYPE_NAME: str
\`\`\`
- *Type:* str
The CloudFormation resource type name for this resource class.
---
### CfnReplicationConfiguration
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
#### Initializers
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnReplicationConfiguration(
scope: Construct,
id: str,
replication_configuration: typing.Union[IResolvable, ReplicationConfigurationProperty]
)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| str
| - scoped id of the resource. |
| replication_configuration
| typing.Union[IResolvable, ReplicationConfigurationProperty]
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* str
scoped id of the resource.
---
##### \`replication_configuration\`Required
- *Type:* typing.Union[IResolvable, ReplicationConfigurationProperty]
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| to_string
| Returns a string representation of this construct. |
| override_logical_id
| Overrides the auto-generated logical ID with a specific ID. |
| add_deletion_override
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| add_depends_on
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| add_metadata
| Add a value to the CloudFormation Resource Metadata. |
| add_override
| Adds an override to the synthesized CloudFormation resource. |
| add_property_deletion_override
| Adds an override that deletes the value of a property from the resource definition. |
| add_property_override
| Adds an override to a resource property. |
| apply_removal_policy
| Sets the deletion policy of the resource based on the removal policy specified. |
| get_att
| Returns a token for an runtime attribute of this resource. |
| get_metadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`to_string\`
\`\`\`python
def to_string() -> str
\`\`\`
Returns a string representation of this construct.
##### \`override_logical_id\`
\`\`\`python
def override_logical_id(
new_logical_id: str
) -> None
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`new_logical_id\`Required
- *Type:* str
The new logical ID to use for this stack element.
---
##### \`add_deletion_override\`
\`\`\`python
def add_deletion_override(
path: str
) -> None
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* str
The path of the value to delete.
---
##### \`add_depends_on\`
\`\`\`python
def add_depends_on(
target: CfnResource
) -> None
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`add_metadata\`
\`\`\`python
def add_metadata(
key: str,
value: typing.Any
) -> None
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* str
---
###### \`value\`Required
- *Type:* typing.Any
---
##### \`add_override\`
\`\`\`python
def add_override(
path: str,
value: typing.Any
) -> None
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* str
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* typing.Any
The value.
Could be primitive or complex.
---
##### \`add_property_deletion_override\`
\`\`\`python
def add_property_deletion_override(
property_path: str
) -> None
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`property_path\`Required
- *Type:* str
The path to the property.
---
##### \`add_property_override\`
\`\`\`python
def add_property_override(
property_path: str,
value: typing.Any
) -> None
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`property_path\`Required
- *Type:* str
The path of the property.
---
###### \`value\`Required
- *Type:* typing.Any
The value.
---
##### \`apply_removal_policy\`
\`\`\`python
def apply_removal_policy(
policy: RemovalPolicy = None,
apply_to_update_replace_policy: bool = None,
default: RemovalPolicy = None
) -> None
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`apply_to_update_replace_policy\`Optional
- *Type:* bool
- *Default:* true
Apply the same deletion policy to the resource's "UpdateReplacePolicy".
---
###### \`default\`Optional
- *Type:* RemovalPolicy
- *Default:* Default value is resource specific. To determine the default value for a resoure, please consult that specific resource's documentation.
The default policy to apply in case the removal policy is not defined.
---
##### \`get_att\`
\`\`\`python
def get_att(
attribute_name: str
) -> Reference
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attribute_name\`Required
- *Type:* str
The name of the attribute.
---
##### \`get_metadata\`
\`\`\`python
def get_metadata(
key: str
) -> typing.Any
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* str
---
##### \`inspect\`
\`\`\`python
def inspect(
inspector: TreeInspector
) -> None
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| is_construct
| Return whether the given object is a Construct. |
| is_cfn_element
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| is_cfn_resource
| Check whether the given construct is a CfnResource. |
---
##### \`is_construct\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnReplicationConfiguration.is_construct(
x: typing.Any
)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_cfn_element\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnReplicationConfiguration.is_cfn_element(
x: typing.Any
)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_cfn_resource\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnReplicationConfiguration.is_cfn_resource(
construct: IConstruct
)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creation_stack
| typing.List[str]
| *No description.* |
| logical_id
| str
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| str
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfn_options
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfn_resource_type
| str
| AWS resource type. |
| attr_registry_id
| str
| *No description.* |
| replication_configuration
| typing.Union[IResolvable, ReplicationConfigurationProperty]
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`node\`Required
\`\`\`python
node: ConstructNode
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creation_stack\`Required
\`\`\`python
creation_stack: typing.List[str]
\`\`\`
- *Type:* typing.List[str]
---
##### \`logical_id\`Required
\`\`\`python
logical_id: str
\`\`\`
- *Type:* str
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`stack\`Required
\`\`\`python
stack: Stack
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`ref\`Required
\`\`\`python
ref: str
\`\`\`
- *Type:* str
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`cfn_options\`Required
\`\`\`python
cfn_options: ICfnResourceOptions
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`cfn_resource_type\`Required
\`\`\`python
cfn_resource_type: str
\`\`\`
- *Type:* str
AWS resource type.
---
##### \`attr_registry_id\`Required
\`\`\`python
attr_registry_id: str
\`\`\`
- *Type:* str
---
##### \`replication_configuration\`Required
\`\`\`python
replication_configuration: typing.Union[IResolvable, ReplicationConfigurationProperty]
\`\`\`
- *Type:* typing.Union[IResolvable, ReplicationConfigurationProperty]
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CFN_RESOURCE_TYPE_NAME
| str
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`python
CFN_RESOURCE_TYPE_NAME: str
\`\`\`
- *Type:* str
The CloudFormation resource type name for this resource class.
---
### CfnRepository
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::Repository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
#### Initializers
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRepository(
scope: Construct,
id: str,
encryption_configuration: typing.Any = None,
image_scanning_configuration: typing.Any = None,
image_tag_mutability: str = None,
lifecycle_policy: typing.Union[IResolvable, LifecyclePolicyProperty] = None,
repository_name: str = None,
repository_policy_text: typing.Any = None,
tags: typing.List[CfnTag] = None
)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| str
| - scoped id of the resource. |
| encryption_configuration
| typing.Any
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| image_scanning_configuration
| typing.Any
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| image_tag_mutability
| str
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| lifecycle_policy
| typing.Union[IResolvable, LifecyclePolicyProperty]
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| repository_name
| str
| \`AWS::ECR::Repository.RepositoryName\`. |
| repository_policy_text
| typing.Any
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| tags
| typing.List[CfnTag]
| \`AWS::ECR::Repository.Tags\`. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* str
scoped id of the resource.
---
##### \`encryption_configuration\`Optional
- *Type:* typing.Any
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`image_scanning_configuration\`Optional
- *Type:* typing.Any
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`image_tag_mutability\`Optional
- *Type:* str
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`lifecycle_policy\`Optional
- *Type:* typing.Union[IResolvable, LifecyclePolicyProperty]
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`repository_name\`Optional
- *Type:* str
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
##### \`repository_policy_text\`Optional
- *Type:* typing.Any
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`tags\`Optional
- *Type:* typing.List[CfnTag]
\`AWS::ECR::Repository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| to_string
| Returns a string representation of this construct. |
| override_logical_id
| Overrides the auto-generated logical ID with a specific ID. |
| add_deletion_override
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| add_depends_on
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| add_metadata
| Add a value to the CloudFormation Resource Metadata. |
| add_override
| Adds an override to the synthesized CloudFormation resource. |
| add_property_deletion_override
| Adds an override that deletes the value of a property from the resource definition. |
| add_property_override
| Adds an override to a resource property. |
| apply_removal_policy
| Sets the deletion policy of the resource based on the removal policy specified. |
| get_att
| Returns a token for an runtime attribute of this resource. |
| get_metadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`to_string\`
\`\`\`python
def to_string() -> str
\`\`\`
Returns a string representation of this construct.
##### \`override_logical_id\`
\`\`\`python
def override_logical_id(
new_logical_id: str
) -> None
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`new_logical_id\`Required
- *Type:* str
The new logical ID to use for this stack element.
---
##### \`add_deletion_override\`
\`\`\`python
def add_deletion_override(
path: str
) -> None
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* str
The path of the value to delete.
---
##### \`add_depends_on\`
\`\`\`python
def add_depends_on(
target: CfnResource
) -> None
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`add_metadata\`
\`\`\`python
def add_metadata(
key: str,
value: typing.Any
) -> None
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* str
---
###### \`value\`Required
- *Type:* typing.Any
---
##### \`add_override\`
\`\`\`python
def add_override(
path: str,
value: typing.Any
) -> None
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* str
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* typing.Any
The value.
Could be primitive or complex.
---
##### \`add_property_deletion_override\`
\`\`\`python
def add_property_deletion_override(
property_path: str
) -> None
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`property_path\`Required
- *Type:* str
The path to the property.
---
##### \`add_property_override\`
\`\`\`python
def add_property_override(
property_path: str,
value: typing.Any
) -> None
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`property_path\`Required
- *Type:* str
The path of the property.
---
###### \`value\`Required
- *Type:* typing.Any
The value.
---
##### \`apply_removal_policy\`
\`\`\`python
def apply_removal_policy(
policy: RemovalPolicy = None,
apply_to_update_replace_policy: bool = None,
default: RemovalPolicy = None
) -> None
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`apply_to_update_replace_policy\`Optional
- *Type:* bool
- *Default:* true
Apply the same deletion policy to the resource's "UpdateReplacePolicy".
---
###### \`default\`Optional
- *Type:* RemovalPolicy
- *Default:* Default value is resource specific. To determine the default value for a resoure, please consult that specific resource's documentation.
The default policy to apply in case the removal policy is not defined.
---
##### \`get_att\`
\`\`\`python
def get_att(
attribute_name: str
) -> Reference
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attribute_name\`Required
- *Type:* str
The name of the attribute.
---
##### \`get_metadata\`
\`\`\`python
def get_metadata(
key: str
) -> typing.Any
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* str
---
##### \`inspect\`
\`\`\`python
def inspect(
inspector: TreeInspector
) -> None
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| is_construct
| Return whether the given object is a Construct. |
| is_cfn_element
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| is_cfn_resource
| Check whether the given construct is a CfnResource. |
---
##### \`is_construct\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRepository.is_construct(
x: typing.Any
)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_cfn_element\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRepository.is_cfn_element(
x: typing.Any
)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_cfn_resource\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRepository.is_cfn_resource(
construct: IConstruct
)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creation_stack
| typing.List[str]
| *No description.* |
| logical_id
| str
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| str
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfn_options
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfn_resource_type
| str
| AWS resource type. |
| attr_arn
| str
| *No description.* |
| attr_repository_uri
| str
| *No description.* |
| tags
| TagManager
| \`AWS::ECR::Repository.Tags\`. |
| encryption_configuration
| typing.Any
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| image_scanning_configuration
| typing.Any
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| repository_policy_text
| typing.Any
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| image_tag_mutability
| str
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| lifecycle_policy
| typing.Union[IResolvable, LifecyclePolicyProperty]
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| repository_name
| str
| \`AWS::ECR::Repository.RepositoryName\`. |
---
##### \`node\`Required
\`\`\`python
node: ConstructNode
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creation_stack\`Required
\`\`\`python
creation_stack: typing.List[str]
\`\`\`
- *Type:* typing.List[str]
---
##### \`logical_id\`Required
\`\`\`python
logical_id: str
\`\`\`
- *Type:* str
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`stack\`Required
\`\`\`python
stack: Stack
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`ref\`Required
\`\`\`python
ref: str
\`\`\`
- *Type:* str
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`cfn_options\`Required
\`\`\`python
cfn_options: ICfnResourceOptions
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`cfn_resource_type\`Required
\`\`\`python
cfn_resource_type: str
\`\`\`
- *Type:* str
AWS resource type.
---
##### \`attr_arn\`Required
\`\`\`python
attr_arn: str
\`\`\`
- *Type:* str
---
##### \`attr_repository_uri\`Required
\`\`\`python
attr_repository_uri: str
\`\`\`
- *Type:* str
---
##### \`tags\`Required
\`\`\`python
tags: TagManager
\`\`\`
- *Type:* TagManager
\`AWS::ECR::Repository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
---
##### \`encryption_configuration\`Required
\`\`\`python
encryption_configuration: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`image_scanning_configuration\`Required
\`\`\`python
image_scanning_configuration: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`repository_policy_text\`Required
\`\`\`python
repository_policy_text: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`image_tag_mutability\`Optional
\`\`\`python
image_tag_mutability: str
\`\`\`
- *Type:* str
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`lifecycle_policy\`Optional
\`\`\`python
lifecycle_policy: typing.Union[IResolvable, LifecyclePolicyProperty]
\`\`\`
- *Type:* typing.Union[IResolvable, LifecyclePolicyProperty]
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`repository_name\`Optional
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CFN_RESOURCE_TYPE_NAME
| str
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`python
CFN_RESOURCE_TYPE_NAME: str
\`\`\`
- *Type:* str
The CloudFormation resource type name for this resource class.
---
### Repository
Define an ECR repository.
#### Initializers
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.Repository(
scope: Construct,
id: str,
image_scan_on_push: bool = None,
image_tag_mutability: TagMutability = None,
lifecycle_registry_id: str = None,
lifecycle_rules: typing.List[LifecycleRule] = None,
removal_policy: RemovalPolicy = None,
repository_name: str = None
)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| *No description.* |
| id
| str
| *No description.* |
| image_scan_on_push
| bool
| Enable the scan on push when creating the repository. |
| image_tag_mutability
| TagMutability
| The tag mutability setting for the repository. |
| lifecycle_registry_id
| str
| The AWS account ID associated with the registry that contains the repository. |
| lifecycle_rules
| typing.List[LifecycleRule]
| Life cycle rules to apply to this registry. |
| removal_policy
| RemovalPolicy
| Determine what happens to the repository when the resource/stack is deleted. |
| repository_name
| str
| Name for this repository. |
---
##### \`scope\`Required
- *Type:* Construct
---
##### \`id\`Required
- *Type:* str
---
##### \`image_scan_on_push\`Optional
- *Type:* bool
- *Default:* false
Enable the scan on push when creating the repository.
---
##### \`image_tag_mutability\`Optional
- *Type:* TagMutability
- *Default:* TagMutability.MUTABLE
The tag mutability setting for the repository.
If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten.
---
##### \`lifecycle_registry_id\`Optional
- *Type:* str
- *Default:* The default registry is assumed.
The AWS account ID associated with the registry that contains the repository.
> [https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html](https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html)
---
##### \`lifecycle_rules\`Optional
- *Type:* typing.List[LifecycleRule]
- *Default:* No life cycle rules
Life cycle rules to apply to this registry.
---
##### \`removal_policy\`Optional
- *Type:* RemovalPolicy
- *Default:* RemovalPolicy.Retain
Determine what happens to the repository when the resource/stack is deleted.
---
##### \`repository_name\`Optional
- *Type:* str
- *Default:* Automatically generated name.
Name for this repository.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| to_string
| Returns a string representation of this construct. |
| apply_removal_policy
| Apply the given removal policy to this resource. |
| add_to_resource_policy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grant_pull
| Grant the given identity permissions to use the images in this repository. |
| grant_pull_push
| Grant the given identity permissions to pull and push images to this repository. |
| on_cloud_trail_event
| Define a CloudWatch event that triggers when something happens to this repository. |
| on_cloud_trail_image_pushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| on_event
| Defines a CloudWatch event rule which triggers for repository events. |
| on_image_scan_completed
| Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed. |
| repository_uri_for_digest
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| repository_uri_for_tag
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| add_lifecycle_rule
| Add a life cycle rule to the repository. |
---
##### \`to_string\`
\`\`\`python
def to_string() -> str
\`\`\`
Returns a string representation of this construct.
##### \`apply_removal_policy\`
\`\`\`python
def apply_removal_policy(
policy: RemovalPolicy
) -> None
\`\`\`
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (\`RemovalPolicy.DELETE\`), or left in your AWS
account for data recovery and cleanup later (\`RemovalPolicy.RETAIN\`).
###### \`policy\`Required
- *Type:* RemovalPolicy
---
##### \`add_to_resource_policy\`
\`\`\`python
def add_to_resource_policy(
statement: PolicyStatement
) -> AddToResourcePolicyResult
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`python
def grant(
grantee: IGrantable,
actions: str
) -> Grant
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* str
---
##### \`grant_pull\`
\`\`\`python
def grant_pull(
grantee: IGrantable
) -> Grant
\`\`\`
Grant the given identity permissions to use the images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grant_pull_push\`
\`\`\`python
def grant_pull_push(
grantee: IGrantable
) -> Grant
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`on_cloud_trail_event\`
\`\`\`python
def on_cloud_trail_event(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None
) -> Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`on_cloud_trail_image_pushed\`
\`\`\`python
def on_cloud_trail_image_pushed(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None,
image_tag: str = None
) -> Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
###### \`image_tag\`Optional
- *Type:* str
- *Default:* Watch changes to all tags
Only watch changes to this image tag.
---
##### \`on_event\`
\`\`\`python
def on_event(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None
) -> Rule
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* str
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`on_image_scan_completed\`
\`\`\`python
def on_image_scan_completed(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None,
image_tags: typing.List[str] = None
) -> Rule
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
###### \`image_tags\`Optional
- *Type:* typing.List[str]
- *Default:* Watch the changes to the repository with all image tags
Only watch changes to the image tags spedified.
Leave it undefined to watch the full repository.
---
##### \`repository_uri_for_digest\`
\`\`\`python
def repository_uri_for_digest(
digest: str = None
) -> str
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* str
Optional image digest.
---
##### \`repository_uri_for_tag\`
\`\`\`python
def repository_uri_for_tag(
tag: str = None
) -> str
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
###### \`tag\`Optional
- *Type:* str
Optional image tag.
---
##### \`add_lifecycle_rule\`
\`\`\`python
def add_lifecycle_rule(
description: str = None,
max_image_age: Duration = None,
max_image_count: typing.Union[int, float] = None,
rule_priority: typing.Union[int, float] = None,
tag_prefix_list: typing.List[str] = None,
tag_status: TagStatus = None
) -> None
\`\`\`
Add a life cycle rule to the repository.
Life cycle rules automatically expire images from the repository that match
certain conditions.
###### \`description\`Optional
- *Type:* str
- *Default:* No description
Describes the purpose of the rule.
---
###### \`max_image_age\`Optional
- *Type:* Duration
The maximum age of images to retain. The value must represent a number of days.
Specify exactly one of maxImageCount and maxImageAge.
---
###### \`max_image_count\`Optional
- *Type:* typing.Union[int, float]
The maximum number of images to retain.
Specify exactly one of maxImageCount and maxImageAge.
---
###### \`rule_priority\`Optional
- *Type:* typing.Union[int, float]
- *Default:* Automatically assigned
Controls the order in which rules are evaluated (low to high).
All rules must have a unique priority, where lower numbers have
higher precedence. The first rule that matches is applied to an image.
There can only be one rule with a tagStatus of Any, and it must have
the highest rulePriority.
All rules without a specified priority will have incrementing priorities
automatically assigned to them, higher than any rules that DO have priorities.
---
###### \`tag_prefix_list\`Optional
- *Type:* typing.List[str]
Select images that have ALL the given prefixes in their tag.
Only if tagStatus == TagStatus.Tagged
---
###### \`tag_status\`Optional
- *Type:* TagStatus
- *Default:* TagStatus.Tagged if tagPrefixList is given, TagStatus.Any otherwise
Select images based on tags.
Only one rule is allowed to select untagged images, and it must
have the highest rulePriority.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| is_construct
| Return whether the given object is a Construct. |
| is_resource
| Check whether the given construct is a Resource. |
| arn_for_local_repository
| Returns an ECR ARN for a repository that resides in the same account/region as the current stack. |
| from_repository_arn
| *No description.* |
| from_repository_attributes
| Import a repository. |
| from_repository_name
| *No description.* |
---
##### \`is_construct\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.Repository.is_construct(
x: typing.Any
)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_resource\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.Repository.is_resource(
construct: IConstruct
)
\`\`\`
Check whether the given construct is a Resource.
###### \`construct\`Required
- *Type:* IConstruct
---
##### \`arn_for_local_repository\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.Repository.arn_for_local_repository(
repository_name: str,
scope: IConstruct,
account: str = None
)
\`\`\`
Returns an ECR ARN for a repository that resides in the same account/region as the current stack.
###### \`repository_name\`Required
- *Type:* str
---
###### \`scope\`Required
- *Type:* IConstruct
---
###### \`account\`Optional
- *Type:* str
---
##### \`from_repository_arn\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.Repository.from_repository_arn(
scope: Construct,
id: str,
repository_arn: str
)
\`\`\`
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* str
---
###### \`repository_arn\`Required
- *Type:* str
---
##### \`from_repository_attributes\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.Repository.from_repository_attributes(
scope: Construct,
id: str,
repository_arn: str,
repository_name: str
)
\`\`\`
Import a repository.
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* str
---
###### \`repository_arn\`Required
- *Type:* str
---
###### \`repository_name\`Required
- *Type:* str
---
##### \`from_repository_name\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.Repository.from_repository_name(
scope: Construct,
id: str,
repository_name: str
)
\`\`\`
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* str
---
###### \`repository_name\`Required
- *Type:* str
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repository_arn
| str
| The ARN of the repository. |
| repository_name
| str
| The name of the repository. |
| repository_uri
| str
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`python
node: ConstructNode
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`env\`Required
\`\`\`python
env: ResourceEnvironment
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`python
stack: Stack
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repository_arn\`Required
\`\`\`python
repository_arn: str
\`\`\`
- *Type:* str
The ARN of the repository.
---
##### \`repository_name\`Required
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
The name of the repository.
---
##### \`repository_uri\`Required
\`\`\`python
repository_uri: str
\`\`\`
- *Type:* str
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
### RepositoryBase
- *Implements:* IRepository
Base class for ECR repository.
Reused between imported repositories and owned repositories.
#### Initializers
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.RepositoryBase(
scope: Construct,
id: str,
account: str = None,
environment_from_arn: str = None,
physical_name: str = None,
region: str = None
)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| *No description.* |
| id
| str
| *No description.* |
| account
| str
| The AWS account ID this resource belongs to. |
| environment_from_arn
| str
| ARN to deduce region and account from. |
| physical_name
| str
| The value passed in by users to the physical name prop of the resource. |
| region
| str
| The AWS region this resource belongs to. |
---
##### \`scope\`Required
- *Type:* Construct
---
##### \`id\`Required
- *Type:* str
---
##### \`account\`Optional
- *Type:* str
- *Default:* the resource is in the same account as the stack it belongs to
The AWS account ID this resource belongs to.
---
##### \`environment_from_arn\`Optional
- *Type:* str
- *Default:* take environment from \`account\`, \`region\` parameters, or use Stack environment.
ARN to deduce region and account from.
The ARN is parsed and the account and region are taken from the ARN.
This should be used for imported resources.
Cannot be supplied together with either \`account\` or \`region\`.
---
##### \`physical_name\`Optional
- *Type:* str
- *Default:* The physical name will be allocated by CloudFormation at deployment time
The value passed in by users to the physical name prop of the resource.
\`undefined\` implies that a physical name will be allocated by
CloudFormation during deployment.
- a concrete value implies a specific physical name
- \`PhysicalName.GENERATE_IF_NEEDED\` is a marker that indicates that a physical will only be generated
by the CDK if it is needed for cross-environment references. Otherwise, it will be allocated by CloudFormation.
---
##### \`region\`Optional
- *Type:* str
- *Default:* the resource is in the same region as the stack it belongs to
The AWS region this resource belongs to.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| to_string
| Returns a string representation of this construct. |
| apply_removal_policy
| Apply the given removal policy to this resource. |
| add_to_resource_policy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grant_pull
| Grant the given identity permissions to use the images in this repository. |
| grant_pull_push
| Grant the given identity permissions to pull and push images to this repository. |
| on_cloud_trail_event
| Define a CloudWatch event that triggers when something happens to this repository. |
| on_cloud_trail_image_pushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| on_event
| Defines a CloudWatch event rule which triggers for repository events. |
| on_image_scan_completed
| Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed. |
| repository_uri_for_digest
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| repository_uri_for_tag
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
---
##### \`to_string\`
\`\`\`python
def to_string() -> str
\`\`\`
Returns a string representation of this construct.
##### \`apply_removal_policy\`
\`\`\`python
def apply_removal_policy(
policy: RemovalPolicy
) -> None
\`\`\`
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (\`RemovalPolicy.DELETE\`), or left in your AWS
account for data recovery and cleanup later (\`RemovalPolicy.RETAIN\`).
###### \`policy\`Required
- *Type:* RemovalPolicy
---
##### \`add_to_resource_policy\`
\`\`\`python
def add_to_resource_policy(
statement: PolicyStatement
) -> AddToResourcePolicyResult
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`python
def grant(
grantee: IGrantable,
actions: str
) -> Grant
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* str
---
##### \`grant_pull\`
\`\`\`python
def grant_pull(
grantee: IGrantable
) -> Grant
\`\`\`
Grant the given identity permissions to use the images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grant_pull_push\`
\`\`\`python
def grant_pull_push(
grantee: IGrantable
) -> Grant
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`on_cloud_trail_event\`
\`\`\`python
def on_cloud_trail_event(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None
) -> Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`on_cloud_trail_image_pushed\`
\`\`\`python
def on_cloud_trail_image_pushed(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None,
image_tag: str = None
) -> Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
###### \`image_tag\`Optional
- *Type:* str
- *Default:* Watch changes to all tags
Only watch changes to this image tag.
---
##### \`on_event\`
\`\`\`python
def on_event(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None
) -> Rule
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* str
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`on_image_scan_completed\`
\`\`\`python
def on_image_scan_completed(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None,
image_tags: typing.List[str] = None
) -> Rule
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
###### \`image_tags\`Optional
- *Type:* typing.List[str]
- *Default:* Watch the changes to the repository with all image tags
Only watch changes to the image tags spedified.
Leave it undefined to watch the full repository.
---
##### \`repository_uri_for_digest\`
\`\`\`python
def repository_uri_for_digest(
digest: str = None
) -> str
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* str
Optional image digest.
---
##### \`repository_uri_for_tag\`
\`\`\`python
def repository_uri_for_tag(
tag: str = None
) -> str
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
###### \`tag\`Optional
- *Type:* str
Optional image tag.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| is_construct
| Return whether the given object is a Construct. |
| is_resource
| Check whether the given construct is a Resource. |
---
##### \`is_construct\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.RepositoryBase.is_construct(
x: typing.Any
)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* typing.Any
---
##### \`is_resource\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.RepositoryBase.is_resource(
construct: IConstruct
)
\`\`\`
Check whether the given construct is a Resource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repository_arn
| str
| The ARN of the repository. |
| repository_name
| str
| The name of the repository. |
| repository_uri
| str
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`python
node: ConstructNode
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`env\`Required
\`\`\`python
env: ResourceEnvironment
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`python
stack: Stack
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repository_arn\`Required
\`\`\`python
repository_arn: str
\`\`\`
- *Type:* str
The ARN of the repository.
---
##### \`repository_name\`Required
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
The name of the repository.
---
##### \`repository_uri\`Required
\`\`\`python
repository_uri: str
\`\`\`
- *Type:* str
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
## Structs
### CfnPublicRepositoryProps
Properties for defining a \`AWS::ECR::PublicRepository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnPublicRepositoryProps(
repository_catalog_data: typing.Any = None,
repository_name: str = None,
repository_policy_text: typing.Any = None,
tags: typing.List[CfnTag] = None
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| repository_catalog_data
| typing.Any
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| repository_name
| str
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
| repository_policy_text
| typing.Any
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| tags
| typing.List[CfnTag]
| \`AWS::ECR::PublicRepository.Tags\`. |
---
##### \`repository_catalog_data\`Optional
\`\`\`python
repository_catalog_data: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`repository_name\`Optional
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
##### \`repository_policy_text\`Optional
\`\`\`python
repository_policy_text: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`tags\`Optional
\`\`\`python
tags: typing.List[CfnTag]
\`\`\`
- *Type:* typing.List[CfnTag]
\`AWS::ECR::PublicRepository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
---
### CfnRegistryPolicyProps
Properties for defining a \`AWS::ECR::RegistryPolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html)
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRegistryPolicyProps(
policy_text: typing.Any
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| policy_text
| typing.Any
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`policy_text\`Required
\`\`\`python
policy_text: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
### CfnReplicationConfigurationProps
Properties for defining a \`AWS::ECR::ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnReplicationConfigurationProps(
replication_configuration: typing.Union[IResolvable, ReplicationConfigurationProperty]
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| replication_configuration
| typing.Union[IResolvable, ReplicationConfigurationProperty]
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`replication_configuration\`Required
\`\`\`python
replication_configuration: typing.Union[IResolvable, ReplicationConfigurationProperty]
\`\`\`
- *Type:* typing.Union[IResolvable, ReplicationConfigurationProperty]
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
### CfnRepositoryProps
Properties for defining a \`AWS::ECR::Repository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRepositoryProps(
encryption_configuration: typing.Any = None,
image_scanning_configuration: typing.Any = None,
image_tag_mutability: str = None,
lifecycle_policy: typing.Union[IResolvable, LifecyclePolicyProperty] = None,
repository_name: str = None,
repository_policy_text: typing.Any = None,
tags: typing.List[CfnTag] = None
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| encryption_configuration
| typing.Any
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| image_scanning_configuration
| typing.Any
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| image_tag_mutability
| str
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| lifecycle_policy
| typing.Union[IResolvable, LifecyclePolicyProperty]
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| repository_name
| str
| \`AWS::ECR::Repository.RepositoryName\`. |
| repository_policy_text
| typing.Any
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| tags
| typing.List[CfnTag]
| \`AWS::ECR::Repository.Tags\`. |
---
##### \`encryption_configuration\`Optional
\`\`\`python
encryption_configuration: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`image_scanning_configuration\`Optional
\`\`\`python
image_scanning_configuration: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`image_tag_mutability\`Optional
\`\`\`python
image_tag_mutability: str
\`\`\`
- *Type:* str
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`lifecycle_policy\`Optional
\`\`\`python
lifecycle_policy: typing.Union[IResolvable, LifecyclePolicyProperty]
\`\`\`
- *Type:* typing.Union[IResolvable, LifecyclePolicyProperty]
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`repository_name\`Optional
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
##### \`repository_policy_text\`Optional
\`\`\`python
repository_policy_text: typing.Any
\`\`\`
- *Type:* typing.Any
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`tags\`Optional
\`\`\`python
tags: typing.List[CfnTag]
\`\`\`
- *Type:* typing.List[CfnTag]
\`AWS::ECR::Repository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
---
### LifecyclePolicyProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html)
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnRepository.LifecyclePolicyProperty(
lifecycle_policy_text: str = None,
registry_id: str = None
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| lifecycle_policy_text
| str
| \`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`. |
| registry_id
| str
| \`CfnRepository.LifecyclePolicyProperty.RegistryId\`. |
---
##### \`lifecycle_policy_text\`Optional
\`\`\`python
lifecycle_policy_text: str
\`\`\`
- *Type:* str
\`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext)
---
##### \`registry_id\`Optional
\`\`\`python
registry_id: str
\`\`\`
- *Type:* str
\`CfnRepository.LifecyclePolicyProperty.RegistryId\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid)
---
### LifecycleRule
An ECR life cycle rule.
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.LifecycleRule(
description: str = None,
max_image_age: Duration = None,
max_image_count: typing.Union[int, float] = None,
rule_priority: typing.Union[int, float] = None,
tag_prefix_list: typing.List[str] = None,
tag_status: TagStatus = None
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| description
| str
| Describes the purpose of the rule. |
| max_image_age
| Duration
| The maximum age of images to retain. The value must represent a number of days. |
| max_image_count
| typing.Union[int, float]
| The maximum number of images to retain. |
| rule_priority
| typing.Union[int, float]
| Controls the order in which rules are evaluated (low to high). |
| tag_prefix_list
| typing.List[str]
| Select images that have ALL the given prefixes in their tag. |
| tag_status
| TagStatus
| Select images based on tags. |
---
##### \`description\`Optional
\`\`\`python
description: str
\`\`\`
- *Type:* str
- *Default:* No description
Describes the purpose of the rule.
---
##### \`max_image_age\`Optional
\`\`\`python
max_image_age: Duration
\`\`\`
- *Type:* Duration
The maximum age of images to retain. The value must represent a number of days.
Specify exactly one of maxImageCount and maxImageAge.
---
##### \`max_image_count\`Optional
\`\`\`python
max_image_count: typing.Union[int, float]
\`\`\`
- *Type:* typing.Union[int, float]
The maximum number of images to retain.
Specify exactly one of maxImageCount and maxImageAge.
---
##### \`rule_priority\`Optional
\`\`\`python
rule_priority: typing.Union[int, float]
\`\`\`
- *Type:* typing.Union[int, float]
- *Default:* Automatically assigned
Controls the order in which rules are evaluated (low to high).
All rules must have a unique priority, where lower numbers have
higher precedence. The first rule that matches is applied to an image.
There can only be one rule with a tagStatus of Any, and it must have
the highest rulePriority.
All rules without a specified priority will have incrementing priorities
automatically assigned to them, higher than any rules that DO have priorities.
---
##### \`tag_prefix_list\`Optional
\`\`\`python
tag_prefix_list: typing.List[str]
\`\`\`
- *Type:* typing.List[str]
Select images that have ALL the given prefixes in their tag.
Only if tagStatus == TagStatus.Tagged
---
##### \`tag_status\`Optional
\`\`\`python
tag_status: TagStatus
\`\`\`
- *Type:* TagStatus
- *Default:* TagStatus.Tagged if tagPrefixList is given, TagStatus.Any otherwise
Select images based on tags.
Only one rule is allowed to select untagged images, and it must
have the highest rulePriority.
---
### OnCloudTrailImagePushedOptions
Options for the onCloudTrailImagePushed method.
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.OnCloudTrailImagePushedOptions(
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None,
image_tag: str = None
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| description
| str
| A description of the rule's purpose. |
| event_pattern
| EventPattern
| Additional restrictions for the event to route to the specified target. |
| rule_name
| str
| A name for the rule. |
| target
| IRuleTarget
| The target to register for the event. |
| image_tag
| str
| Only watch changes to this image tag. |
---
##### \`description\`Optional
\`\`\`python
description: str
\`\`\`
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
##### \`event_pattern\`Optional
\`\`\`python
event_pattern: EventPattern
\`\`\`
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
##### \`rule_name\`Optional
\`\`\`python
rule_name: str
\`\`\`
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
##### \`target\`Optional
\`\`\`python
target: IRuleTarget
\`\`\`
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`image_tag\`Optional
\`\`\`python
image_tag: str
\`\`\`
- *Type:* str
- *Default:* Watch changes to all tags
Only watch changes to this image tag.
---
### OnImageScanCompletedOptions
Options for the OnImageScanCompleted method.
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.OnImageScanCompletedOptions(
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None,
image_tags: typing.List[str] = None
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| description
| str
| A description of the rule's purpose. |
| event_pattern
| EventPattern
| Additional restrictions for the event to route to the specified target. |
| rule_name
| str
| A name for the rule. |
| target
| IRuleTarget
| The target to register for the event. |
| image_tags
| typing.List[str]
| Only watch changes to the image tags spedified. |
---
##### \`description\`Optional
\`\`\`python
description: str
\`\`\`
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
##### \`event_pattern\`Optional
\`\`\`python
event_pattern: EventPattern
\`\`\`
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
##### \`rule_name\`Optional
\`\`\`python
rule_name: str
\`\`\`
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
##### \`target\`Optional
\`\`\`python
target: IRuleTarget
\`\`\`
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`image_tags\`Optional
\`\`\`python
image_tags: typing.List[str]
\`\`\`
- *Type:* typing.List[str]
- *Default:* Watch the changes to the repository with all image tags
Only watch changes to the image tags spedified.
Leave it undefined to watch the full repository.
---
### ReplicationConfigurationProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html)
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationConfigurationProperty(
rules: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationRuleProperty]]]
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| rules
| typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationRuleProperty]]]
| \`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`. |
---
##### \`rules\`Required
\`\`\`python
rules: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationRuleProperty]]]
\`\`\`
- *Type:* typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationRuleProperty]]]
\`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules)
---
### ReplicationDestinationProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html)
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationDestinationProperty(
region: str,
registry_id: str
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| region
| str
| \`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`. |
| registry_id
| str
| \`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`. |
---
##### \`region\`Required
\`\`\`python
region: str
\`\`\`
- *Type:* str
\`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region)
---
##### \`registry_id\`Required
\`\`\`python
registry_id: str
\`\`\`
- *Type:* str
\`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid)
---
### ReplicationRuleProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html)
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.CfnReplicationConfiguration.ReplicationRuleProperty(
destinations: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationDestinationProperty]]]
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| destinations
| typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationDestinationProperty]]]
| \`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`. |
---
##### \`destinations\`Required
\`\`\`python
destinations: typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationDestinationProperty]]]
\`\`\`
- *Type:* typing.Union[IResolvable, typing.List[typing.Union[IResolvable, ReplicationDestinationProperty]]]
\`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations)
---
### RepositoryAttributes
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.RepositoryAttributes(
repository_arn: str,
repository_name: str
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| repository_arn
| str
| *No description.* |
| repository_name
| str
| *No description.* |
---
##### \`repository_arn\`Required
\`\`\`python
repository_arn: str
\`\`\`
- *Type:* str
---
##### \`repository_name\`Required
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
---
### RepositoryProps
#### Initializer
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.RepositoryProps(
image_scan_on_push: bool = None,
image_tag_mutability: TagMutability = None,
lifecycle_registry_id: str = None,
lifecycle_rules: typing.List[LifecycleRule] = None,
removal_policy: RemovalPolicy = None,
repository_name: str = None
)
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| image_scan_on_push
| bool
| Enable the scan on push when creating the repository. |
| image_tag_mutability
| TagMutability
| The tag mutability setting for the repository. |
| lifecycle_registry_id
| str
| The AWS account ID associated with the registry that contains the repository. |
| lifecycle_rules
| typing.List[LifecycleRule]
| Life cycle rules to apply to this registry. |
| removal_policy
| RemovalPolicy
| Determine what happens to the repository when the resource/stack is deleted. |
| repository_name
| str
| Name for this repository. |
---
##### \`image_scan_on_push\`Optional
\`\`\`python
image_scan_on_push: bool
\`\`\`
- *Type:* bool
- *Default:* false
Enable the scan on push when creating the repository.
---
##### \`image_tag_mutability\`Optional
\`\`\`python
image_tag_mutability: TagMutability
\`\`\`
- *Type:* TagMutability
- *Default:* TagMutability.MUTABLE
The tag mutability setting for the repository.
If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten.
---
##### \`lifecycle_registry_id\`Optional
\`\`\`python
lifecycle_registry_id: str
\`\`\`
- *Type:* str
- *Default:* The default registry is assumed.
The AWS account ID associated with the registry that contains the repository.
> [https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html](https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html)
---
##### \`lifecycle_rules\`Optional
\`\`\`python
lifecycle_rules: typing.List[LifecycleRule]
\`\`\`
- *Type:* typing.List[LifecycleRule]
- *Default:* No life cycle rules
Life cycle rules to apply to this registry.
---
##### \`removal_policy\`Optional
\`\`\`python
removal_policy: RemovalPolicy
\`\`\`
- *Type:* RemovalPolicy
- *Default:* RemovalPolicy.Retain
Determine what happens to the repository when the resource/stack is deleted.
---
##### \`repository_name\`Optional
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
- *Default:* Automatically generated name.
Name for this repository.
---
## Classes
### AuthorizationToken
Authorization token to access private ECR repositories in the current environment via Docker CLI.
> [https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html](https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html)
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| grant_read
| Grant access to retrieve an authorization token. |
---
##### \`grant_read\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.AuthorizationToken.grant_read(
grantee: IGrantable
)
\`\`\`
Grant access to retrieve an authorization token.
###### \`grantee\`Required
- *Type:* IGrantable
---
### PublicGalleryAuthorizationToken
Authorization token to access the global public ECR Gallery via Docker CLI.
> [https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth)
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| grant_read
| Grant access to retrieve an authorization token. |
---
##### \`grant_read\`
\`\`\`python
import aws_cdk.aws_ecr
aws_cdk.aws_ecr.PublicGalleryAuthorizationToken.grant_read(
grantee: IGrantable
)
\`\`\`
Grant access to retrieve an authorization token.
###### \`grantee\`Required
- *Type:* IGrantable
---
## Protocols
### IRepository
- *Extends:* IResource
- *Implemented By:* Repository, RepositoryBase, IRepository
Represents an ECR repository.
#### Methods
| **Name** | **Description** |
| --- | --- |
| add_to_resource_policy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grant_pull
| Grant the given identity permissions to pull images in this repository. |
| grant_pull_push
| Grant the given identity permissions to pull and push images to this repository. |
| on_cloud_trail_event
| Define a CloudWatch event that triggers when something happens to this repository. |
| on_cloud_trail_image_pushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| on_event
| Defines a CloudWatch event rule which triggers for repository events. |
| on_image_scan_completed
| Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed. |
| repository_uri_for_digest
| Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`. |
| repository_uri_for_tag
| Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`. |
---
##### \`add_to_resource_policy\`
\`\`\`python
def add_to_resource_policy(
statement: PolicyStatement
) -> AddToResourcePolicyResult
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`python
def grant(
grantee: IGrantable,
actions: str
) -> Grant
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* str
---
##### \`grant_pull\`
\`\`\`python
def grant_pull(
grantee: IGrantable
) -> Grant
\`\`\`
Grant the given identity permissions to pull images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grant_pull_push\`
\`\`\`python
def grant_pull_push(
grantee: IGrantable
) -> Grant
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`on_cloud_trail_event\`
\`\`\`python
def on_cloud_trail_event(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None
) -> Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`on_cloud_trail_image_pushed\`
\`\`\`python
def on_cloud_trail_image_pushed(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None,
image_tag: str = None
) -> Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
###### \`image_tag\`Optional
- *Type:* str
- *Default:* Watch changes to all tags
Only watch changes to this image tag.
---
##### \`on_event\`
\`\`\`python
def on_event(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None
) -> Rule
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* str
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`on_image_scan_completed\`
\`\`\`python
def on_image_scan_completed(
id: str,
description: str = None,
event_pattern: EventPattern = None,
rule_name: str = None,
target: IRuleTarget = None,
image_tags: typing.List[str] = None
) -> Rule
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed.
###### \`id\`Required
- *Type:* str
The id of the rule.
---
###### \`description\`Optional
- *Type:* str
- *Default:* No description
A description of the rule's purpose.
---
###### \`event_pattern\`Optional
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
###### \`rule_name\`Optional
- *Type:* str
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
###### \`target\`Optional
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
###### \`image_tags\`Optional
- *Type:* typing.List[str]
- *Default:* Watch the changes to the repository with all image tags
Only watch changes to the image tags spedified.
Leave it undefined to watch the full repository.
---
##### \`repository_uri_for_digest\`
\`\`\`python
def repository_uri_for_digest(
digest: str = None
) -> str
\`\`\`
Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* str
Image digest to use (tools usually default to the image with the "latest" tag if omitted).
---
##### \`repository_uri_for_tag\`
\`\`\`python
def repository_uri_for_tag(
tag: str = None
) -> str
\`\`\`
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]
###### \`tag\`Optional
- *Type:* str
Image tag to use (tools usually default to "latest" if omitted).
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node for this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repository_arn
| str
| The ARN of the repository. |
| repository_name
| str
| The name of the repository. |
| repository_uri
| str
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`python
node: ConstructNode
\`\`\`
- *Type:* ConstructNode
The construct tree node for this construct.
---
##### \`env\`Required
\`\`\`python
env: ResourceEnvironment
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`python
stack: Stack
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repository_arn\`Required
\`\`\`python
repository_arn: str
\`\`\`
- *Type:* str
The ARN of the repository.
---
##### \`repository_name\`Required
\`\`\`python
repository_name: str
\`\`\`
- *Type:* str
The name of the repository.
---
##### \`repository_uri\`Required
\`\`\`python
repository_uri: str
\`\`\`
- *Type:* str
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
## Enums
### TagMutability
The tag mutability setting for your repository.
#### Members
| **Name** | **Description** |
| --- | --- |
| MUTABLE
| allow image tags to be overwritten. |
| IMMUTABLE
| all image tags within the repository will be immutable which will prevent them from being overwritten. |
---
##### \`MUTABLE\`
allow image tags to be overwritten.
---
##### \`IMMUTABLE\`
all image tags within the repository will be immutable which will prevent them from being overwritten.
---
### TagStatus
Select images based on tags.
#### Members
| **Name** | **Description** |
| --- | --- |
| ANY
| Rule applies to all images. |
| TAGGED
| Rule applies to tagged images. |
| UNTAGGED
| Rule applies to untagged images. |
---
##### \`ANY\`
Rule applies to all images.
---
##### \`TAGGED\`
Rule applies to tagged images.
---
##### \`UNTAGGED\`
Rule applies to untagged images.
---
"
`;
exports[`simple link formatter typescript snapshot 1`] = `
"# Amazon ECR Construct Library
---


---
This package contains constructs for working with Amazon Elastic Container Registry.
## Repositories
Define a repository by creating a new instance of \`Repository\`. A repository
holds multiple verions of a single container image.
\`\`\`ts
const repository = new ecr.Repository(this, 'Repository');
\`\`\`
## Image scanning
Amazon ECR image scanning helps in identifying software vulnerabilities in your container images. You can manually scan container images stored in Amazon ECR, or you can configure your repositories to scan images when you push them to a repository. To create a new repository to scan on push, simply enable \`imageScanOnPush\` in the properties
\`\`\`ts
const repository = new ecr.Repository(stack, 'Repo', {
imageScanOnPush: true
});
\`\`\`
To create an \`onImageScanCompleted\` event rule and trigger the event target
\`\`\`ts
repository.onImageScanCompleted('ImageScanComplete')
.addTarget(...)
\`\`\`
### Authorization Token
Besides the Amazon ECR APIs, ECR also allows the Docker CLI or a language-specific Docker library to push and pull
images from an ECR repository. However, the Docker CLI does not support native IAM authentication methods and
additional steps must be taken so that Amazon ECR can authenticate and authorize Docker push and pull requests.
More information can be found at at [Registry Authentication](https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html#registry_auth).
A Docker authorization token can be obtained using the \`GetAuthorizationToken\` ECR API. The following code snippets
grants an IAM user access to call this API.
\`\`\`ts
import * as iam from '@aws-cdk/aws-iam';
import * as ecr from '@aws-cdk/aws-ecr';
const user = new iam.User(this, 'User', { ... });
ecr.AuthorizationToken.grantRead(user);
\`\`\`
If you access images in the [Public ECR Gallery](https://gallery.ecr.aws/) as well, it is recommended you authenticate to the registry to benefit from
higher rate and bandwidth limits.
> See \`Pricing\` in https://aws.amazon.com/blogs/aws/amazon-ecr-public-a-new-public-container-registry/ and [Service quotas](https://docs.aws.amazon.com/AmazonECR/latest/public/public-service-quotas.html).
The following code snippet grants an IAM user access to retrieve an authorization token for the public gallery.
\`\`\`ts
import * as iam from '@aws-cdk/aws-iam';
import * as ecr from '@aws-cdk/aws-ecr';
const user = new iam.User(this, 'User', { ... });
ecr.PublicGalleryAuthorizationToken.grantRead(user);
\`\`\`
This user can then proceed to login to the registry using one of the [authentication methods](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth).
### Image tag immutability
You can set tag immutability on images in our repository using the \`imageTagMutability\` construct prop.
\`\`\`ts
new ecr.Repository(stack, 'Repo', { imageTagMutability: ecr.TagMutability.IMMUTABLE });
\`\`\`
## Automatically clean up repositories
You can set life cycle rules to automatically clean up old images from your
repository. The first life cycle rule that matches an image will be applied
against that image. For example, the following deletes images older than
30 days, while keeping all images tagged with prod (note that the order
is important here):
\`\`\`ts
repository.addLifecycleRule({ tagPrefixList: ['prod'], maxImageCount: 9999 });
repository.addLifecycleRule({ maxImageAge: cdk.Duration.days(30) });
\`\`\`
# API Reference
## Constructs
### CfnPublicRepository
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::PublicRepository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
#### Initializers
\`\`\`typescript
import { CfnPublicRepository } from '@aws-cdk/aws-ecr'
new CfnPublicRepository(scope: Construct, id: string, props?: CfnPublicRepositoryProps)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| string
| - scoped id of the resource. |
| props
| CfnPublicRepositoryProps
| - resource properties. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* string
scoped id of the resource.
---
##### \`props\`Optional
- *Type:* CfnPublicRepositoryProps
resource properties.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| overrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| addDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| addDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| addMetadata
| Add a value to the CloudFormation Resource Metadata. |
| addOverride
| Adds an override to the synthesized CloudFormation resource. |
| addPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| addPropertyOverride
| Adds an override to a resource property. |
| applyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| getAtt
| Returns a token for an runtime attribute of this resource. |
| getMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`toString\`
\`\`\`typescript
public toString(): string
\`\`\`
Returns a string representation of this construct.
##### \`overrideLogicalId\`
\`\`\`typescript
public overrideLogicalId(newLogicalId: string): void
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`newLogicalId\`Required
- *Type:* string
The new logical ID to use for this stack element.
---
##### \`addDeletionOverride\`
\`\`\`typescript
public addDeletionOverride(path: string): void
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* string
The path of the value to delete.
---
##### \`addDependsOn\`
\`\`\`typescript
public addDependsOn(target: CfnResource): void
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`addMetadata\`
\`\`\`typescript
public addMetadata(key: string, value: any): void
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* string
---
###### \`value\`Required
- *Type:* any
---
##### \`addOverride\`
\`\`\`typescript
public addOverride(path: string, value: any): void
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* string
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* any
The value.
Could be primitive or complex.
---
##### \`addPropertyDeletionOverride\`
\`\`\`typescript
public addPropertyDeletionOverride(propertyPath: string): void
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`propertyPath\`Required
- *Type:* string
The path to the property.
---
##### \`addPropertyOverride\`
\`\`\`typescript
public addPropertyOverride(propertyPath: string, value: any): void
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`propertyPath\`Required
- *Type:* string
The path of the property.
---
###### \`value\`Required
- *Type:* any
The value.
---
##### \`applyRemovalPolicy\`
\`\`\`typescript
public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`getAtt\`
\`\`\`typescript
public getAtt(attributeName: string): Reference
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attributeName\`Required
- *Type:* string
The name of the attribute.
---
##### \`getMetadata\`
\`\`\`typescript
public getMetadata(key: string): any
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* string
---
##### \`inspect\`
\`\`\`typescript
public inspect(inspector: TreeInspector): void
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| isCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`isConstruct\`
\`\`\`typescript
import { CfnPublicRepository } from '@aws-cdk/aws-ecr'
CfnPublicRepository.isConstruct(x: any)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* any
---
##### \`isCfnElement\`
\`\`\`typescript
import { CfnPublicRepository } from '@aws-cdk/aws-ecr'
CfnPublicRepository.isCfnElement(x: any)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* any
---
##### \`isCfnResource\`
\`\`\`typescript
import { CfnPublicRepository } from '@aws-cdk/aws-ecr'
CfnPublicRepository.isCfnResource(construct: IConstruct)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creationStack
| string[]
| *No description.* |
| logicalId
| string
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| string
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfnResourceType
| string
| AWS resource type. |
| attrArn
| string
| *No description.* |
| tags
| TagManager
| \`AWS::ECR::PublicRepository.Tags\`. |
| repositoryCatalogData
| any
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| repositoryPolicyText
| any
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| repositoryName
| string
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
---
##### \`node\`Required
\`\`\`typescript
public readonly node: ConstructNode;
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creationStack\`Required
\`\`\`typescript
public readonly creationStack: string[];
\`\`\`
- *Type:* string[]
---
##### \`logicalId\`Required
\`\`\`typescript
public readonly logicalId: string;
\`\`\`
- *Type:* string
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`stack\`Required
\`\`\`typescript
public readonly stack: Stack;
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`ref\`Required
\`\`\`typescript
public readonly ref: string;
\`\`\`
- *Type:* string
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`cfnOptions\`Required
\`\`\`typescript
public readonly cfnOptions: ICfnResourceOptions;
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`cfnResourceType\`Required
\`\`\`typescript
public readonly cfnResourceType: string;
\`\`\`
- *Type:* string
AWS resource type.
---
##### \`attrArn\`Required
\`\`\`typescript
public readonly attrArn: string;
\`\`\`
- *Type:* string
---
##### \`tags\`Required
\`\`\`typescript
public readonly tags: TagManager;
\`\`\`
- *Type:* TagManager
\`AWS::ECR::PublicRepository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
---
##### \`repositoryCatalogData\`Required
\`\`\`typescript
public readonly repositoryCatalogData: any;
\`\`\`
- *Type:* any
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`repositoryPolicyText\`Required
\`\`\`typescript
public readonly repositoryPolicyText: any;
\`\`\`
- *Type:* any
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`repositoryName\`Optional
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CFN_RESOURCE_TYPE_NAME
| string
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`typescript
public readonly CFN_RESOURCE_TYPE_NAME: string;
\`\`\`
- *Type:* string
The CloudFormation resource type name for this resource class.
---
### CfnRegistryPolicy
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::RegistryPolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html)
#### Initializers
\`\`\`typescript
import { CfnRegistryPolicy } from '@aws-cdk/aws-ecr'
new CfnRegistryPolicy(scope: Construct, id: string, props: CfnRegistryPolicyProps)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| string
| - scoped id of the resource. |
| props
| CfnRegistryPolicyProps
| - resource properties. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* string
scoped id of the resource.
---
##### \`props\`Required
- *Type:* CfnRegistryPolicyProps
resource properties.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| overrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| addDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| addDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| addMetadata
| Add a value to the CloudFormation Resource Metadata. |
| addOverride
| Adds an override to the synthesized CloudFormation resource. |
| addPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| addPropertyOverride
| Adds an override to a resource property. |
| applyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| getAtt
| Returns a token for an runtime attribute of this resource. |
| getMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`toString\`
\`\`\`typescript
public toString(): string
\`\`\`
Returns a string representation of this construct.
##### \`overrideLogicalId\`
\`\`\`typescript
public overrideLogicalId(newLogicalId: string): void
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`newLogicalId\`Required
- *Type:* string
The new logical ID to use for this stack element.
---
##### \`addDeletionOverride\`
\`\`\`typescript
public addDeletionOverride(path: string): void
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* string
The path of the value to delete.
---
##### \`addDependsOn\`
\`\`\`typescript
public addDependsOn(target: CfnResource): void
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`addMetadata\`
\`\`\`typescript
public addMetadata(key: string, value: any): void
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* string
---
###### \`value\`Required
- *Type:* any
---
##### \`addOverride\`
\`\`\`typescript
public addOverride(path: string, value: any): void
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* string
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* any
The value.
Could be primitive or complex.
---
##### \`addPropertyDeletionOverride\`
\`\`\`typescript
public addPropertyDeletionOverride(propertyPath: string): void
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`propertyPath\`Required
- *Type:* string
The path to the property.
---
##### \`addPropertyOverride\`
\`\`\`typescript
public addPropertyOverride(propertyPath: string, value: any): void
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`propertyPath\`Required
- *Type:* string
The path of the property.
---
###### \`value\`Required
- *Type:* any
The value.
---
##### \`applyRemovalPolicy\`
\`\`\`typescript
public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`getAtt\`
\`\`\`typescript
public getAtt(attributeName: string): Reference
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attributeName\`Required
- *Type:* string
The name of the attribute.
---
##### \`getMetadata\`
\`\`\`typescript
public getMetadata(key: string): any
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* string
---
##### \`inspect\`
\`\`\`typescript
public inspect(inspector: TreeInspector): void
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| isCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`isConstruct\`
\`\`\`typescript
import { CfnRegistryPolicy } from '@aws-cdk/aws-ecr'
CfnRegistryPolicy.isConstruct(x: any)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* any
---
##### \`isCfnElement\`
\`\`\`typescript
import { CfnRegistryPolicy } from '@aws-cdk/aws-ecr'
CfnRegistryPolicy.isCfnElement(x: any)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* any
---
##### \`isCfnResource\`
\`\`\`typescript
import { CfnRegistryPolicy } from '@aws-cdk/aws-ecr'
CfnRegistryPolicy.isCfnResource(construct: IConstruct)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creationStack
| string[]
| *No description.* |
| logicalId
| string
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| string
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfnResourceType
| string
| AWS resource type. |
| attrRegistryId
| string
| *No description.* |
| policyText
| any
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`node\`Required
\`\`\`typescript
public readonly node: ConstructNode;
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creationStack\`Required
\`\`\`typescript
public readonly creationStack: string[];
\`\`\`
- *Type:* string[]
---
##### \`logicalId\`Required
\`\`\`typescript
public readonly logicalId: string;
\`\`\`
- *Type:* string
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`stack\`Required
\`\`\`typescript
public readonly stack: Stack;
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`ref\`Required
\`\`\`typescript
public readonly ref: string;
\`\`\`
- *Type:* string
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`cfnOptions\`Required
\`\`\`typescript
public readonly cfnOptions: ICfnResourceOptions;
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`cfnResourceType\`Required
\`\`\`typescript
public readonly cfnResourceType: string;
\`\`\`
- *Type:* string
AWS resource type.
---
##### \`attrRegistryId\`Required
\`\`\`typescript
public readonly attrRegistryId: string;
\`\`\`
- *Type:* string
---
##### \`policyText\`Required
\`\`\`typescript
public readonly policyText: any;
\`\`\`
- *Type:* any
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CFN_RESOURCE_TYPE_NAME
| string
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`typescript
public readonly CFN_RESOURCE_TYPE_NAME: string;
\`\`\`
- *Type:* string
The CloudFormation resource type name for this resource class.
---
### CfnReplicationConfiguration
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
#### Initializers
\`\`\`typescript
import { CfnReplicationConfiguration } from '@aws-cdk/aws-ecr'
new CfnReplicationConfiguration(scope: Construct, id: string, props: CfnReplicationConfigurationProps)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| string
| - scoped id of the resource. |
| props
| CfnReplicationConfigurationProps
| - resource properties. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* string
scoped id of the resource.
---
##### \`props\`Required
- *Type:* CfnReplicationConfigurationProps
resource properties.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| overrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| addDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| addDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| addMetadata
| Add a value to the CloudFormation Resource Metadata. |
| addOverride
| Adds an override to the synthesized CloudFormation resource. |
| addPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| addPropertyOverride
| Adds an override to a resource property. |
| applyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| getAtt
| Returns a token for an runtime attribute of this resource. |
| getMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`toString\`
\`\`\`typescript
public toString(): string
\`\`\`
Returns a string representation of this construct.
##### \`overrideLogicalId\`
\`\`\`typescript
public overrideLogicalId(newLogicalId: string): void
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`newLogicalId\`Required
- *Type:* string
The new logical ID to use for this stack element.
---
##### \`addDeletionOverride\`
\`\`\`typescript
public addDeletionOverride(path: string): void
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* string
The path of the value to delete.
---
##### \`addDependsOn\`
\`\`\`typescript
public addDependsOn(target: CfnResource): void
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`addMetadata\`
\`\`\`typescript
public addMetadata(key: string, value: any): void
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* string
---
###### \`value\`Required
- *Type:* any
---
##### \`addOverride\`
\`\`\`typescript
public addOverride(path: string, value: any): void
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* string
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* any
The value.
Could be primitive or complex.
---
##### \`addPropertyDeletionOverride\`
\`\`\`typescript
public addPropertyDeletionOverride(propertyPath: string): void
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`propertyPath\`Required
- *Type:* string
The path to the property.
---
##### \`addPropertyOverride\`
\`\`\`typescript
public addPropertyOverride(propertyPath: string, value: any): void
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`propertyPath\`Required
- *Type:* string
The path of the property.
---
###### \`value\`Required
- *Type:* any
The value.
---
##### \`applyRemovalPolicy\`
\`\`\`typescript
public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`getAtt\`
\`\`\`typescript
public getAtt(attributeName: string): Reference
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attributeName\`Required
- *Type:* string
The name of the attribute.
---
##### \`getMetadata\`
\`\`\`typescript
public getMetadata(key: string): any
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* string
---
##### \`inspect\`
\`\`\`typescript
public inspect(inspector: TreeInspector): void
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| isCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`isConstruct\`
\`\`\`typescript
import { CfnReplicationConfiguration } from '@aws-cdk/aws-ecr'
CfnReplicationConfiguration.isConstruct(x: any)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* any
---
##### \`isCfnElement\`
\`\`\`typescript
import { CfnReplicationConfiguration } from '@aws-cdk/aws-ecr'
CfnReplicationConfiguration.isCfnElement(x: any)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* any
---
##### \`isCfnResource\`
\`\`\`typescript
import { CfnReplicationConfiguration } from '@aws-cdk/aws-ecr'
CfnReplicationConfiguration.isCfnResource(construct: IConstruct)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creationStack
| string[]
| *No description.* |
| logicalId
| string
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| string
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfnResourceType
| string
| AWS resource type. |
| attrRegistryId
| string
| *No description.* |
| replicationConfiguration
| IResolvable \\| ReplicationConfigurationProperty
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`node\`Required
\`\`\`typescript
public readonly node: ConstructNode;
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creationStack\`Required
\`\`\`typescript
public readonly creationStack: string[];
\`\`\`
- *Type:* string[]
---
##### \`logicalId\`Required
\`\`\`typescript
public readonly logicalId: string;
\`\`\`
- *Type:* string
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`stack\`Required
\`\`\`typescript
public readonly stack: Stack;
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`ref\`Required
\`\`\`typescript
public readonly ref: string;
\`\`\`
- *Type:* string
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`cfnOptions\`Required
\`\`\`typescript
public readonly cfnOptions: ICfnResourceOptions;
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`cfnResourceType\`Required
\`\`\`typescript
public readonly cfnResourceType: string;
\`\`\`
- *Type:* string
AWS resource type.
---
##### \`attrRegistryId\`Required
\`\`\`typescript
public readonly attrRegistryId: string;
\`\`\`
- *Type:* string
---
##### \`replicationConfiguration\`Required
\`\`\`typescript
public readonly replicationConfiguration: IResolvable | ReplicationConfigurationProperty;
\`\`\`
- *Type:* IResolvable | ReplicationConfigurationProperty
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CFN_RESOURCE_TYPE_NAME
| string
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`typescript
public readonly CFN_RESOURCE_TYPE_NAME: string;
\`\`\`
- *Type:* string
The CloudFormation resource type name for this resource class.
---
### CfnRepository
- *Implements:* IInspectable
A CloudFormation \`AWS::ECR::Repository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
#### Initializers
\`\`\`typescript
import { CfnRepository } from '@aws-cdk/aws-ecr'
new CfnRepository(scope: Construct, id: string, props?: CfnRepositoryProps)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| - scope in which this resource is defined. |
| id
| string
| - scoped id of the resource. |
| props
| CfnRepositoryProps
| - resource properties. |
---
##### \`scope\`Required
- *Type:* Construct
scope in which this resource is defined.
---
##### \`id\`Required
- *Type:* string
scoped id of the resource.
---
##### \`props\`Optional
- *Type:* CfnRepositoryProps
resource properties.
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| overrideLogicalId
| Overrides the auto-generated logical ID with a specific ID. |
| addDeletionOverride
| Syntactic sugar for \`addOverride(path, undefined)\`. |
| addDependsOn
| Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
| addMetadata
| Add a value to the CloudFormation Resource Metadata. |
| addOverride
| Adds an override to the synthesized CloudFormation resource. |
| addPropertyDeletionOverride
| Adds an override that deletes the value of a property from the resource definition. |
| addPropertyOverride
| Adds an override to a resource property. |
| applyRemovalPolicy
| Sets the deletion policy of the resource based on the removal policy specified. |
| getAtt
| Returns a token for an runtime attribute of this resource. |
| getMetadata
| Retrieve a value value from the CloudFormation Resource Metadata. |
| inspect
| Examines the CloudFormation resource and discloses attributes. |
---
##### \`toString\`
\`\`\`typescript
public toString(): string
\`\`\`
Returns a string representation of this construct.
##### \`overrideLogicalId\`
\`\`\`typescript
public overrideLogicalId(newLogicalId: string): void
\`\`\`
Overrides the auto-generated logical ID with a specific ID.
###### \`newLogicalId\`Required
- *Type:* string
The new logical ID to use for this stack element.
---
##### \`addDeletionOverride\`
\`\`\`typescript
public addDeletionOverride(path: string): void
\`\`\`
Syntactic sugar for \`addOverride(path, undefined)\`.
###### \`path\`Required
- *Type:* string
The path of the value to delete.
---
##### \`addDependsOn\`
\`\`\`typescript
public addDependsOn(target: CfnResource): void
\`\`\`
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries
and the dependency will automatically be transferred to the relevant scope.
###### \`target\`Required
- *Type:* CfnResource
---
##### \`addMetadata\`
\`\`\`typescript
public addMetadata(key: string, value: any): void
\`\`\`
Add a value to the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* string
---
###### \`value\`Required
- *Type:* any
---
##### \`addOverride\`
\`\`\`typescript
public addOverride(path: string, value: any): void
\`\`\`
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use \`addPropertyOverride\` or prefix \`path\` with
"Properties." (i.e. \`Properties.TopicName\`).
If the override is nested, separate each nested level using a dot (.) in the path parameter.
If there is an array as part of the nesting, specify the index in the path.
To include a literal \`.\` in the property name, prefix with a \`\\\`. In most
programming languages you will need to write this as \`"\\\\."\` because the
\`\\\` itself will need to be escaped.
For example,
\`\`\`typescript
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
\`\`\`
would add the overrides
\`\`\`json
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
\`\`\`
###### \`path\`Required
- *Type:* string
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys
will be created as needed.
---
###### \`value\`Required
- *Type:* any
The value.
Could be primitive or complex.
---
##### \`addPropertyDeletionOverride\`
\`\`\`typescript
public addPropertyDeletionOverride(propertyPath: string): void
\`\`\`
Adds an override that deletes the value of a property from the resource definition.
###### \`propertyPath\`Required
- *Type:* string
The path to the property.
---
##### \`addPropertyOverride\`
\`\`\`typescript
public addPropertyOverride(propertyPath: string, value: any): void
\`\`\`
Adds an override to a resource property.
Syntactic sugar for \`addOverride("Properties.<...>", value)\`.
###### \`propertyPath\`Required
- *Type:* string
The path of the property.
---
###### \`value\`Required
- *Type:* any
The value.
---
##### \`applyRemovalPolicy\`
\`\`\`typescript
public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void
\`\`\`
Sets the deletion policy of the resource based on the removal policy specified.
###### \`policy\`Optional
- *Type:* RemovalPolicy
---
###### \`options\`Optional
- *Type:* RemovalPolicyOptions
---
##### \`getAtt\`
\`\`\`typescript
public getAtt(attributeName: string): Reference
\`\`\`
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. \`resource.arn\`), but this can be used for future compatibility
in case there is no generated attribute.
###### \`attributeName\`Required
- *Type:* string
The name of the attribute.
---
##### \`getMetadata\`
\`\`\`typescript
public getMetadata(key: string): any
\`\`\`
Retrieve a value value from the CloudFormation Resource Metadata.
> [https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this
metadata ends up in the stack template under the resource, whereas CDK
node metadata ends up in the Cloud Assembly.)
###### \`key\`Required
- *Type:* string
---
##### \`inspect\`
\`\`\`typescript
public inspect(inspector: TreeInspector): void
\`\`\`
Examines the CloudFormation resource and discloses attributes.
###### \`inspector\`Required
- *Type:* TreeInspector
tree inspector to collect and process attributes.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isCfnElement
| Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template). |
| isCfnResource
| Check whether the given construct is a CfnResource. |
---
##### \`isConstruct\`
\`\`\`typescript
import { CfnRepository } from '@aws-cdk/aws-ecr'
CfnRepository.isConstruct(x: any)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* any
---
##### \`isCfnElement\`
\`\`\`typescript
import { CfnRepository } from '@aws-cdk/aws-ecr'
CfnRepository.isCfnElement(x: any)
\`\`\`
Returns \`true\` if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of \`instanceof\` to allow stack elements from different
versions of this library to be included in the same stack.
###### \`x\`Required
- *Type:* any
---
##### \`isCfnResource\`
\`\`\`typescript
import { CfnRepository } from '@aws-cdk/aws-ecr'
CfnRepository.isCfnResource(construct: IConstruct)
\`\`\`
Check whether the given construct is a CfnResource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| creationStack
| string[]
| *No description.* |
| logicalId
| string
| The logical ID for this CloudFormation stack element. |
| stack
| Stack
| The stack in which this element is defined. |
| ref
| string
| Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element. |
| cfnOptions
| ICfnResourceOptions
| Options for this resource, such as condition, update policy etc. |
| cfnResourceType
| string
| AWS resource type. |
| attrArn
| string
| *No description.* |
| attrRepositoryUri
| string
| *No description.* |
| tags
| TagManager
| \`AWS::ECR::Repository.Tags\`. |
| encryptionConfiguration
| any
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| imageScanningConfiguration
| any
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| repositoryPolicyText
| any
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| imageTagMutability
| string
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| lifecyclePolicy
| IResolvable \\| LifecyclePolicyProperty
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| repositoryName
| string
| \`AWS::ECR::Repository.RepositoryName\`. |
---
##### \`node\`Required
\`\`\`typescript
public readonly node: ConstructNode;
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`creationStack\`Required
\`\`\`typescript
public readonly creationStack: string[];
\`\`\`
- *Type:* string[]
---
##### \`logicalId\`Required
\`\`\`typescript
public readonly logicalId: string;
\`\`\`
- *Type:* string
The logical ID for this CloudFormation stack element.
The logical ID of the element
is calculated from the path of the resource node in the construct tree.
To override this value, use \`overrideLogicalId(newLogicalId)\`.
---
##### \`stack\`Required
\`\`\`typescript
public readonly stack: Stack;
\`\`\`
- *Type:* Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
---
##### \`ref\`Required
\`\`\`typescript
public readonly ref: string;
\`\`\`
- *Type:* string
Return a string that will be resolved to a CloudFormation \`{ Ref }\` for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through \`Lazy.any({ produce: resource.ref })\`.
---
##### \`cfnOptions\`Required
\`\`\`typescript
public readonly cfnOptions: ICfnResourceOptions;
\`\`\`
- *Type:* ICfnResourceOptions
Options for this resource, such as condition, update policy etc.
---
##### \`cfnResourceType\`Required
\`\`\`typescript
public readonly cfnResourceType: string;
\`\`\`
- *Type:* string
AWS resource type.
---
##### \`attrArn\`Required
\`\`\`typescript
public readonly attrArn: string;
\`\`\`
- *Type:* string
---
##### \`attrRepositoryUri\`Required
\`\`\`typescript
public readonly attrRepositoryUri: string;
\`\`\`
- *Type:* string
---
##### \`tags\`Required
\`\`\`typescript
public readonly tags: TagManager;
\`\`\`
- *Type:* TagManager
\`AWS::ECR::Repository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
---
##### \`encryptionConfiguration\`Required
\`\`\`typescript
public readonly encryptionConfiguration: any;
\`\`\`
- *Type:* any
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`imageScanningConfiguration\`Required
\`\`\`typescript
public readonly imageScanningConfiguration: any;
\`\`\`
- *Type:* any
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`repositoryPolicyText\`Required
\`\`\`typescript
public readonly repositoryPolicyText: any;
\`\`\`
- *Type:* any
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`imageTagMutability\`Optional
\`\`\`typescript
public readonly imageTagMutability: string;
\`\`\`
- *Type:* string
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`lifecyclePolicy\`Optional
\`\`\`typescript
public readonly lifecyclePolicy: IResolvable | LifecyclePolicyProperty;
\`\`\`
- *Type:* IResolvable | LifecyclePolicyProperty
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`repositoryName\`Optional
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
#### Constants
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| CFN_RESOURCE_TYPE_NAME
| string
| The CloudFormation resource type name for this resource class. |
---
##### \`CFN_RESOURCE_TYPE_NAME\`Required
\`\`\`typescript
public readonly CFN_RESOURCE_TYPE_NAME: string;
\`\`\`
- *Type:* string
The CloudFormation resource type name for this resource class.
---
### Repository
Define an ECR repository.
#### Initializers
\`\`\`typescript
import { Repository } from '@aws-cdk/aws-ecr'
new Repository(scope: Construct, id: string, props?: RepositoryProps)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| *No description.* |
| id
| string
| *No description.* |
| props
| RepositoryProps
| *No description.* |
---
##### \`scope\`Required
- *Type:* Construct
---
##### \`id\`Required
- *Type:* string
---
##### \`props\`Optional
- *Type:* RepositoryProps
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| applyRemovalPolicy
| Apply the given removal policy to this resource. |
| addToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grantPull
| Grant the given identity permissions to use the images in this repository. |
| grantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| onCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| onCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| onEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| onImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed. |
| repositoryUriForDigest
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| repositoryUriForTag
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| addLifecycleRule
| Add a life cycle rule to the repository. |
---
##### \`toString\`
\`\`\`typescript
public toString(): string
\`\`\`
Returns a string representation of this construct.
##### \`applyRemovalPolicy\`
\`\`\`typescript
public applyRemovalPolicy(policy: RemovalPolicy): void
\`\`\`
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (\`RemovalPolicy.DELETE\`), or left in your AWS
account for data recovery and cleanup later (\`RemovalPolicy.RETAIN\`).
###### \`policy\`Required
- *Type:* RemovalPolicy
---
##### \`addToResourcePolicy\`
\`\`\`typescript
public addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResult
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`typescript
public grant(grantee: IGrantable, actions: string): Grant
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* string
---
##### \`grantPull\`
\`\`\`typescript
public grantPull(grantee: IGrantable): Grant
\`\`\`
Grant the given identity permissions to use the images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grantPullPush\`
\`\`\`typescript
public grantPullPush(grantee: IGrantable): Grant
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`onCloudTrailEvent\`
\`\`\`typescript
public onCloudTrailEvent(id: string, options?: OnEventOptions): Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`onCloudTrailImagePushed\`
\`\`\`typescript
public onCloudTrailImagePushed(id: string, options?: OnCloudTrailImagePushedOptions): Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`onEvent\`
\`\`\`typescript
public onEvent(id: string, options?: OnEventOptions): Rule
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* string
---
###### \`options\`Optional
- *Type:* OnEventOptions
---
##### \`onImageScanCompleted\`
\`\`\`typescript
public onImageScanCompleted(id: string, options?: OnImageScanCompletedOptions): Rule
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`repositoryUriForDigest\`
\`\`\`typescript
public repositoryUriForDigest(digest?: string): string
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* string
Optional image digest.
---
##### \`repositoryUriForTag\`
\`\`\`typescript
public repositoryUriForTag(tag?: string): string
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
###### \`tag\`Optional
- *Type:* string
Optional image tag.
---
##### \`addLifecycleRule\`
\`\`\`typescript
public addLifecycleRule(rule: LifecycleRule): void
\`\`\`
Add a life cycle rule to the repository.
Life cycle rules automatically expire images from the repository that match
certain conditions.
###### \`rule\`Required
- *Type:* LifecycleRule
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isResource
| Check whether the given construct is a Resource. |
| arnForLocalRepository
| Returns an ECR ARN for a repository that resides in the same account/region as the current stack. |
| fromRepositoryArn
| *No description.* |
| fromRepositoryAttributes
| Import a repository. |
| fromRepositoryName
| *No description.* |
---
##### \`isConstruct\`
\`\`\`typescript
import { Repository } from '@aws-cdk/aws-ecr'
Repository.isConstruct(x: any)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* any
---
##### \`isResource\`
\`\`\`typescript
import { Repository } from '@aws-cdk/aws-ecr'
Repository.isResource(construct: IConstruct)
\`\`\`
Check whether the given construct is a Resource.
###### \`construct\`Required
- *Type:* IConstruct
---
##### \`arnForLocalRepository\`
\`\`\`typescript
import { Repository } from '@aws-cdk/aws-ecr'
Repository.arnForLocalRepository(repositoryName: string, scope: IConstruct, account?: string)
\`\`\`
Returns an ECR ARN for a repository that resides in the same account/region as the current stack.
###### \`repositoryName\`Required
- *Type:* string
---
###### \`scope\`Required
- *Type:* IConstruct
---
###### \`account\`Optional
- *Type:* string
---
##### \`fromRepositoryArn\`
\`\`\`typescript
import { Repository } from '@aws-cdk/aws-ecr'
Repository.fromRepositoryArn(scope: Construct, id: string, repositoryArn: string)
\`\`\`
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* string
---
###### \`repositoryArn\`Required
- *Type:* string
---
##### \`fromRepositoryAttributes\`
\`\`\`typescript
import { Repository } from '@aws-cdk/aws-ecr'
Repository.fromRepositoryAttributes(scope: Construct, id: string, attrs: RepositoryAttributes)
\`\`\`
Import a repository.
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* string
---
###### \`attrs\`Required
- *Type:* RepositoryAttributes
---
##### \`fromRepositoryName\`
\`\`\`typescript
import { Repository } from '@aws-cdk/aws-ecr'
Repository.fromRepositoryName(scope: Construct, id: string, repositoryName: string)
\`\`\`
###### \`scope\`Required
- *Type:* Construct
---
###### \`id\`Required
- *Type:* string
---
###### \`repositoryName\`Required
- *Type:* string
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repositoryArn
| string
| The ARN of the repository. |
| repositoryName
| string
| The name of the repository. |
| repositoryUri
| string
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`typescript
public readonly node: ConstructNode;
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`env\`Required
\`\`\`typescript
public readonly env: ResourceEnvironment;
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`typescript
public readonly stack: Stack;
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repositoryArn\`Required
\`\`\`typescript
public readonly repositoryArn: string;
\`\`\`
- *Type:* string
The ARN of the repository.
---
##### \`repositoryName\`Required
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
The name of the repository.
---
##### \`repositoryUri\`Required
\`\`\`typescript
public readonly repositoryUri: string;
\`\`\`
- *Type:* string
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
### RepositoryBase
- *Implements:* IRepository
Base class for ECR repository.
Reused between imported repositories and owned repositories.
#### Initializers
\`\`\`typescript
import { RepositoryBase } from '@aws-cdk/aws-ecr'
new RepositoryBase(scope: Construct, id: string, props?: ResourceProps)
\`\`\`
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| scope
| Construct
| *No description.* |
| id
| string
| *No description.* |
| props
| ResourceProps
| *No description.* |
---
##### \`scope\`Required
- *Type:* Construct
---
##### \`id\`Required
- *Type:* string
---
##### \`props\`Optional
- *Type:* ResourceProps
---
#### Methods
| **Name** | **Description** |
| --- | --- |
| toString
| Returns a string representation of this construct. |
| applyRemovalPolicy
| Apply the given removal policy to this resource. |
| addToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grantPull
| Grant the given identity permissions to use the images in this repository. |
| grantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| onCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| onCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| onEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| onImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed. |
| repositoryUriForDigest
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
| repositoryUriForTag
| Returns the URL of the repository. Can be used in \`docker push/pull\`. |
---
##### \`toString\`
\`\`\`typescript
public toString(): string
\`\`\`
Returns a string representation of this construct.
##### \`applyRemovalPolicy\`
\`\`\`typescript
public applyRemovalPolicy(policy: RemovalPolicy): void
\`\`\`
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops
being managed by CloudFormation, either because you've removed it from the
CDK application or because you've made a change that requires the resource
to be replaced.
The resource can be deleted (\`RemovalPolicy.DELETE\`), or left in your AWS
account for data recovery and cleanup later (\`RemovalPolicy.RETAIN\`).
###### \`policy\`Required
- *Type:* RemovalPolicy
---
##### \`addToResourcePolicy\`
\`\`\`typescript
public addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResult
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`typescript
public grant(grantee: IGrantable, actions: string): Grant
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* string
---
##### \`grantPull\`
\`\`\`typescript
public grantPull(grantee: IGrantable): Grant
\`\`\`
Grant the given identity permissions to use the images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grantPullPush\`
\`\`\`typescript
public grantPullPush(grantee: IGrantable): Grant
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`onCloudTrailEvent\`
\`\`\`typescript
public onCloudTrailEvent(id: string, options?: OnEventOptions): Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`onCloudTrailImagePushed\`
\`\`\`typescript
public onCloudTrailImagePushed(id: string, options?: OnCloudTrailImagePushedOptions): Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`onEvent\`
\`\`\`typescript
public onEvent(id: string, options?: OnEventOptions): Rule
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* string
---
###### \`options\`Optional
- *Type:* OnEventOptions
---
##### \`onImageScanCompleted\`
\`\`\`typescript
public onImageScanCompleted(id: string, options?: OnImageScanCompletedOptions): Rule
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when an image scan is completed.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`repositoryUriForDigest\`
\`\`\`typescript
public repositoryUriForDigest(digest?: string): string
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* string
Optional image digest.
---
##### \`repositoryUriForTag\`
\`\`\`typescript
public repositoryUriForTag(tag?: string): string
\`\`\`
Returns the URL of the repository. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[:TAG]
###### \`tag\`Optional
- *Type:* string
Optional image tag.
---
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| isConstruct
| Return whether the given object is a Construct. |
| isResource
| Check whether the given construct is a Resource. |
---
##### \`isConstruct\`
\`\`\`typescript
import { RepositoryBase } from '@aws-cdk/aws-ecr'
RepositoryBase.isConstruct(x: any)
\`\`\`
Return whether the given object is a Construct.
###### \`x\`Required
- *Type:* any
---
##### \`isResource\`
\`\`\`typescript
import { RepositoryBase } from '@aws-cdk/aws-ecr'
RepositoryBase.isResource(construct: IConstruct)
\`\`\`
Check whether the given construct is a Resource.
###### \`construct\`Required
- *Type:* IConstruct
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node associated with this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repositoryArn
| string
| The ARN of the repository. |
| repositoryName
| string
| The name of the repository. |
| repositoryUri
| string
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`typescript
public readonly node: ConstructNode;
\`\`\`
- *Type:* ConstructNode
The construct tree node associated with this construct.
---
##### \`env\`Required
\`\`\`typescript
public readonly env: ResourceEnvironment;
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`typescript
public readonly stack: Stack;
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repositoryArn\`Required
\`\`\`typescript
public readonly repositoryArn: string;
\`\`\`
- *Type:* string
The ARN of the repository.
---
##### \`repositoryName\`Required
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
The name of the repository.
---
##### \`repositoryUri\`Required
\`\`\`typescript
public readonly repositoryUri: string;
\`\`\`
- *Type:* string
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
## Structs
### CfnPublicRepositoryProps
Properties for defining a \`AWS::ECR::PublicRepository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html)
#### Initializer
\`\`\`typescript
import { CfnPublicRepositoryProps } from '@aws-cdk/aws-ecr'
const cfnPublicRepositoryProps: CfnPublicRepositoryProps = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| repositoryCatalogData
| any
| \`AWS::ECR::PublicRepository.RepositoryCatalogData\`. |
| repositoryName
| string
| \`AWS::ECR::PublicRepository.RepositoryName\`. |
| repositoryPolicyText
| any
| \`AWS::ECR::PublicRepository.RepositoryPolicyText\`. |
| tags
| CfnTag[]
| \`AWS::ECR::PublicRepository.Tags\`. |
---
##### \`repositoryCatalogData\`Optional
\`\`\`typescript
public readonly repositoryCatalogData: any;
\`\`\`
- *Type:* any
\`AWS::ECR::PublicRepository.RepositoryCatalogData\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorycatalogdata)
---
##### \`repositoryName\`Optional
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
\`AWS::ECR::PublicRepository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositoryname)
---
##### \`repositoryPolicyText\`Optional
\`\`\`typescript
public readonly repositoryPolicyText: any;
\`\`\`
- *Type:* any
\`AWS::ECR::PublicRepository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-repositorypolicytext)
---
##### \`tags\`Optional
\`\`\`typescript
public readonly tags: CfnTag[];
\`\`\`
- *Type:* CfnTag[]
\`AWS::ECR::PublicRepository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-publicrepository.html#cfn-ecr-publicrepository-tags)
---
### CfnRegistryPolicyProps
Properties for defining a \`AWS::ECR::RegistryPolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html)
#### Initializer
\`\`\`typescript
import { CfnRegistryPolicyProps } from '@aws-cdk/aws-ecr'
const cfnRegistryPolicyProps: CfnRegistryPolicyProps = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| policyText
| any
| \`AWS::ECR::RegistryPolicy.PolicyText\`. |
---
##### \`policyText\`Required
\`\`\`typescript
public readonly policyText: any;
\`\`\`
- *Type:* any
\`AWS::ECR::RegistryPolicy.PolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-registrypolicy.html#cfn-ecr-registrypolicy-policytext)
---
### CfnReplicationConfigurationProps
Properties for defining a \`AWS::ECR::ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html)
#### Initializer
\`\`\`typescript
import { CfnReplicationConfigurationProps } from '@aws-cdk/aws-ecr'
const cfnReplicationConfigurationProps: CfnReplicationConfigurationProps = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| replicationConfiguration
| IResolvable \\| ReplicationConfigurationProperty
| \`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`. |
---
##### \`replicationConfiguration\`Required
\`\`\`typescript
public readonly replicationConfiguration: IResolvable | ReplicationConfigurationProperty;
\`\`\`
- *Type:* IResolvable | ReplicationConfigurationProperty
\`AWS::ECR::ReplicationConfiguration.ReplicationConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration)
---
### CfnRepositoryProps
Properties for defining a \`AWS::ECR::Repository\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html)
#### Initializer
\`\`\`typescript
import { CfnRepositoryProps } from '@aws-cdk/aws-ecr'
const cfnRepositoryProps: CfnRepositoryProps = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| encryptionConfiguration
| any
| \`AWS::ECR::Repository.EncryptionConfiguration\`. |
| imageScanningConfiguration
| any
| \`AWS::ECR::Repository.ImageScanningConfiguration\`. |
| imageTagMutability
| string
| \`AWS::ECR::Repository.ImageTagMutability\`. |
| lifecyclePolicy
| IResolvable \\| LifecyclePolicyProperty
| \`AWS::ECR::Repository.LifecyclePolicy\`. |
| repositoryName
| string
| \`AWS::ECR::Repository.RepositoryName\`. |
| repositoryPolicyText
| any
| \`AWS::ECR::Repository.RepositoryPolicyText\`. |
| tags
| CfnTag[]
| \`AWS::ECR::Repository.Tags\`. |
---
##### \`encryptionConfiguration\`Optional
\`\`\`typescript
public readonly encryptionConfiguration: any;
\`\`\`
- *Type:* any
\`AWS::ECR::Repository.EncryptionConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-encryptionconfiguration)
---
##### \`imageScanningConfiguration\`Optional
\`\`\`typescript
public readonly imageScanningConfiguration: any;
\`\`\`
- *Type:* any
\`AWS::ECR::Repository.ImageScanningConfiguration\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagescanningconfiguration)
---
##### \`imageTagMutability\`Optional
\`\`\`typescript
public readonly imageTagMutability: string;
\`\`\`
- *Type:* string
\`AWS::ECR::Repository.ImageTagMutability\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-imagetagmutability)
---
##### \`lifecyclePolicy\`Optional
\`\`\`typescript
public readonly lifecyclePolicy: IResolvable | LifecyclePolicyProperty;
\`\`\`
- *Type:* IResolvable | LifecyclePolicyProperty
\`AWS::ECR::Repository.LifecyclePolicy\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-lifecyclepolicy)
---
##### \`repositoryName\`Optional
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
\`AWS::ECR::Repository.RepositoryName\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositoryname)
---
##### \`repositoryPolicyText\`Optional
\`\`\`typescript
public readonly repositoryPolicyText: any;
\`\`\`
- *Type:* any
\`AWS::ECR::Repository.RepositoryPolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-repositorypolicytext)
---
##### \`tags\`Optional
\`\`\`typescript
public readonly tags: CfnTag[];
\`\`\`
- *Type:* CfnTag[]
\`AWS::ECR::Repository.Tags\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html#cfn-ecr-repository-tags)
---
### LifecyclePolicyProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html)
#### Initializer
\`\`\`typescript
import { LifecyclePolicyProperty } from '@aws-cdk/aws-ecr'
const lifecyclePolicyProperty: LifecyclePolicyProperty = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| lifecyclePolicyText
| string
| \`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`. |
| registryId
| string
| \`CfnRepository.LifecyclePolicyProperty.RegistryId\`. |
---
##### \`lifecyclePolicyText\`Optional
\`\`\`typescript
public readonly lifecyclePolicyText: string;
\`\`\`
- *Type:* string
\`CfnRepository.LifecyclePolicyProperty.LifecyclePolicyText\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-lifecyclepolicytext)
---
##### \`registryId\`Optional
\`\`\`typescript
public readonly registryId: string;
\`\`\`
- *Type:* string
\`CfnRepository.LifecyclePolicyProperty.RegistryId\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-repository-lifecyclepolicy.html#cfn-ecr-repository-lifecyclepolicy-registryid)
---
### LifecycleRule
An ECR life cycle rule.
#### Initializer
\`\`\`typescript
import { LifecycleRule } from '@aws-cdk/aws-ecr'
const lifecycleRule: LifecycleRule = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| description
| string
| Describes the purpose of the rule. |
| maxImageAge
| Duration
| The maximum age of images to retain. The value must represent a number of days. |
| maxImageCount
| number
| The maximum number of images to retain. |
| rulePriority
| number
| Controls the order in which rules are evaluated (low to high). |
| tagPrefixList
| string[]
| Select images that have ALL the given prefixes in their tag. |
| tagStatus
| TagStatus
| Select images based on tags. |
---
##### \`description\`Optional
\`\`\`typescript
public readonly description: string;
\`\`\`
- *Type:* string
- *Default:* No description
Describes the purpose of the rule.
---
##### \`maxImageAge\`Optional
\`\`\`typescript
public readonly maxImageAge: Duration;
\`\`\`
- *Type:* Duration
The maximum age of images to retain. The value must represent a number of days.
Specify exactly one of maxImageCount and maxImageAge.
---
##### \`maxImageCount\`Optional
\`\`\`typescript
public readonly maxImageCount: number;
\`\`\`
- *Type:* number
The maximum number of images to retain.
Specify exactly one of maxImageCount and maxImageAge.
---
##### \`rulePriority\`Optional
\`\`\`typescript
public readonly rulePriority: number;
\`\`\`
- *Type:* number
- *Default:* Automatically assigned
Controls the order in which rules are evaluated (low to high).
All rules must have a unique priority, where lower numbers have
higher precedence. The first rule that matches is applied to an image.
There can only be one rule with a tagStatus of Any, and it must have
the highest rulePriority.
All rules without a specified priority will have incrementing priorities
automatically assigned to them, higher than any rules that DO have priorities.
---
##### \`tagPrefixList\`Optional
\`\`\`typescript
public readonly tagPrefixList: string[];
\`\`\`
- *Type:* string[]
Select images that have ALL the given prefixes in their tag.
Only if tagStatus == TagStatus.Tagged
---
##### \`tagStatus\`Optional
\`\`\`typescript
public readonly tagStatus: TagStatus;
\`\`\`
- *Type:* TagStatus
- *Default:* TagStatus.Tagged if tagPrefixList is given, TagStatus.Any otherwise
Select images based on tags.
Only one rule is allowed to select untagged images, and it must
have the highest rulePriority.
---
### OnCloudTrailImagePushedOptions
Options for the onCloudTrailImagePushed method.
#### Initializer
\`\`\`typescript
import { OnCloudTrailImagePushedOptions } from '@aws-cdk/aws-ecr'
const onCloudTrailImagePushedOptions: OnCloudTrailImagePushedOptions = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| description
| string
| A description of the rule's purpose. |
| eventPattern
| EventPattern
| Additional restrictions for the event to route to the specified target. |
| ruleName
| string
| A name for the rule. |
| target
| IRuleTarget
| The target to register for the event. |
| imageTag
| string
| Only watch changes to this image tag. |
---
##### \`description\`Optional
\`\`\`typescript
public readonly description: string;
\`\`\`
- *Type:* string
- *Default:* No description
A description of the rule's purpose.
---
##### \`eventPattern\`Optional
\`\`\`typescript
public readonly eventPattern: EventPattern;
\`\`\`
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
##### \`ruleName\`Optional
\`\`\`typescript
public readonly ruleName: string;
\`\`\`
- *Type:* string
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
##### \`target\`Optional
\`\`\`typescript
public readonly target: IRuleTarget;
\`\`\`
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`imageTag\`Optional
\`\`\`typescript
public readonly imageTag: string;
\`\`\`
- *Type:* string
- *Default:* Watch changes to all tags
Only watch changes to this image tag.
---
### OnImageScanCompletedOptions
Options for the OnImageScanCompleted method.
#### Initializer
\`\`\`typescript
import { OnImageScanCompletedOptions } from '@aws-cdk/aws-ecr'
const onImageScanCompletedOptions: OnImageScanCompletedOptions = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| description
| string
| A description of the rule's purpose. |
| eventPattern
| EventPattern
| Additional restrictions for the event to route to the specified target. |
| ruleName
| string
| A name for the rule. |
| target
| IRuleTarget
| The target to register for the event. |
| imageTags
| string[]
| Only watch changes to the image tags spedified. |
---
##### \`description\`Optional
\`\`\`typescript
public readonly description: string;
\`\`\`
- *Type:* string
- *Default:* No description
A description of the rule's purpose.
---
##### \`eventPattern\`Optional
\`\`\`typescript
public readonly eventPattern: EventPattern;
\`\`\`
- *Type:* EventPattern
- *Default:* No additional filtering based on an event pattern.
Additional restrictions for the event to route to the specified target.
The method that generates the rule probably imposes some type of event
filtering. The filtering implied by what you pass here is added
on top of that filtering.
> [https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html](https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html)
---
##### \`ruleName\`Optional
\`\`\`typescript
public readonly ruleName: string;
\`\`\`
- *Type:* string
- *Default:* AWS CloudFormation generates a unique physical ID.
A name for the rule.
---
##### \`target\`Optional
\`\`\`typescript
public readonly target: IRuleTarget;
\`\`\`
- *Type:* IRuleTarget
- *Default:* No target is added to the rule. Use \`addTarget()\` to add a target.
The target to register for the event.
---
##### \`imageTags\`Optional
\`\`\`typescript
public readonly imageTags: string[];
\`\`\`
- *Type:* string[]
- *Default:* Watch the changes to the repository with all image tags
Only watch changes to the image tags spedified.
Leave it undefined to watch the full repository.
---
### ReplicationConfigurationProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html)
#### Initializer
\`\`\`typescript
import { ReplicationConfigurationProperty } from '@aws-cdk/aws-ecr'
const replicationConfigurationProperty: ReplicationConfigurationProperty = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| rules
| IResolvable \\| IResolvable \\| ReplicationRuleProperty[]
| \`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`. |
---
##### \`rules\`Required
\`\`\`typescript
public readonly rules: IResolvable | IResolvable | ReplicationRuleProperty[];
\`\`\`
- *Type:* IResolvable | IResolvable | ReplicationRuleProperty[]
\`CfnReplicationConfiguration.ReplicationConfigurationProperty.Rules\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationconfiguration.html#cfn-ecr-replicationconfiguration-replicationconfiguration-rules)
---
### ReplicationDestinationProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html)
#### Initializer
\`\`\`typescript
import { ReplicationDestinationProperty } from '@aws-cdk/aws-ecr'
const replicationDestinationProperty: ReplicationDestinationProperty = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| region
| string
| \`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`. |
| registryId
| string
| \`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`. |
---
##### \`region\`Required
\`\`\`typescript
public readonly region: string;
\`\`\`
- *Type:* string
\`CfnReplicationConfiguration.ReplicationDestinationProperty.Region\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-region)
---
##### \`registryId\`Required
\`\`\`typescript
public readonly registryId: string;
\`\`\`
- *Type:* string
\`CfnReplicationConfiguration.ReplicationDestinationProperty.RegistryId\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationdestination.html#cfn-ecr-replicationconfiguration-replicationdestination-registryid)
---
### ReplicationRuleProperty
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html)
#### Initializer
\`\`\`typescript
import { ReplicationRuleProperty } from '@aws-cdk/aws-ecr'
const replicationRuleProperty: ReplicationRuleProperty = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| destinations
| IResolvable \\| IResolvable \\| ReplicationDestinationProperty[]
| \`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`. |
---
##### \`destinations\`Required
\`\`\`typescript
public readonly destinations: IResolvable | IResolvable | ReplicationDestinationProperty[];
\`\`\`
- *Type:* IResolvable | IResolvable | ReplicationDestinationProperty[]
\`CfnReplicationConfiguration.ReplicationRuleProperty.Destinations\`.
> [http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecr-replicationconfiguration-replicationrule.html#cfn-ecr-replicationconfiguration-replicationrule-destinations)
---
### RepositoryAttributes
#### Initializer
\`\`\`typescript
import { RepositoryAttributes } from '@aws-cdk/aws-ecr'
const repositoryAttributes: RepositoryAttributes = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| repositoryArn
| string
| *No description.* |
| repositoryName
| string
| *No description.* |
---
##### \`repositoryArn\`Required
\`\`\`typescript
public readonly repositoryArn: string;
\`\`\`
- *Type:* string
---
##### \`repositoryName\`Required
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
---
### RepositoryProps
#### Initializer
\`\`\`typescript
import { RepositoryProps } from '@aws-cdk/aws-ecr'
const repositoryProps: RepositoryProps = { ... }
\`\`\`
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| imageScanOnPush
| boolean
| Enable the scan on push when creating the repository. |
| imageTagMutability
| TagMutability
| The tag mutability setting for the repository. |
| lifecycleRegistryId
| string
| The AWS account ID associated with the registry that contains the repository. |
| lifecycleRules
| LifecycleRule[]
| Life cycle rules to apply to this registry. |
| removalPolicy
| RemovalPolicy
| Determine what happens to the repository when the resource/stack is deleted. |
| repositoryName
| string
| Name for this repository. |
---
##### \`imageScanOnPush\`Optional
\`\`\`typescript
public readonly imageScanOnPush: boolean;
\`\`\`
- *Type:* boolean
- *Default:* false
Enable the scan on push when creating the repository.
---
##### \`imageTagMutability\`Optional
\`\`\`typescript
public readonly imageTagMutability: TagMutability;
\`\`\`
- *Type:* TagMutability
- *Default:* TagMutability.MUTABLE
The tag mutability setting for the repository.
If this parameter is omitted, the default setting of MUTABLE will be used which will allow image tags to be overwritten.
---
##### \`lifecycleRegistryId\`Optional
\`\`\`typescript
public readonly lifecycleRegistryId: string;
\`\`\`
- *Type:* string
- *Default:* The default registry is assumed.
The AWS account ID associated with the registry that contains the repository.
> [https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html](https://docs.aws.amazon.com/AmazonECR/latest/APIReference/API_PutLifecyclePolicy.html)
---
##### \`lifecycleRules\`Optional
\`\`\`typescript
public readonly lifecycleRules: LifecycleRule[];
\`\`\`
- *Type:* LifecycleRule[]
- *Default:* No life cycle rules
Life cycle rules to apply to this registry.
---
##### \`removalPolicy\`Optional
\`\`\`typescript
public readonly removalPolicy: RemovalPolicy;
\`\`\`
- *Type:* RemovalPolicy
- *Default:* RemovalPolicy.Retain
Determine what happens to the repository when the resource/stack is deleted.
---
##### \`repositoryName\`Optional
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
- *Default:* Automatically generated name.
Name for this repository.
---
## Classes
### AuthorizationToken
Authorization token to access private ECR repositories in the current environment via Docker CLI.
> [https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html](https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html)
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| grantRead
| Grant access to retrieve an authorization token. |
---
##### \`grantRead\`
\`\`\`typescript
import { AuthorizationToken } from '@aws-cdk/aws-ecr'
AuthorizationToken.grantRead(grantee: IGrantable)
\`\`\`
Grant access to retrieve an authorization token.
###### \`grantee\`Required
- *Type:* IGrantable
---
### PublicGalleryAuthorizationToken
Authorization token to access the global public ECR Gallery via Docker CLI.
> [https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth](https://docs.aws.amazon.com/AmazonECR/latest/public/public-registries.html#public-registry-auth)
#### Static Functions
| **Name** | **Description** |
| --- | --- |
| grantRead
| Grant access to retrieve an authorization token. |
---
##### \`grantRead\`
\`\`\`typescript
import { PublicGalleryAuthorizationToken } from '@aws-cdk/aws-ecr'
PublicGalleryAuthorizationToken.grantRead(grantee: IGrantable)
\`\`\`
Grant access to retrieve an authorization token.
###### \`grantee\`Required
- *Type:* IGrantable
---
## Protocols
### IRepository
- *Extends:* IResource
- *Implemented By:* Repository, RepositoryBase, IRepository
Represents an ECR repository.
#### Methods
| **Name** | **Description** |
| --- | --- |
| addToResourcePolicy
| Add a policy statement to the repository's resource policy. |
| grant
| Grant the given principal identity permissions to perform the actions on this repository. |
| grantPull
| Grant the given identity permissions to pull images in this repository. |
| grantPullPush
| Grant the given identity permissions to pull and push images to this repository. |
| onCloudTrailEvent
| Define a CloudWatch event that triggers when something happens to this repository. |
| onCloudTrailImagePushed
| Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this repository. |
| onEvent
| Defines a CloudWatch event rule which triggers for repository events. |
| onImageScanCompleted
| Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed. |
| repositoryUriForDigest
| Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`. |
| repositoryUriForTag
| Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`. |
---
##### \`addToResourcePolicy\`
\`\`\`typescript
public addToResourcePolicy(statement: PolicyStatement): AddToResourcePolicyResult
\`\`\`
Add a policy statement to the repository's resource policy.
###### \`statement\`Required
- *Type:* PolicyStatement
---
##### \`grant\`
\`\`\`typescript
public grant(grantee: IGrantable, actions: string): Grant
\`\`\`
Grant the given principal identity permissions to perform the actions on this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
###### \`actions\`Required
- *Type:* string
---
##### \`grantPull\`
\`\`\`typescript
public grantPull(grantee: IGrantable): Grant
\`\`\`
Grant the given identity permissions to pull images in this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`grantPullPush\`
\`\`\`typescript
public grantPullPush(grantee: IGrantable): Grant
\`\`\`
Grant the given identity permissions to pull and push images to this repository.
###### \`grantee\`Required
- *Type:* IGrantable
---
##### \`onCloudTrailEvent\`
\`\`\`typescript
public onCloudTrailEvent(id: string, options?: OnEventOptions): Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnEventOptions
Options for adding the rule.
---
##### \`onCloudTrailImagePushed\`
\`\`\`typescript
public onCloudTrailImagePushed(id: string, options?: OnCloudTrailImagePushedOptions): Rule
\`\`\`
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.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnCloudTrailImagePushedOptions
Options for adding the rule.
---
##### \`onEvent\`
\`\`\`typescript
public onEvent(id: string, options?: OnEventOptions): Rule
\`\`\`
Defines a CloudWatch event rule which triggers for repository events.
Use
\`rule.addEventPattern(pattern)\` to specify a filter.
###### \`id\`Required
- *Type:* string
---
###### \`options\`Optional
- *Type:* OnEventOptions
---
##### \`onImageScanCompleted\`
\`\`\`typescript
public onImageScanCompleted(id: string, options?: OnImageScanCompletedOptions): Rule
\`\`\`
Defines an AWS CloudWatch event rule that can trigger a target when the image scan is completed.
###### \`id\`Required
- *Type:* string
The id of the rule.
---
###### \`options\`Optional
- *Type:* OnImageScanCompletedOptions
Options for adding the rule.
---
##### \`repositoryUriForDigest\`
\`\`\`typescript
public repositoryUriForDigest(digest?: string): string
\`\`\`
Returns the URI of the repository for a certain tag. Can be used in \`docker push/pull\`.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY[@DIGEST]
###### \`digest\`Optional
- *Type:* string
Image digest to use (tools usually default to the image with the "latest" tag if omitted).
---
##### \`repositoryUriForTag\`
\`\`\`typescript
public repositoryUriForTag(tag?: string): string
\`\`\`
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]
###### \`tag\`Optional
- *Type:* string
Image tag to use (tools usually default to "latest" if omitted).
---
#### Properties
| **Name** | **Type** | **Description** |
| --- | --- | --- |
| node
| ConstructNode
| The construct tree node for this construct. |
| env
| ResourceEnvironment
| The environment this resource belongs to. |
| stack
| Stack
| The stack in which this resource is defined. |
| repositoryArn
| string
| The ARN of the repository. |
| repositoryName
| string
| The name of the repository. |
| repositoryUri
| string
| The URI of this repository (represents the latest image):. |
---
##### \`node\`Required
\`\`\`typescript
public readonly node: ConstructNode;
\`\`\`
- *Type:* ConstructNode
The construct tree node for this construct.
---
##### \`env\`Required
\`\`\`typescript
public readonly env: ResourceEnvironment;
\`\`\`
- *Type:* ResourceEnvironment
The environment this resource belongs to.
For resources that are created and managed by the CDK
(generally, those created by creating new class instances like Role, Bucket, etc.),
this is always the same as the environment of the stack they belong to;
however, for imported resources
(those obtained from static methods like fromRoleArn, fromBucketName, etc.),
that might be different than the stack they were imported into.
---
##### \`stack\`Required
\`\`\`typescript
public readonly stack: Stack;
\`\`\`
- *Type:* Stack
The stack in which this resource is defined.
---
##### \`repositoryArn\`Required
\`\`\`typescript
public readonly repositoryArn: string;
\`\`\`
- *Type:* string
The ARN of the repository.
---
##### \`repositoryName\`Required
\`\`\`typescript
public readonly repositoryName: string;
\`\`\`
- *Type:* string
The name of the repository.
---
##### \`repositoryUri\`Required
\`\`\`typescript
public readonly repositoryUri: string;
\`\`\`
- *Type:* string
The URI of this repository (represents the latest image):.
ACCOUNT.dkr.ecr.REGION.amazonaws.com/REPOSITORY
---
## Enums
### TagMutability
The tag mutability setting for your repository.
#### Members
| **Name** | **Description** |
| --- | --- |
| MUTABLE
| allow image tags to be overwritten. |
| IMMUTABLE
| all image tags within the repository will be immutable which will prevent them from being overwritten. |
---
##### \`MUTABLE\`
allow image tags to be overwritten.
---
##### \`IMMUTABLE\`
all image tags within the repository will be immutable which will prevent them from being overwritten.
---
### TagStatus
Select images based on tags.
#### Members
| **Name** | **Description** |
| --- | --- |
| ANY
| Rule applies to all images. |
| TAGGED
| Rule applies to tagged images. |
| UNTAGGED
| Rule applies to untagged images. |
---
##### \`ANY\`
Rule applies to all images.
---
##### \`TAGGED\`
Rule applies to tagged images.
---
##### \`UNTAGGED\`
Rule applies to untagged images.
---
"
`;