Class CfnRepository
A CloudFormation AWS::ECR::Repository
.
Inherited Members
Namespace: Amazon.CDK.AWS.ECR
Assembly: Amazon.CDK.AWS.ECR.dll
Syntax (csharp)
public class CfnRepository : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnRepository
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
The AWS::ECR::Repository
resource specifies an Amazon Elastic Container Registry (Amazon ECR) repository, where users can push and pull Docker images, Open Container Initiative (OCI) images, and OCI compatible artifacts. For more information, see Amazon ECR private repositories in the Amazon ECR User Guide .
CloudformationResource: AWS::ECR::Repository
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecr-repository.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ECR;
var repositoryPolicyText;
var cfnRepository = new CfnRepository(this, "MyCfnRepository", new CfnRepositoryProps {
EncryptionConfiguration = new EncryptionConfigurationProperty {
EncryptionType = "encryptionType",
// the properties below are optional
KmsKey = "kmsKey"
},
ImageScanningConfiguration = new ImageScanningConfigurationProperty {
ScanOnPush = false
},
ImageTagMutability = "imageTagMutability",
LifecyclePolicy = new LifecyclePolicyProperty {
LifecyclePolicyText = "lifecyclePolicyText",
RegistryId = "registryId"
},
RepositoryName = "repositoryName",
RepositoryPolicyText = repositoryPolicyText,
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
});
Synopsis
Constructors
CfnRepository(Construct, String, ICfnRepositoryProps) | Create a new |
CfnRepository(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnRepository(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
AttrArn | Returns the Amazon Resource Name (ARN) for the specified |
AttrRepositoryUri | Returns the URI for the specified |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
EncryptionConfiguration | The encryption configuration for the repository. |
ImageScanningConfiguration | The image scanning configuration for the repository. |
ImageTagMutability | The tag mutability setting for the repository. |
LifecyclePolicy | Creates or updates a lifecycle policy. |
RepositoryName | The name to use for the repository. |
RepositoryPolicyText | The JSON repository policy text to apply to the repository. |
Tags | An array of key-value pairs to apply to this resource. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnRepository(Construct, String, ICfnRepositoryProps)
Create a new AWS::ECR::Repository
.
public CfnRepository(Construct scope, string id, ICfnRepositoryProps props = null)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnRepositoryProps
- resource properties.
CfnRepository(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnRepository(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnRepository(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnRepository(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AttrArn
Returns the Amazon Resource Name (ARN) for the specified AWS::ECR::Repository
resource.
public virtual string AttrArn { get; }
Property Value
System.String
Remarks
For example, arn:aws:ecr: eu-west-1 : 123456789012 :repository/ test-repository
.
CloudformationAttribute: Arn
AttrRepositoryUri
Returns the URI for the specified AWS::ECR::Repository
resource.
public virtual string AttrRepositoryUri { get; }
Property Value
System.String
Remarks
For example, 123456789012 .dkr.ecr. us-west-2 .amazonaws.com/repository
.
CloudformationAttribute: RepositoryUri
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
EncryptionConfiguration
The encryption configuration for the repository.
public virtual object EncryptionConfiguration { get; set; }
Property Value
System.Object
Remarks
This determines how the contents of your repository are encrypted at rest.
ImageScanningConfiguration
The image scanning configuration for the repository.
public virtual object ImageScanningConfiguration { get; set; }
Property Value
System.Object
Remarks
This determines whether images are scanned for known vulnerabilities after being pushed to the repository.
ImageTagMutability
The tag mutability setting for the repository.
public virtual string ImageTagMutability { get; set; }
Property Value
System.String
Remarks
If this parameter is omitted, the default setting of MUTABLE
will be used which will allow image tags to be overwritten. If IMMUTABLE
is specified, all image tags within the repository will be immutable which will prevent them from being overwritten.
LifecyclePolicy
Creates or updates a lifecycle policy.
public virtual object LifecyclePolicy { get; set; }
Property Value
System.Object
Remarks
For information about lifecycle policy syntax, see Lifecycle policy template .
RepositoryName
The name to use for the repository.
public virtual string RepositoryName { get; set; }
Property Value
System.String
Remarks
The repository name may be specified on its own (such as nginx-web-app
) or it can be prepended with a namespace to group the repository into a category (such as project-a/nginx-web-app
). If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the repository name. For more information, see Name type .
The repository name must start with a letter and can only contain lowercase letters, numbers, hyphens, underscores, and forward slashes.
If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
RepositoryPolicyText
The JSON repository policy text to apply to the repository.
public virtual object RepositoryPolicyText { get; set; }
Property Value
System.Object
Remarks
For more information, see Amazon ECR repository policies in the Amazon Elastic Container Registry User Guide .
Tags
An array of key-value pairs to apply to this resource.
public virtual TagManager Tags { get; }
Property Value
Remarks
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>