Skip to content

Commit 00d6cad

Browse files
author
awstools
committed
feat(client-ecr): Documentation and operational updates for Amazon ECR, adding support for pull through cache rules for upstream registries that require authentication.
1 parent 934314c commit 00d6cad

16 files changed

+1517
-34
lines changed

clients/client-ecr/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,14 @@ UntagResource
531531

532532
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ecr/classes/untagresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ecr/interfaces/untagresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ecr/interfaces/untagresourcecommandoutput.html)
533533

534+
</details>
535+
<details>
536+
<summary>
537+
UpdatePullThroughCacheRule
538+
</summary>
539+
540+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ecr/classes/updatepullthroughcacherulecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ecr/interfaces/updatepullthroughcacherulecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ecr/interfaces/updatepullthroughcacherulecommandoutput.html)
541+
534542
</details>
535543
<details>
536544
<summary>
@@ -540,3 +548,11 @@ UploadLayerPart
540548
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ecr/classes/uploadlayerpartcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ecr/interfaces/uploadlayerpartcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ecr/interfaces/uploadlayerpartcommandoutput.html)
541549

542550
</details>
551+
<details>
552+
<summary>
553+
ValidatePullThroughCacheRule
554+
</summary>
555+
556+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ecr/classes/validatepullthroughcacherulecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ecr/interfaces/validatepullthroughcacherulecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-ecr/interfaces/validatepullthroughcacherulecommandoutput.html)
557+
558+
</details>

clients/client-ecr/src/ECR.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,11 +190,21 @@ import {
190190
UntagResourceCommandInput,
191191
UntagResourceCommandOutput,
192192
} from "./commands/UntagResourceCommand";
193+
import {
194+
UpdatePullThroughCacheRuleCommand,
195+
UpdatePullThroughCacheRuleCommandInput,
196+
UpdatePullThroughCacheRuleCommandOutput,
197+
} from "./commands/UpdatePullThroughCacheRuleCommand";
193198
import {
194199
UploadLayerPartCommand,
195200
UploadLayerPartCommandInput,
196201
UploadLayerPartCommandOutput,
197202
} from "./commands/UploadLayerPartCommand";
203+
import {
204+
ValidatePullThroughCacheRuleCommand,
205+
ValidatePullThroughCacheRuleCommandInput,
206+
ValidatePullThroughCacheRuleCommandOutput,
207+
} from "./commands/ValidatePullThroughCacheRuleCommand";
198208
import { ECRClient, ECRClientConfig } from "./ECRClient";
199209

200210
const commands = {
@@ -238,7 +248,9 @@ const commands = {
238248
StartLifecyclePolicyPreviewCommand,
239249
TagResourceCommand,
240250
UntagResourceCommand,
251+
UpdatePullThroughCacheRuleCommand,
241252
UploadLayerPartCommand,
253+
ValidatePullThroughCacheRuleCommand,
242254
};
243255

244256
export interface ECR {
@@ -886,6 +898,23 @@ export interface ECR {
886898
cb: (err: any, data?: UntagResourceCommandOutput) => void
887899
): void;
888900

901+
/**
902+
* @see {@link UpdatePullThroughCacheRuleCommand}
903+
*/
904+
updatePullThroughCacheRule(
905+
args: UpdatePullThroughCacheRuleCommandInput,
906+
options?: __HttpHandlerOptions
907+
): Promise<UpdatePullThroughCacheRuleCommandOutput>;
908+
updatePullThroughCacheRule(
909+
args: UpdatePullThroughCacheRuleCommandInput,
910+
cb: (err: any, data?: UpdatePullThroughCacheRuleCommandOutput) => void
911+
): void;
912+
updatePullThroughCacheRule(
913+
args: UpdatePullThroughCacheRuleCommandInput,
914+
options: __HttpHandlerOptions,
915+
cb: (err: any, data?: UpdatePullThroughCacheRuleCommandOutput) => void
916+
): void;
917+
889918
/**
890919
* @see {@link UploadLayerPartCommand}
891920
*/
@@ -899,6 +928,23 @@ export interface ECR {
899928
options: __HttpHandlerOptions,
900929
cb: (err: any, data?: UploadLayerPartCommandOutput) => void
901930
): void;
931+
932+
/**
933+
* @see {@link ValidatePullThroughCacheRuleCommand}
934+
*/
935+
validatePullThroughCacheRule(
936+
args: ValidatePullThroughCacheRuleCommandInput,
937+
options?: __HttpHandlerOptions
938+
): Promise<ValidatePullThroughCacheRuleCommandOutput>;
939+
validatePullThroughCacheRule(
940+
args: ValidatePullThroughCacheRuleCommandInput,
941+
cb: (err: any, data?: ValidatePullThroughCacheRuleCommandOutput) => void
942+
): void;
943+
validatePullThroughCacheRule(
944+
args: ValidatePullThroughCacheRuleCommandInput,
945+
options: __HttpHandlerOptions,
946+
cb: (err: any, data?: ValidatePullThroughCacheRuleCommandOutput) => void
947+
): void;
902948
}
903949

904950
/**

clients/client-ecr/src/ECRClient.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,15 @@ import {
165165
} from "./commands/StartLifecyclePolicyPreviewCommand";
166166
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
167167
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
168+
import {
169+
UpdatePullThroughCacheRuleCommandInput,
170+
UpdatePullThroughCacheRuleCommandOutput,
171+
} from "./commands/UpdatePullThroughCacheRuleCommand";
168172
import { UploadLayerPartCommandInput, UploadLayerPartCommandOutput } from "./commands/UploadLayerPartCommand";
173+
import {
174+
ValidatePullThroughCacheRuleCommandInput,
175+
ValidatePullThroughCacheRuleCommandOutput,
176+
} from "./commands/ValidatePullThroughCacheRuleCommand";
169177
import {
170178
ClientInputEndpointParameters,
171179
ClientResolvedEndpointParameters,
@@ -221,7 +229,9 @@ export type ServiceInputTypes =
221229
| StartLifecyclePolicyPreviewCommandInput
222230
| TagResourceCommandInput
223231
| UntagResourceCommandInput
224-
| UploadLayerPartCommandInput;
232+
| UpdatePullThroughCacheRuleCommandInput
233+
| UploadLayerPartCommandInput
234+
| ValidatePullThroughCacheRuleCommandInput;
225235

226236
/**
227237
* @public
@@ -267,7 +277,9 @@ export type ServiceOutputTypes =
267277
| StartLifecyclePolicyPreviewCommandOutput
268278
| TagResourceCommandOutput
269279
| UntagResourceCommandOutput
270-
| UploadLayerPartCommandOutput;
280+
| UpdatePullThroughCacheRuleCommandOutput
281+
| UploadLayerPartCommandOutput
282+
| ValidatePullThroughCacheRuleCommandOutput;
271283

272284
/**
273285
* @public

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export interface BatchDeleteImageCommandOutput extends BatchDeleteImageResponse,
7474
* // imageDigest: "STRING_VALUE",
7575
* // imageTag: "STRING_VALUE",
7676
* // },
77-
* // failureCode: "InvalidImageDigest" || "InvalidImageTag" || "ImageTagDoesNotMatchDigest" || "ImageNotFound" || "MissingDigestAndTag" || "ImageReferencedByManifestList" || "KmsError",
77+
* // failureCode: "InvalidImageDigest" || "InvalidImageTag" || "ImageTagDoesNotMatchDigest" || "ImageNotFound" || "MissingDigestAndTag" || "ImageReferencedByManifestList" || "KmsError" || "UpstreamAccessDenied" || "UpstreamTooManyRequests" || "UpstreamUnavailable",
7878
* // failureReason: "STRING_VALUE",
7979
* // },
8080
* // ],

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export interface BatchGetImageCommandOutput extends BatchGetImageResponse, __Met
8181
* // imageDigest: "STRING_VALUE",
8282
* // imageTag: "STRING_VALUE",
8383
* // },
84-
* // failureCode: "InvalidImageDigest" || "InvalidImageTag" || "ImageTagDoesNotMatchDigest" || "ImageNotFound" || "MissingDigestAndTag" || "ImageReferencedByManifestList" || "KmsError",
84+
* // failureCode: "InvalidImageDigest" || "InvalidImageTag" || "ImageTagDoesNotMatchDigest" || "ImageNotFound" || "MissingDigestAndTag" || "ImageReferencedByManifestList" || "KmsError" || "UpstreamAccessDenied" || "UpstreamTooManyRequests" || "UpstreamUnavailable",
8585
* // failureReason: "STRING_VALUE",
8686
* // },
8787
* // ],
@@ -99,13 +99,23 @@ export interface BatchGetImageCommandOutput extends BatchGetImageResponse, __Met
9999
* <p>The specified parameter is invalid. Review the available parameters for the API
100100
* request.</p>
101101
*
102+
* @throws {@link LimitExceededException} (client fault)
103+
* <p>The operation did not succeed because it would have exceeded a service limit for your
104+
* account. For more information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/service-quotas.html">Amazon ECR service quotas</a> in
105+
* the Amazon Elastic Container Registry User Guide.</p>
106+
*
102107
* @throws {@link RepositoryNotFoundException} (client fault)
103108
* <p>The specified repository could not be found. Check the spelling of the specified
104109
* repository and ensure that you are performing operations on the correct registry.</p>
105110
*
106111
* @throws {@link ServerException} (server fault)
107112
* <p>These errors are usually caused by a server-side issue.</p>
108113
*
114+
* @throws {@link UnableToGetUpstreamImageException} (client fault)
115+
* <p>The image or images were unable to be pulled using the pull through cache rule. This
116+
* is usually caused because of an issue with the Secrets Manager secret containing the credentials
117+
* for the upstream registry.</p>
118+
*
109119
* @throws {@link ECRServiceException}
110120
* <p>Base exception class for all service exceptions from ECR service.</p>
111121
*

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ export interface CreatePullThroughCacheRuleCommandOutput extends CreatePullThrou
3838
/**
3939
* @public
4040
* <p>Creates a pull through cache rule. A pull through cache rule provides a way to cache
41-
* images from an external public registry in your Amazon ECR private registry.</p>
41+
* images from an upstream registry source in your Amazon ECR private registry. For more
42+
* information, see <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/pull-through-cache.html">Using pull through cache
43+
* rules</a> in the <i>Amazon Elastic Container Registry User Guide</i>.</p>
4244
* @example
4345
* Use a bare-bones client and the command you need to make an API call.
4446
* ```javascript
@@ -49,6 +51,8 @@ export interface CreatePullThroughCacheRuleCommandOutput extends CreatePullThrou
4951
* ecrRepositoryPrefix: "STRING_VALUE", // required
5052
* upstreamRegistryUrl: "STRING_VALUE", // required
5153
* registryId: "STRING_VALUE",
54+
* upstreamRegistry: "ecr-public" || "quay" || "k8s" || "docker-hub" || "github-container-registry" || "azure-container-registry",
55+
* credentialArn: "STRING_VALUE",
5256
* };
5357
* const command = new CreatePullThroughCacheRuleCommand(input);
5458
* const response = await client.send(command);
@@ -57,6 +61,8 @@ export interface CreatePullThroughCacheRuleCommandOutput extends CreatePullThrou
5761
* // upstreamRegistryUrl: "STRING_VALUE",
5862
* // createdAt: new Date("TIMESTAMP"),
5963
* // registryId: "STRING_VALUE",
64+
* // upstreamRegistry: "ecr-public" || "quay" || "k8s" || "docker-hub" || "github-container-registry" || "azure-container-registry",
65+
* // credentialArn: "STRING_VALUE",
6066
* // };
6167
*
6268
* ```
@@ -80,9 +86,21 @@ export interface CreatePullThroughCacheRuleCommandOutput extends CreatePullThrou
8086
* <p>A pull through cache rule with these settings already exists for the private
8187
* registry.</p>
8288
*
89+
* @throws {@link SecretNotFoundException} (client fault)
90+
* <p>The ARN of the secret specified in the pull through cache rule was not found. Update
91+
* the pull through cache rule with a valid secret ARN and try again.</p>
92+
*
8393
* @throws {@link ServerException} (server fault)
8494
* <p>These errors are usually caused by a server-side issue.</p>
8595
*
96+
* @throws {@link UnableToAccessSecretException} (client fault)
97+
* <p>The secret is unable to be accessed. Verify the resource permissions for the secret
98+
* and try again.</p>
99+
*
100+
* @throws {@link UnableToDecryptSecretValueException} (client fault)
101+
* <p>The secret is accessible but is unable to be decrypted. Verify the resource
102+
* permisisons and try again.</p>
103+
*
86104
* @throws {@link UnsupportedUpstreamRegistryException} (client fault)
87105
* <p>The specified upstream registry isn't supported.</p>
88106
*

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export interface DeletePullThroughCacheRuleCommandOutput extends DeletePullThrou
5555
* // upstreamRegistryUrl: "STRING_VALUE",
5656
* // createdAt: new Date("TIMESTAMP"),
5757
* // registryId: "STRING_VALUE",
58+
* // credentialArn: "STRING_VALUE",
5859
* // };
5960
*
6061
* ```

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ export interface DeleteRepositoryCommandOutput extends DeleteRepositoryResponse,
3737

3838
/**
3939
* @public
40-
* <p>Deletes a repository. If the repository contains images, you must either delete all
41-
* images in the repository or use the <code>force</code> option to delete the
42-
* repository.</p>
40+
* <p>Deletes a repository. If the repository isn't empty, you must either delete the
41+
* contents of the repository or use the <code>force</code> option to delete the repository
42+
* and have Amazon ECR delete all of its contents on your behalf.</p>
4343
* @example
4444
* Use a bare-bones client and the command you need to make an API call.
4545
* ```javascript

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ export interface DescribePullThroughCacheRulesCommandOutput
6666
* // upstreamRegistryUrl: "STRING_VALUE",
6767
* // createdAt: new Date("TIMESTAMP"),
6868
* // registryId: "STRING_VALUE",
69+
* // credentialArn: "STRING_VALUE",
70+
* // upstreamRegistry: "ecr-public" || "quay" || "k8s" || "docker-hub" || "github-container-registry" || "azure-container-registry",
71+
* // updatedAt: new Date("TIMESTAMP"),
6972
* // },
7073
* // ],
7174
* // nextToken: "STRING_VALUE",

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ export interface GetDownloadUrlForLayerCommandOutput extends GetDownloadUrlForLa
9090
* @throws {@link ServerException} (server fault)
9191
* <p>These errors are usually caused by a server-side issue.</p>
9292
*
93+
* @throws {@link UnableToGetUpstreamLayerException} (client fault)
94+
* <p>There was an issue getting the upstream layer matching the pull through cache
95+
* rule.</p>
96+
*
9397
* @throws {@link ECRServiceException}
9498
* <p>Base exception class for all service exceptions from ECR service.</p>
9599
*

0 commit comments

Comments
 (0)