Skip to main content

Registry

Manages a Docker Registry

Sample Code#

The following code describes a repository with a policy and a replication configuration:

provider.ECR.makeRepository({
name: "my-registry",
properties: ({ config }) => ({
policyText: {
Version: "2012-10-17",
Statement: [
{
Sid: "st-1",
Effect: "Allow",
Principal: {
AWS: `arn:aws:iam::${config.accountId()}:root`,
},
Action: ["ecr:CreateRepository", "ecr:ReplicateImage"],
Resource: `arn:aws:ecr:${
config.region
}:${config.accountId()}:repository/*`,
},
],
},
replicationConfiguration: {
rules: [
{
destinations: [
{
region: "us-east-1",
registryId: config.accountId(),
},
],
},
],
},
}),
});

Full Examples#

Properties#