Skip to content

Commit e04cd1f

Browse files
author
awstools
committed
feat(client-ecr): This release adds Amazon ECR to Amazon ECR pull through cache rules support.
1 parent c2ccb07 commit e04cd1f

File tree

8 files changed

+234
-30
lines changed

8 files changed

+234
-30
lines changed

clients/client-ecr/src/commands/CreatePullThroughCacheRuleCommand.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ export interface CreatePullThroughCacheRuleCommandOutput extends CreatePullThrou
4242
* ecrRepositoryPrefix: "STRING_VALUE", // required
4343
* upstreamRegistryUrl: "STRING_VALUE", // required
4444
* registryId: "STRING_VALUE",
45-
* upstreamRegistry: "ecr-public" || "quay" || "k8s" || "docker-hub" || "github-container-registry" || "azure-container-registry" || "gitlab-container-registry",
45+
* upstreamRegistry: "ecr" || "ecr-public" || "quay" || "k8s" || "docker-hub" || "github-container-registry" || "azure-container-registry" || "gitlab-container-registry",
4646
* credentialArn: "STRING_VALUE",
47+
* customRoleArn: "STRING_VALUE",
48+
* upstreamRepositoryPrefix: "STRING_VALUE",
4749
* };
4850
* const command = new CreatePullThroughCacheRuleCommand(input);
4951
* const response = await client.send(command);
@@ -52,8 +54,10 @@ export interface CreatePullThroughCacheRuleCommandOutput extends CreatePullThrou
5254
* // upstreamRegistryUrl: "STRING_VALUE",
5355
* // createdAt: new Date("TIMESTAMP"),
5456
* // registryId: "STRING_VALUE",
55-
* // upstreamRegistry: "ecr-public" || "quay" || "k8s" || "docker-hub" || "github-container-registry" || "azure-container-registry" || "gitlab-container-registry",
57+
* // upstreamRegistry: "ecr" || "ecr-public" || "quay" || "k8s" || "docker-hub" || "github-container-registry" || "azure-container-registry" || "gitlab-container-registry",
5658
* // credentialArn: "STRING_VALUE",
59+
* // customRoleArn: "STRING_VALUE",
60+
* // upstreamRepositoryPrefix: "STRING_VALUE",
5761
* // };
5862
*
5963
* ```

clients/client-ecr/src/commands/DeletePullThroughCacheRuleCommand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ export interface DeletePullThroughCacheRuleCommandOutput extends DeletePullThrou
4747
* // createdAt: new Date("TIMESTAMP"),
4848
* // registryId: "STRING_VALUE",
4949
* // credentialArn: "STRING_VALUE",
50+
* // customRoleArn: "STRING_VALUE",
51+
* // upstreamRepositoryPrefix: "STRING_VALUE",
5052
* // };
5153
*
5254
* ```

clients/client-ecr/src/commands/DescribePullThroughCacheRulesCommand.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ export interface DescribePullThroughCacheRulesCommandOutput
5858
* // createdAt: new Date("TIMESTAMP"),
5959
* // registryId: "STRING_VALUE",
6060
* // credentialArn: "STRING_VALUE",
61-
* // upstreamRegistry: "ecr-public" || "quay" || "k8s" || "docker-hub" || "github-container-registry" || "azure-container-registry" || "gitlab-container-registry",
61+
* // customRoleArn: "STRING_VALUE",
62+
* // upstreamRepositoryPrefix: "STRING_VALUE",
63+
* // upstreamRegistry: "ecr" || "ecr-public" || "quay" || "k8s" || "docker-hub" || "github-container-registry" || "azure-container-registry" || "gitlab-container-registry",
6264
* // updatedAt: new Date("TIMESTAMP"),
6365
* // },
6466
* // ],

clients/client-ecr/src/commands/UpdatePullThroughCacheRuleCommand.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export interface UpdatePullThroughCacheRuleCommandOutput extends UpdatePullThrou
3838
* const input = { // UpdatePullThroughCacheRuleRequest
3939
* registryId: "STRING_VALUE",
4040
* ecrRepositoryPrefix: "STRING_VALUE", // required
41-
* credentialArn: "STRING_VALUE", // required
41+
* credentialArn: "STRING_VALUE",
42+
* customRoleArn: "STRING_VALUE",
4243
* };
4344
* const command = new UpdatePullThroughCacheRuleCommand(input);
4445
* const response = await client.send(command);
@@ -47,6 +48,8 @@ export interface UpdatePullThroughCacheRuleCommandOutput extends UpdatePullThrou
4748
* // registryId: "STRING_VALUE",
4849
* // updatedAt: new Date("TIMESTAMP"),
4950
* // credentialArn: "STRING_VALUE",
51+
* // customRoleArn: "STRING_VALUE",
52+
* // upstreamRepositoryPrefix: "STRING_VALUE",
5053
* // };
5154
*
5255
* ```

clients/client-ecr/src/commands/ValidatePullThroughCacheRuleCommand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ export interface ValidatePullThroughCacheRuleCommandOutput
5454
* // registryId: "STRING_VALUE",
5555
* // upstreamRegistryUrl: "STRING_VALUE",
5656
* // credentialArn: "STRING_VALUE",
57+
* // customRoleArn: "STRING_VALUE",
58+
* // upstreamRepositoryPrefix: "STRING_VALUE",
5759
* // isValid: true || false,
5860
* // failure: "STRING_VALUE",
5961
* // };

clients/client-ecr/src/models/models_0.ts

Lines changed: 118 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -801,6 +801,7 @@ export class UploadNotFoundException extends __BaseException {
801801
export const UpstreamRegistry = {
802802
AzureContainerRegistry: "azure-container-registry",
803803
DockerHub: "docker-hub",
804+
Ecr: "ecr",
804805
EcrPublic: "ecr-public",
805806
GitHubContainerRegistry: "github-container-registry",
806807
GitLabContainerRegistry: "gitlab-container-registry",
@@ -819,6 +820,11 @@ export type UpstreamRegistry = (typeof UpstreamRegistry)[keyof typeof UpstreamRe
819820
export interface CreatePullThroughCacheRuleRequest {
820821
/**
821822
* <p>The repository name prefix to use when caching images from the source registry.</p>
823+
* <important>
824+
* <p>There is always an assumed <code>/</code> applied to the end of the prefix. If you
825+
* specify <code>ecr-public</code> as the prefix, Amazon ECR treats that as
826+
* <code>ecr-public/</code>.</p>
827+
* </important>
822828
* @public
823829
*/
824830
ecrRepositoryPrefix: string | undefined;
@@ -829,32 +835,42 @@ export interface CreatePullThroughCacheRuleRequest {
829835
* registry.</p>
830836
* <ul>
831837
* <li>
832-
* <p>Amazon ECR Public (<code>ecr-public</code>) - <code>public.ecr.aws</code>
838+
* <p>Amazon ECR (<code>ecr</code>) –
839+
* <code>dkr.ecr.<region>.amazonaws.com</code>
840+
* </p>
841+
* </li>
842+
* <li>
843+
* <p>Amazon ECR Public (<code>ecr-public</code>) – <code>public.ecr.aws</code>
833844
* </p>
834845
* </li>
835846
* <li>
836-
* <p>Docker Hub (<code>docker-hub</code>) -
847+
* <p>Docker Hub (<code>docker-hub</code>)
837848
* <code>registry-1.docker.io</code>
838849
* </p>
839850
* </li>
840851
* <li>
841-
* <p>Quay (<code>quay</code>) - <code>quay.io</code>
852+
* <p>GitHub Container Registry (<code>github-container-registry</code>) –
853+
* <code>ghcr.io</code>
842854
* </p>
843855
* </li>
844856
* <li>
845-
* <p>Kubernetes (<code>k8s</code>) - <code>registry.k8s.io</code>
857+
* <p>GitLab Container Registry (<code>gitlab-container-registry</code>) –
858+
* <code>registry.gitlab.com</code>
846859
* </p>
847860
* </li>
848861
* <li>
849-
* <p>GitHub Container Registry (<code>github-container-registry</code>) -
850-
* <code>ghcr.io</code>
862+
* <p>Kubernetes (<code>k8s</code>) – <code>registry.k8s.io</code>
851863
* </p>
852864
* </li>
853865
* <li>
854-
* <p>Microsoft Azure Container Registry (<code>azure-container-registry</code>) -
866+
* <p>Microsoft Azure Container Registry (<code>azure-container-registry</code>)
855867
* <code><custom>.azurecr.io</code>
856868
* </p>
857869
* </li>
870+
* <li>
871+
* <p>Quay (<code>quay</code>) – <code>quay.io</code>
872+
* </p>
873+
* </li>
858874
* </ul>
859875
* @public
860876
*/
@@ -879,6 +895,22 @@ export interface CreatePullThroughCacheRuleRequest {
879895
* @public
880896
*/
881897
credentialArn?: string | undefined;
898+
899+
/**
900+
* <p>Amazon Resource Name (ARN) of the IAM role to be assumed by Amazon ECR to authenticate to
901+
* the ECR upstream registry. This role must be in the same account as the registry that
902+
* you are configuring.</p>
903+
* @public
904+
*/
905+
customRoleArn?: string | undefined;
906+
907+
/**
908+
* <p>The repository name prefix of the upstream registry to match with the upstream
909+
* repository name. When this field isn't specified, Amazon ECR will use the
910+
* <code>ROOT</code>.</p>
911+
* @public
912+
*/
913+
upstreamRepositoryPrefix?: string | undefined;
882914
}
883915

884916
/**
@@ -922,6 +954,18 @@ export interface CreatePullThroughCacheRuleResponse {
922954
* @public
923955
*/
924956
credentialArn?: string | undefined;
957+
958+
/**
959+
* <p>The ARN of the IAM role associated with the pull through cache rule.</p>
960+
* @public
961+
*/
962+
customRoleArn?: string | undefined;
963+
964+
/**
965+
* <p>The upstream repository prefix associated with the pull through cache rule.</p>
966+
* @public
967+
*/
968+
upstreamRepositoryPrefix?: string | undefined;
925969
}
926970

927971
/**
@@ -1498,8 +1542,8 @@ export interface RepositoryCreationTemplate {
14981542
imageTagMutability?: ImageTagMutability | undefined;
14991543

15001544
/**
1501-
* <p>he repository policy to apply to repositories created using the template. A repository
1502-
* policy is a permissions policy associated with a repository to control access
1545+
* <p>The repository policy to apply to repositories created using the template. A
1546+
* repository policy is a permissions policy associated with a repository to control access
15031547
* permissions. </p>
15041548
* @public
15051549
*/
@@ -1701,6 +1745,18 @@ export interface DeletePullThroughCacheRuleResponse {
17011745
* @public
17021746
*/
17031747
credentialArn?: string | undefined;
1748+
1749+
/**
1750+
* <p>The ARN of the IAM role associated with the pull through cache rule.</p>
1751+
* @public
1752+
*/
1753+
customRoleArn?: string | undefined;
1754+
1755+
/**
1756+
* <p>The upstream repository prefix associated with the pull through cache rule.</p>
1757+
* @public
1758+
*/
1759+
upstreamRepositoryPrefix?: string | undefined;
17041760
}
17051761

17061762
/**
@@ -2249,10 +2305,10 @@ export interface ImageDetail {
22492305
* <p>If the image is a manifest list, this will be the max size of all manifests in the
22502306
* list.</p>
22512307
* <note>
2252-
* <p>Beginning with Docker version 1.9, the Docker client compresses image layers
2253-
* before pushing them to a V2 Docker registry. The output of the <code>docker
2254-
* images</code> command shows the uncompressed image size, so it may return a
2255-
* larger image size than the image sizes returned by <a>DescribeImages</a>.</p>
2308+
* <p>Starting with Docker version 1.9, the Docker client compresses image layers before
2309+
* pushing them to a V2 Docker registry. The output of the <code>docker images</code>
2310+
* command shows the uncompressed image size. Therefore, Docker might return a larger
2311+
* image than the image sizes returned by <a>DescribeImages</a>.</p>
22562312
* </note>
22572313
* @public
22582314
*/
@@ -3075,6 +3131,18 @@ export interface PullThroughCacheRule {
30753131
*/
30763132
credentialArn?: string | undefined;
30773133

3134+
/**
3135+
* <p>The ARN of the IAM role associated with the pull through cache rule.</p>
3136+
* @public
3137+
*/
3138+
customRoleArn?: string | undefined;
3139+
3140+
/**
3141+
* <p>The upstream repository prefix associated with the pull through cache rule.</p>
3142+
* @public
3143+
*/
3144+
upstreamRepositoryPrefix?: string | undefined;
3145+
30783146
/**
30793147
* <p>The name of the upstream source registry associated with the pull through cache
30803148
* rule.</p>
@@ -3389,10 +3457,10 @@ export interface GetAccountSettingResponse {
33893457
name?: string | undefined;
33903458

33913459
/**
3392-
* <p>The setting value for the setting name. The following are valid values for the basic scan
3393-
* type being used: <code>AWS_NATIVE</code> or <code>CLAIR</code>. The following are valid
3394-
* values for the registry policy scope being used: <code>V1</code> or
3395-
* <code>V2</code>.</p>
3460+
* <p>The setting value for the setting name. The following are valid values for the basic
3461+
* scan type being used: <code>AWS_NATIVE</code> or <code>CLAIR</code>. The following are
3462+
* valid values for the registry policy scope being used: <code>V1</code> or
3463+
* <code>V2</code>.</p>
33963464
* @public
33973465
*/
33983466
value?: string | undefined;
@@ -4816,7 +4884,15 @@ export interface UpdatePullThroughCacheRuleRequest {
48164884
* to the upstream registry.</p>
48174885
* @public
48184886
*/
4819-
credentialArn: string | undefined;
4887+
credentialArn?: string | undefined;
4888+
4889+
/**
4890+
* <p>Amazon Resource Name (ARN) of the IAM role to be assumed by Amazon ECR to authenticate to the
4891+
* ECR upstream registry. This role must be in the same account as the registry that you
4892+
* are configuring.</p>
4893+
* @public
4894+
*/
4895+
customRoleArn?: string | undefined;
48204896
}
48214897

48224898
/**
@@ -4848,6 +4924,18 @@ export interface UpdatePullThroughCacheRuleResponse {
48484924
* @public
48494925
*/
48504926
credentialArn?: string | undefined;
4927+
4928+
/**
4929+
* <p>The ARN of the IAM role associated with the pull through cache rule.</p>
4930+
* @public
4931+
*/
4932+
customRoleArn?: string | undefined;
4933+
4934+
/**
4935+
* <p>The upstream repository prefix associated with the pull through cache rule.</p>
4936+
* @public
4937+
*/
4938+
upstreamRepositoryPrefix?: string | undefined;
48514939
}
48524940

48534941
/**
@@ -5116,6 +5204,18 @@ export interface ValidatePullThroughCacheRuleResponse {
51165204
*/
51175205
credentialArn?: string | undefined;
51185206

5207+
/**
5208+
* <p>The ARN of the IAM role associated with the pull through cache rule.</p>
5209+
* @public
5210+
*/
5211+
customRoleArn?: string | undefined;
5212+
5213+
/**
5214+
* <p>The upstream repository prefix associated with the pull through cache rule.</p>
5215+
* @public
5216+
*/
5217+
upstreamRepositoryPrefix?: string | undefined;
5218+
51195219
/**
51205220
* <p>Whether or not the pull through cache rule was validated. If <code>true</code>, Amazon ECR
51215221
* was able to reach the upstream registry and authentication was successful. If

clients/client-ecr/src/protocols/Aws_json1_1.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,10 +2928,12 @@ const de_CreatePullThroughCacheRuleResponse = (
29282928
return take(output, {
29292929
createdAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
29302930
credentialArn: __expectString,
2931+
customRoleArn: __expectString,
29312932
ecrRepositoryPrefix: __expectString,
29322933
registryId: __expectString,
29332934
upstreamRegistry: __expectString,
29342935
upstreamRegistryUrl: __expectString,
2936+
upstreamRepositoryPrefix: __expectString,
29352937
}) as any;
29362938
};
29372939

@@ -3020,9 +3022,11 @@ const de_DeletePullThroughCacheRuleResponse = (
30203022
return take(output, {
30213023
createdAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
30223024
credentialArn: __expectString,
3025+
customRoleArn: __expectString,
30233026
ecrRepositoryPrefix: __expectString,
30243027
registryId: __expectString,
30253028
upstreamRegistryUrl: __expectString,
3029+
upstreamRepositoryPrefix: __expectString,
30263030
}) as any;
30273031
};
30283032

@@ -3399,11 +3403,13 @@ const de_PullThroughCacheRule = (output: any, context: __SerdeContext): PullThro
33993403
return take(output, {
34003404
createdAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
34013405
credentialArn: __expectString,
3406+
customRoleArn: __expectString,
34023407
ecrRepositoryPrefix: __expectString,
34033408
registryId: __expectString,
34043409
updatedAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
34053410
upstreamRegistry: __expectString,
34063411
upstreamRegistryUrl: __expectString,
3412+
upstreamRepositoryPrefix: __expectString,
34073413
}) as any;
34083414
};
34093415

@@ -3643,9 +3649,11 @@ const de_UpdatePullThroughCacheRuleResponse = (
36433649
): UpdatePullThroughCacheRuleResponse => {
36443650
return take(output, {
36453651
credentialArn: __expectString,
3652+
customRoleArn: __expectString,
36463653
ecrRepositoryPrefix: __expectString,
36473654
registryId: __expectString,
36483655
updatedAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
3656+
upstreamRepositoryPrefix: __expectString,
36493657
}) as any;
36503658
};
36513659

0 commit comments

Comments
 (0)