diff --git a/clients/client-ecr/README.md b/clients/client-ecr/README.md index 9173365fd2524..e6b516f34507b 100644 --- a/clients/client-ecr/README.md +++ b/clients/client-ecr/README.md @@ -267,6 +267,14 @@ CreateRepository [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecr/command/CreateRepositoryCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/CreateRepositoryCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/CreateRepositoryCommandOutput/) + +
+ +CreateRepositoryCreationTemplate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecr/command/CreateRepositoryCreationTemplateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/CreateRepositoryCreationTemplateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/CreateRepositoryCreationTemplateCommandOutput/) +
@@ -299,6 +307,14 @@ DeleteRepository [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecr/command/DeleteRepositoryCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/DeleteRepositoryCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/DeleteRepositoryCommandOutput/) +
+
+ +DeleteRepositoryCreationTemplate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecr/command/DeleteRepositoryCreationTemplateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/DeleteRepositoryCreationTemplateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/DeleteRepositoryCreationTemplateCommandOutput/) +
@@ -355,6 +371,14 @@ DescribeRepositories [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecr/command/DescribeRepositoriesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/DescribeRepositoriesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/DescribeRepositoriesCommandOutput/) +
+
+ +DescribeRepositoryCreationTemplates + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecr/command/DescribeRepositoryCreationTemplatesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/DescribeRepositoryCreationTemplatesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/DescribeRepositoryCreationTemplatesCommandOutput/) +
@@ -539,6 +563,14 @@ UpdatePullThroughCacheRule [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecr/command/UpdatePullThroughCacheRuleCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/UpdatePullThroughCacheRuleCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/UpdatePullThroughCacheRuleCommandOutput/) +
+
+ +UpdateRepositoryCreationTemplate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/ecr/command/UpdateRepositoryCreationTemplateCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/UpdateRepositoryCreationTemplateCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-ecr/Interface/UpdateRepositoryCreationTemplateCommandOutput/) +
diff --git a/clients/client-ecr/src/ECR.ts b/clients/client-ecr/src/ECR.ts index 05b56ca7a42ac..b368c6bfe1f04 100644 --- a/clients/client-ecr/src/ECR.ts +++ b/clients/client-ecr/src/ECR.ts @@ -37,6 +37,11 @@ import { CreateRepositoryCommandInput, CreateRepositoryCommandOutput, } from "./commands/CreateRepositoryCommand"; +import { + CreateRepositoryCreationTemplateCommand, + CreateRepositoryCreationTemplateCommandInput, + CreateRepositoryCreationTemplateCommandOutput, +} from "./commands/CreateRepositoryCreationTemplateCommand"; import { DeleteLifecyclePolicyCommand, DeleteLifecyclePolicyCommandInput, @@ -57,6 +62,11 @@ import { DeleteRepositoryCommandInput, DeleteRepositoryCommandOutput, } from "./commands/DeleteRepositoryCommand"; +import { + DeleteRepositoryCreationTemplateCommand, + DeleteRepositoryCreationTemplateCommandInput, + DeleteRepositoryCreationTemplateCommandOutput, +} from "./commands/DeleteRepositoryCreationTemplateCommand"; import { DeleteRepositoryPolicyCommand, DeleteRepositoryPolicyCommandInput, @@ -92,6 +102,11 @@ import { DescribeRepositoriesCommandInput, DescribeRepositoriesCommandOutput, } from "./commands/DescribeRepositoriesCommand"; +import { + DescribeRepositoryCreationTemplatesCommand, + DescribeRepositoryCreationTemplatesCommandInput, + DescribeRepositoryCreationTemplatesCommandOutput, +} from "./commands/DescribeRepositoryCreationTemplatesCommand"; import { GetAuthorizationTokenCommand, GetAuthorizationTokenCommandInput, @@ -195,6 +210,11 @@ import { UpdatePullThroughCacheRuleCommandInput, UpdatePullThroughCacheRuleCommandOutput, } from "./commands/UpdatePullThroughCacheRuleCommand"; +import { + UpdateRepositoryCreationTemplateCommand, + UpdateRepositoryCreationTemplateCommandInput, + UpdateRepositoryCreationTemplateCommandOutput, +} from "./commands/UpdateRepositoryCreationTemplateCommand"; import { UploadLayerPartCommand, UploadLayerPartCommandInput, @@ -215,10 +235,12 @@ const commands = { CompleteLayerUploadCommand, CreatePullThroughCacheRuleCommand, CreateRepositoryCommand, + CreateRepositoryCreationTemplateCommand, DeleteLifecyclePolicyCommand, DeletePullThroughCacheRuleCommand, DeleteRegistryPolicyCommand, DeleteRepositoryCommand, + DeleteRepositoryCreationTemplateCommand, DeleteRepositoryPolicyCommand, DescribeImageReplicationStatusCommand, DescribeImagesCommand, @@ -226,6 +248,7 @@ const commands = { DescribePullThroughCacheRulesCommand, DescribeRegistryCommand, DescribeRepositoriesCommand, + DescribeRepositoryCreationTemplatesCommand, GetAuthorizationTokenCommand, GetDownloadUrlForLayerCommand, GetLifecyclePolicyCommand, @@ -249,6 +272,7 @@ const commands = { TagResourceCommand, UntagResourceCommand, UpdatePullThroughCacheRuleCommand, + UpdateRepositoryCreationTemplateCommand, UploadLayerPartCommand, ValidatePullThroughCacheRuleCommand, }; @@ -367,6 +391,23 @@ export interface ECR { cb: (err: any, data?: CreateRepositoryCommandOutput) => void ): void; + /** + * @see {@link CreateRepositoryCreationTemplateCommand} + */ + createRepositoryCreationTemplate( + args: CreateRepositoryCreationTemplateCommandInput, + options?: __HttpHandlerOptions + ): Promise; + createRepositoryCreationTemplate( + args: CreateRepositoryCreationTemplateCommandInput, + cb: (err: any, data?: CreateRepositoryCreationTemplateCommandOutput) => void + ): void; + createRepositoryCreationTemplate( + args: CreateRepositoryCreationTemplateCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateRepositoryCreationTemplateCommandOutput) => void + ): void; + /** * @see {@link DeleteLifecyclePolicyCommand} */ @@ -436,6 +477,23 @@ export interface ECR { cb: (err: any, data?: DeleteRepositoryCommandOutput) => void ): void; + /** + * @see {@link DeleteRepositoryCreationTemplateCommand} + */ + deleteRepositoryCreationTemplate( + args: DeleteRepositoryCreationTemplateCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteRepositoryCreationTemplate( + args: DeleteRepositoryCreationTemplateCommandInput, + cb: (err: any, data?: DeleteRepositoryCreationTemplateCommandOutput) => void + ): void; + deleteRepositoryCreationTemplate( + args: DeleteRepositoryCreationTemplateCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteRepositoryCreationTemplateCommandOutput) => void + ): void; + /** * @see {@link DeleteRepositoryPolicyCommand} */ @@ -555,6 +613,24 @@ export interface ECR { cb: (err: any, data?: DescribeRepositoriesCommandOutput) => void ): void; + /** + * @see {@link DescribeRepositoryCreationTemplatesCommand} + */ + describeRepositoryCreationTemplates(): Promise; + describeRepositoryCreationTemplates( + args: DescribeRepositoryCreationTemplatesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + describeRepositoryCreationTemplates( + args: DescribeRepositoryCreationTemplatesCommandInput, + cb: (err: any, data?: DescribeRepositoryCreationTemplatesCommandOutput) => void + ): void; + describeRepositoryCreationTemplates( + args: DescribeRepositoryCreationTemplatesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeRepositoryCreationTemplatesCommandOutput) => void + ): void; + /** * @see {@link GetAuthorizationTokenCommand} */ @@ -923,6 +999,23 @@ export interface ECR { cb: (err: any, data?: UpdatePullThroughCacheRuleCommandOutput) => void ): void; + /** + * @see {@link UpdateRepositoryCreationTemplateCommand} + */ + updateRepositoryCreationTemplate( + args: UpdateRepositoryCreationTemplateCommandInput, + options?: __HttpHandlerOptions + ): Promise; + updateRepositoryCreationTemplate( + args: UpdateRepositoryCreationTemplateCommandInput, + cb: (err: any, data?: UpdateRepositoryCreationTemplateCommandOutput) => void + ): void; + updateRepositoryCreationTemplate( + args: UpdateRepositoryCreationTemplateCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateRepositoryCreationTemplateCommandOutput) => void + ): void; + /** * @see {@link UploadLayerPartCommand} */ diff --git a/clients/client-ecr/src/ECRClient.ts b/clients/client-ecr/src/ECRClient.ts index 5a7836e8d5426..45cf4ccfba23b 100644 --- a/clients/client-ecr/src/ECRClient.ts +++ b/clients/client-ecr/src/ECRClient.ts @@ -72,6 +72,10 @@ import { CreatePullThroughCacheRuleCommandOutput, } from "./commands/CreatePullThroughCacheRuleCommand"; import { CreateRepositoryCommandInput, CreateRepositoryCommandOutput } from "./commands/CreateRepositoryCommand"; +import { + CreateRepositoryCreationTemplateCommandInput, + CreateRepositoryCreationTemplateCommandOutput, +} from "./commands/CreateRepositoryCreationTemplateCommand"; import { DeleteLifecyclePolicyCommandInput, DeleteLifecyclePolicyCommandOutput, @@ -85,6 +89,10 @@ import { DeleteRegistryPolicyCommandOutput, } from "./commands/DeleteRegistryPolicyCommand"; import { DeleteRepositoryCommandInput, DeleteRepositoryCommandOutput } from "./commands/DeleteRepositoryCommand"; +import { + DeleteRepositoryCreationTemplateCommandInput, + DeleteRepositoryCreationTemplateCommandOutput, +} from "./commands/DeleteRepositoryCreationTemplateCommand"; import { DeleteRepositoryPolicyCommandInput, DeleteRepositoryPolicyCommandOutput, @@ -107,6 +115,10 @@ import { DescribeRepositoriesCommandInput, DescribeRepositoriesCommandOutput, } from "./commands/DescribeRepositoriesCommand"; +import { + DescribeRepositoryCreationTemplatesCommandInput, + DescribeRepositoryCreationTemplatesCommandOutput, +} from "./commands/DescribeRepositoryCreationTemplatesCommand"; import { GetAuthorizationTokenCommandInput, GetAuthorizationTokenCommandOutput, @@ -172,6 +184,10 @@ import { UpdatePullThroughCacheRuleCommandInput, UpdatePullThroughCacheRuleCommandOutput, } from "./commands/UpdatePullThroughCacheRuleCommand"; +import { + UpdateRepositoryCreationTemplateCommandInput, + UpdateRepositoryCreationTemplateCommandOutput, +} from "./commands/UpdateRepositoryCreationTemplateCommand"; import { UploadLayerPartCommandInput, UploadLayerPartCommandOutput } from "./commands/UploadLayerPartCommand"; import { ValidatePullThroughCacheRuleCommandInput, @@ -199,10 +215,12 @@ export type ServiceInputTypes = | CompleteLayerUploadCommandInput | CreatePullThroughCacheRuleCommandInput | CreateRepositoryCommandInput + | CreateRepositoryCreationTemplateCommandInput | DeleteLifecyclePolicyCommandInput | DeletePullThroughCacheRuleCommandInput | DeleteRegistryPolicyCommandInput | DeleteRepositoryCommandInput + | DeleteRepositoryCreationTemplateCommandInput | DeleteRepositoryPolicyCommandInput | DescribeImageReplicationStatusCommandInput | DescribeImageScanFindingsCommandInput @@ -210,6 +228,7 @@ export type ServiceInputTypes = | DescribePullThroughCacheRulesCommandInput | DescribeRegistryCommandInput | DescribeRepositoriesCommandInput + | DescribeRepositoryCreationTemplatesCommandInput | GetAuthorizationTokenCommandInput | GetDownloadUrlForLayerCommandInput | GetLifecyclePolicyCommandInput @@ -233,6 +252,7 @@ export type ServiceInputTypes = | TagResourceCommandInput | UntagResourceCommandInput | UpdatePullThroughCacheRuleCommandInput + | UpdateRepositoryCreationTemplateCommandInput | UploadLayerPartCommandInput | ValidatePullThroughCacheRuleCommandInput; @@ -247,10 +267,12 @@ export type ServiceOutputTypes = | CompleteLayerUploadCommandOutput | CreatePullThroughCacheRuleCommandOutput | CreateRepositoryCommandOutput + | CreateRepositoryCreationTemplateCommandOutput | DeleteLifecyclePolicyCommandOutput | DeletePullThroughCacheRuleCommandOutput | DeleteRegistryPolicyCommandOutput | DeleteRepositoryCommandOutput + | DeleteRepositoryCreationTemplateCommandOutput | DeleteRepositoryPolicyCommandOutput | DescribeImageReplicationStatusCommandOutput | DescribeImageScanFindingsCommandOutput @@ -258,6 +280,7 @@ export type ServiceOutputTypes = | DescribePullThroughCacheRulesCommandOutput | DescribeRegistryCommandOutput | DescribeRepositoriesCommandOutput + | DescribeRepositoryCreationTemplatesCommandOutput | GetAuthorizationTokenCommandOutput | GetDownloadUrlForLayerCommandOutput | GetLifecyclePolicyCommandOutput @@ -281,6 +304,7 @@ export type ServiceOutputTypes = | TagResourceCommandOutput | UntagResourceCommandOutput | UpdatePullThroughCacheRuleCommandOutput + | UpdateRepositoryCreationTemplateCommandOutput | UploadLayerPartCommandOutput | ValidatePullThroughCacheRuleCommandOutput; diff --git a/clients/client-ecr/src/commands/CreateRepositoryCreationTemplateCommand.ts b/clients/client-ecr/src/commands/CreateRepositoryCreationTemplateCommand.ts new file mode 100644 index 0000000000000..70667d3ec3d74 --- /dev/null +++ b/clients/client-ecr/src/commands/CreateRepositoryCreationTemplateCommand.ts @@ -0,0 +1,151 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { ECRClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ECRClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { CreateRepositoryCreationTemplateRequest, CreateRepositoryCreationTemplateResponse } from "../models/models_0"; +import { + de_CreateRepositoryCreationTemplateCommand, + se_CreateRepositoryCreationTemplateCommand, +} from "../protocols/Aws_json1_1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link CreateRepositoryCreationTemplateCommand}. + */ +export interface CreateRepositoryCreationTemplateCommandInput extends CreateRepositoryCreationTemplateRequest {} +/** + * @public + * + * The output of {@link CreateRepositoryCreationTemplateCommand}. + */ +export interface CreateRepositoryCreationTemplateCommandOutput + extends CreateRepositoryCreationTemplateResponse, + __MetadataBearer {} + +/** + *

Creates a repository creation template. This template is used to define the settings + * for repositories created by Amazon ECR on your behalf. For example, repositories created + * through pull through cache actions. For more information, see Private + * repository creation templates in the + * Amazon Elastic Container Registry User Guide.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ECRClient, CreateRepositoryCreationTemplateCommand } from "@aws-sdk/client-ecr"; // ES Modules import + * // const { ECRClient, CreateRepositoryCreationTemplateCommand } = require("@aws-sdk/client-ecr"); // CommonJS import + * const client = new ECRClient(config); + * const input = { // CreateRepositoryCreationTemplateRequest + * prefix: "STRING_VALUE", // required + * description: "STRING_VALUE", + * encryptionConfiguration: { // EncryptionConfigurationForRepositoryCreationTemplate + * encryptionType: "AES256" || "KMS", // required + * kmsKey: "STRING_VALUE", + * }, + * resourceTags: [ // TagList + * { // Tag + * Key: "STRING_VALUE", // required + * Value: "STRING_VALUE", // required + * }, + * ], + * imageTagMutability: "MUTABLE" || "IMMUTABLE", + * repositoryPolicy: "STRING_VALUE", + * lifecyclePolicy: "STRING_VALUE", + * appliedFor: [ // RCTAppliedForList // required + * "REPLICATION" || "PULL_THROUGH_CACHE", + * ], + * customRoleArn: "STRING_VALUE", + * }; + * const command = new CreateRepositoryCreationTemplateCommand(input); + * const response = await client.send(command); + * // { // CreateRepositoryCreationTemplateResponse + * // registryId: "STRING_VALUE", + * // repositoryCreationTemplate: { // RepositoryCreationTemplate + * // prefix: "STRING_VALUE", + * // description: "STRING_VALUE", + * // encryptionConfiguration: { // EncryptionConfigurationForRepositoryCreationTemplate + * // encryptionType: "AES256" || "KMS", // required + * // kmsKey: "STRING_VALUE", + * // }, + * // resourceTags: [ // TagList + * // { // Tag + * // Key: "STRING_VALUE", // required + * // Value: "STRING_VALUE", // required + * // }, + * // ], + * // imageTagMutability: "MUTABLE" || "IMMUTABLE", + * // repositoryPolicy: "STRING_VALUE", + * // lifecyclePolicy: "STRING_VALUE", + * // appliedFor: [ // RCTAppliedForList + * // "REPLICATION" || "PULL_THROUGH_CACHE", + * // ], + * // customRoleArn: "STRING_VALUE", + * // createdAt: new Date("TIMESTAMP"), + * // updatedAt: new Date("TIMESTAMP"), + * // }, + * // }; + * + * ``` + * + * @param CreateRepositoryCreationTemplateCommandInput - {@link CreateRepositoryCreationTemplateCommandInput} + * @returns {@link CreateRepositoryCreationTemplateCommandOutput} + * @see {@link CreateRepositoryCreationTemplateCommandInput} for command's `input` shape. + * @see {@link CreateRepositoryCreationTemplateCommandOutput} for command's `response` shape. + * @see {@link ECRClientResolvedConfig | config} for ECRClient's `config` shape. + * + * @throws {@link InvalidParameterException} (client fault) + *

The specified parameter is invalid. Review the available parameters for the API + * request.

+ * + * @throws {@link LimitExceededException} (client fault) + *

The operation did not succeed because it would have exceeded a service limit for your + * account. For more information, see Amazon ECR service quotas in + * the Amazon Elastic Container Registry User Guide.

+ * + * @throws {@link ServerException} (server fault) + *

These errors are usually caused by a server-side issue.

+ * + * @throws {@link TemplateAlreadyExistsException} (client fault) + *

The repository creation template already exists. Specify a unique prefix and try + * again.

+ * + * @throws {@link ValidationException} (client fault) + *

There was an exception validating this request.

+ * + * @throws {@link ECRServiceException} + *

Base exception class for all service exceptions from ECR service.

+ * + * @public + */ +export class CreateRepositoryCreationTemplateCommand extends $Command + .classBuilder< + CreateRepositoryCreationTemplateCommandInput, + CreateRepositoryCreationTemplateCommandOutput, + ECRClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: ECRClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonEC2ContainerRegistry_V20150921", "CreateRepositoryCreationTemplate", {}) + .n("ECRClient", "CreateRepositoryCreationTemplateCommand") + .f(void 0, void 0) + .ser(se_CreateRepositoryCreationTemplateCommand) + .de(de_CreateRepositoryCreationTemplateCommand) + .build() {} diff --git a/clients/client-ecr/src/commands/DeleteRepositoryCreationTemplateCommand.ts b/clients/client-ecr/src/commands/DeleteRepositoryCreationTemplateCommand.ts new file mode 100644 index 0000000000000..e188ab1a018da --- /dev/null +++ b/clients/client-ecr/src/commands/DeleteRepositoryCreationTemplateCommand.ts @@ -0,0 +1,124 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { ECRClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ECRClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { DeleteRepositoryCreationTemplateRequest, DeleteRepositoryCreationTemplateResponse } from "../models/models_0"; +import { + de_DeleteRepositoryCreationTemplateCommand, + se_DeleteRepositoryCreationTemplateCommand, +} from "../protocols/Aws_json1_1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DeleteRepositoryCreationTemplateCommand}. + */ +export interface DeleteRepositoryCreationTemplateCommandInput extends DeleteRepositoryCreationTemplateRequest {} +/** + * @public + * + * The output of {@link DeleteRepositoryCreationTemplateCommand}. + */ +export interface DeleteRepositoryCreationTemplateCommandOutput + extends DeleteRepositoryCreationTemplateResponse, + __MetadataBearer {} + +/** + *

Deletes a repository creation template.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ECRClient, DeleteRepositoryCreationTemplateCommand } from "@aws-sdk/client-ecr"; // ES Modules import + * // const { ECRClient, DeleteRepositoryCreationTemplateCommand } = require("@aws-sdk/client-ecr"); // CommonJS import + * const client = new ECRClient(config); + * const input = { // DeleteRepositoryCreationTemplateRequest + * prefix: "STRING_VALUE", // required + * }; + * const command = new DeleteRepositoryCreationTemplateCommand(input); + * const response = await client.send(command); + * // { // DeleteRepositoryCreationTemplateResponse + * // registryId: "STRING_VALUE", + * // repositoryCreationTemplate: { // RepositoryCreationTemplate + * // prefix: "STRING_VALUE", + * // description: "STRING_VALUE", + * // encryptionConfiguration: { // EncryptionConfigurationForRepositoryCreationTemplate + * // encryptionType: "AES256" || "KMS", // required + * // kmsKey: "STRING_VALUE", + * // }, + * // resourceTags: [ // TagList + * // { // Tag + * // Key: "STRING_VALUE", // required + * // Value: "STRING_VALUE", // required + * // }, + * // ], + * // imageTagMutability: "MUTABLE" || "IMMUTABLE", + * // repositoryPolicy: "STRING_VALUE", + * // lifecyclePolicy: "STRING_VALUE", + * // appliedFor: [ // RCTAppliedForList + * // "REPLICATION" || "PULL_THROUGH_CACHE", + * // ], + * // customRoleArn: "STRING_VALUE", + * // createdAt: new Date("TIMESTAMP"), + * // updatedAt: new Date("TIMESTAMP"), + * // }, + * // }; + * + * ``` + * + * @param DeleteRepositoryCreationTemplateCommandInput - {@link DeleteRepositoryCreationTemplateCommandInput} + * @returns {@link DeleteRepositoryCreationTemplateCommandOutput} + * @see {@link DeleteRepositoryCreationTemplateCommandInput} for command's `input` shape. + * @see {@link DeleteRepositoryCreationTemplateCommandOutput} for command's `response` shape. + * @see {@link ECRClientResolvedConfig | config} for ECRClient's `config` shape. + * + * @throws {@link InvalidParameterException} (client fault) + *

The specified parameter is invalid. Review the available parameters for the API + * request.

+ * + * @throws {@link ServerException} (server fault) + *

These errors are usually caused by a server-side issue.

+ * + * @throws {@link TemplateNotFoundException} (client fault) + *

The specified repository creation template can't be found. Verify the registry ID and + * prefix and try again.

+ * + * @throws {@link ValidationException} (client fault) + *

There was an exception validating this request.

+ * + * @throws {@link ECRServiceException} + *

Base exception class for all service exceptions from ECR service.

+ * + * @public + */ +export class DeleteRepositoryCreationTemplateCommand extends $Command + .classBuilder< + DeleteRepositoryCreationTemplateCommandInput, + DeleteRepositoryCreationTemplateCommandOutput, + ECRClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: ECRClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonEC2ContainerRegistry_V20150921", "DeleteRepositoryCreationTemplate", {}) + .n("ECRClient", "DeleteRepositoryCreationTemplateCommand") + .f(void 0, void 0) + .ser(se_DeleteRepositoryCreationTemplateCommand) + .de(de_DeleteRepositoryCreationTemplateCommand) + .build() {} diff --git a/clients/client-ecr/src/commands/DescribeRepositoryCreationTemplatesCommand.ts b/clients/client-ecr/src/commands/DescribeRepositoryCreationTemplatesCommand.ts new file mode 100644 index 0000000000000..09b47f20289d1 --- /dev/null +++ b/clients/client-ecr/src/commands/DescribeRepositoryCreationTemplatesCommand.ts @@ -0,0 +1,132 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { ECRClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ECRClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { + DescribeRepositoryCreationTemplatesRequest, + DescribeRepositoryCreationTemplatesResponse, +} from "../models/models_0"; +import { + de_DescribeRepositoryCreationTemplatesCommand, + se_DescribeRepositoryCreationTemplatesCommand, +} from "../protocols/Aws_json1_1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DescribeRepositoryCreationTemplatesCommand}. + */ +export interface DescribeRepositoryCreationTemplatesCommandInput extends DescribeRepositoryCreationTemplatesRequest {} +/** + * @public + * + * The output of {@link DescribeRepositoryCreationTemplatesCommand}. + */ +export interface DescribeRepositoryCreationTemplatesCommandOutput + extends DescribeRepositoryCreationTemplatesResponse, + __MetadataBearer {} + +/** + *

Returns details about the repository creation templates in a registry. The + * prefixes request parameter can be used to return the details for a + * specific repository creation template.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ECRClient, DescribeRepositoryCreationTemplatesCommand } from "@aws-sdk/client-ecr"; // ES Modules import + * // const { ECRClient, DescribeRepositoryCreationTemplatesCommand } = require("@aws-sdk/client-ecr"); // CommonJS import + * const client = new ECRClient(config); + * const input = { // DescribeRepositoryCreationTemplatesRequest + * prefixes: [ // PrefixList + * "STRING_VALUE", + * ], + * nextToken: "STRING_VALUE", + * maxResults: Number("int"), + * }; + * const command = new DescribeRepositoryCreationTemplatesCommand(input); + * const response = await client.send(command); + * // { // DescribeRepositoryCreationTemplatesResponse + * // registryId: "STRING_VALUE", + * // repositoryCreationTemplates: [ // RepositoryCreationTemplateList + * // { // RepositoryCreationTemplate + * // prefix: "STRING_VALUE", + * // description: "STRING_VALUE", + * // encryptionConfiguration: { // EncryptionConfigurationForRepositoryCreationTemplate + * // encryptionType: "AES256" || "KMS", // required + * // kmsKey: "STRING_VALUE", + * // }, + * // resourceTags: [ // TagList + * // { // Tag + * // Key: "STRING_VALUE", // required + * // Value: "STRING_VALUE", // required + * // }, + * // ], + * // imageTagMutability: "MUTABLE" || "IMMUTABLE", + * // repositoryPolicy: "STRING_VALUE", + * // lifecyclePolicy: "STRING_VALUE", + * // appliedFor: [ // RCTAppliedForList + * // "REPLICATION" || "PULL_THROUGH_CACHE", + * // ], + * // customRoleArn: "STRING_VALUE", + * // createdAt: new Date("TIMESTAMP"), + * // updatedAt: new Date("TIMESTAMP"), + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param DescribeRepositoryCreationTemplatesCommandInput - {@link DescribeRepositoryCreationTemplatesCommandInput} + * @returns {@link DescribeRepositoryCreationTemplatesCommandOutput} + * @see {@link DescribeRepositoryCreationTemplatesCommandInput} for command's `input` shape. + * @see {@link DescribeRepositoryCreationTemplatesCommandOutput} for command's `response` shape. + * @see {@link ECRClientResolvedConfig | config} for ECRClient's `config` shape. + * + * @throws {@link InvalidParameterException} (client fault) + *

The specified parameter is invalid. Review the available parameters for the API + * request.

+ * + * @throws {@link ServerException} (server fault) + *

These errors are usually caused by a server-side issue.

+ * + * @throws {@link ValidationException} (client fault) + *

There was an exception validating this request.

+ * + * @throws {@link ECRServiceException} + *

Base exception class for all service exceptions from ECR service.

+ * + * @public + */ +export class DescribeRepositoryCreationTemplatesCommand extends $Command + .classBuilder< + DescribeRepositoryCreationTemplatesCommandInput, + DescribeRepositoryCreationTemplatesCommandOutput, + ECRClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: ECRClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonEC2ContainerRegistry_V20150921", "DescribeRepositoryCreationTemplates", {}) + .n("ECRClient", "DescribeRepositoryCreationTemplatesCommand") + .f(void 0, void 0) + .ser(se_DescribeRepositoryCreationTemplatesCommand) + .de(de_DescribeRepositoryCreationTemplatesCommand) + .build() {} diff --git a/clients/client-ecr/src/commands/PutReplicationConfigurationCommand.ts b/clients/client-ecr/src/commands/PutReplicationConfigurationCommand.ts index f7eb697b36553..2b5c54771544b 100644 --- a/clients/client-ecr/src/commands/PutReplicationConfigurationCommand.ts +++ b/clients/client-ecr/src/commands/PutReplicationConfigurationCommand.ts @@ -34,8 +34,8 @@ export interface PutReplicationConfigurationCommandOutput * replication configuration for a repository can be retrieved with the DescribeRegistry API action. The first time the * PutReplicationConfiguration API is called, a service-linked IAM role is created in * your account for the replication process. For more information, see Using - * service-linked roles for Amazon ECR in the - * Amazon Elastic Container Registry User Guide.

+ * service-linked roles for Amazon ECR in the Amazon Elastic Container Registry User Guide. + * For more information on the custom role for replication, see Creating an IAM role for replication.

* *

When configuring cross-account replication, the destination account must grant the * source account permission to replicate. This permission is controlled using a diff --git a/clients/client-ecr/src/commands/UpdateRepositoryCreationTemplateCommand.ts b/clients/client-ecr/src/commands/UpdateRepositoryCreationTemplateCommand.ts new file mode 100644 index 0000000000000..11db9ca211a9c --- /dev/null +++ b/clients/client-ecr/src/commands/UpdateRepositoryCreationTemplateCommand.ts @@ -0,0 +1,142 @@ +// smithy-typescript generated code +import { getEndpointPlugin } from "@smithy/middleware-endpoint"; +import { getSerdePlugin } from "@smithy/middleware-serde"; +import { Command as $Command } from "@smithy/smithy-client"; +import { MetadataBearer as __MetadataBearer } from "@smithy/types"; + +import { ECRClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ECRClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { UpdateRepositoryCreationTemplateRequest, UpdateRepositoryCreationTemplateResponse } from "../models/models_0"; +import { + de_UpdateRepositoryCreationTemplateCommand, + se_UpdateRepositoryCreationTemplateCommand, +} from "../protocols/Aws_json1_1"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link UpdateRepositoryCreationTemplateCommand}. + */ +export interface UpdateRepositoryCreationTemplateCommandInput extends UpdateRepositoryCreationTemplateRequest {} +/** + * @public + * + * The output of {@link UpdateRepositoryCreationTemplateCommand}. + */ +export interface UpdateRepositoryCreationTemplateCommandOutput + extends UpdateRepositoryCreationTemplateResponse, + __MetadataBearer {} + +/** + *

Updates an existing repository creation template.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { ECRClient, UpdateRepositoryCreationTemplateCommand } from "@aws-sdk/client-ecr"; // ES Modules import + * // const { ECRClient, UpdateRepositoryCreationTemplateCommand } = require("@aws-sdk/client-ecr"); // CommonJS import + * const client = new ECRClient(config); + * const input = { // UpdateRepositoryCreationTemplateRequest + * prefix: "STRING_VALUE", // required + * description: "STRING_VALUE", + * encryptionConfiguration: { // EncryptionConfigurationForRepositoryCreationTemplate + * encryptionType: "AES256" || "KMS", // required + * kmsKey: "STRING_VALUE", + * }, + * resourceTags: [ // TagList + * { // Tag + * Key: "STRING_VALUE", // required + * Value: "STRING_VALUE", // required + * }, + * ], + * imageTagMutability: "MUTABLE" || "IMMUTABLE", + * repositoryPolicy: "STRING_VALUE", + * lifecyclePolicy: "STRING_VALUE", + * appliedFor: [ // RCTAppliedForList + * "REPLICATION" || "PULL_THROUGH_CACHE", + * ], + * customRoleArn: "STRING_VALUE", + * }; + * const command = new UpdateRepositoryCreationTemplateCommand(input); + * const response = await client.send(command); + * // { // UpdateRepositoryCreationTemplateResponse + * // registryId: "STRING_VALUE", + * // repositoryCreationTemplate: { // RepositoryCreationTemplate + * // prefix: "STRING_VALUE", + * // description: "STRING_VALUE", + * // encryptionConfiguration: { // EncryptionConfigurationForRepositoryCreationTemplate + * // encryptionType: "AES256" || "KMS", // required + * // kmsKey: "STRING_VALUE", + * // }, + * // resourceTags: [ // TagList + * // { // Tag + * // Key: "STRING_VALUE", // required + * // Value: "STRING_VALUE", // required + * // }, + * // ], + * // imageTagMutability: "MUTABLE" || "IMMUTABLE", + * // repositoryPolicy: "STRING_VALUE", + * // lifecyclePolicy: "STRING_VALUE", + * // appliedFor: [ // RCTAppliedForList + * // "REPLICATION" || "PULL_THROUGH_CACHE", + * // ], + * // customRoleArn: "STRING_VALUE", + * // createdAt: new Date("TIMESTAMP"), + * // updatedAt: new Date("TIMESTAMP"), + * // }, + * // }; + * + * ``` + * + * @param UpdateRepositoryCreationTemplateCommandInput - {@link UpdateRepositoryCreationTemplateCommandInput} + * @returns {@link UpdateRepositoryCreationTemplateCommandOutput} + * @see {@link UpdateRepositoryCreationTemplateCommandInput} for command's `input` shape. + * @see {@link UpdateRepositoryCreationTemplateCommandOutput} for command's `response` shape. + * @see {@link ECRClientResolvedConfig | config} for ECRClient's `config` shape. + * + * @throws {@link InvalidParameterException} (client fault) + *

The specified parameter is invalid. Review the available parameters for the API + * request.

+ * + * @throws {@link ServerException} (server fault) + *

These errors are usually caused by a server-side issue.

+ * + * @throws {@link TemplateNotFoundException} (client fault) + *

The specified repository creation template can't be found. Verify the registry ID and + * prefix and try again.

+ * + * @throws {@link ValidationException} (client fault) + *

There was an exception validating this request.

+ * + * @throws {@link ECRServiceException} + *

Base exception class for all service exceptions from ECR service.

+ * + * @public + */ +export class UpdateRepositoryCreationTemplateCommand extends $Command + .classBuilder< + UpdateRepositoryCreationTemplateCommandInput, + UpdateRepositoryCreationTemplateCommandOutput, + ECRClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep({ + ...commonParams, + }) + .m(function (this: any, Command: any, cs: any, config: ECRClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AmazonEC2ContainerRegistry_V20150921", "UpdateRepositoryCreationTemplate", {}) + .n("ECRClient", "UpdateRepositoryCreationTemplateCommand") + .f(void 0, void 0) + .ser(se_UpdateRepositoryCreationTemplateCommand) + .de(de_UpdateRepositoryCreationTemplateCommand) + .build() {} diff --git a/clients/client-ecr/src/commands/index.ts b/clients/client-ecr/src/commands/index.ts index 1231e71a3e8fa..be06b2217def0 100644 --- a/clients/client-ecr/src/commands/index.ts +++ b/clients/client-ecr/src/commands/index.ts @@ -6,10 +6,12 @@ export * from "./BatchGetRepositoryScanningConfigurationCommand"; export * from "./CompleteLayerUploadCommand"; export * from "./CreatePullThroughCacheRuleCommand"; export * from "./CreateRepositoryCommand"; +export * from "./CreateRepositoryCreationTemplateCommand"; export * from "./DeleteLifecyclePolicyCommand"; export * from "./DeletePullThroughCacheRuleCommand"; export * from "./DeleteRegistryPolicyCommand"; export * from "./DeleteRepositoryCommand"; +export * from "./DeleteRepositoryCreationTemplateCommand"; export * from "./DeleteRepositoryPolicyCommand"; export * from "./DescribeImageReplicationStatusCommand"; export * from "./DescribeImageScanFindingsCommand"; @@ -17,6 +19,7 @@ export * from "./DescribeImagesCommand"; export * from "./DescribePullThroughCacheRulesCommand"; export * from "./DescribeRegistryCommand"; export * from "./DescribeRepositoriesCommand"; +export * from "./DescribeRepositoryCreationTemplatesCommand"; export * from "./GetAuthorizationTokenCommand"; export * from "./GetDownloadUrlForLayerCommand"; export * from "./GetLifecyclePolicyCommand"; @@ -40,5 +43,6 @@ export * from "./StartLifecyclePolicyPreviewCommand"; export * from "./TagResourceCommand"; export * from "./UntagResourceCommand"; export * from "./UpdatePullThroughCacheRuleCommand"; +export * from "./UpdateRepositoryCreationTemplateCommand"; export * from "./UploadLayerPartCommand"; export * from "./ValidatePullThroughCacheRuleCommand"; diff --git a/clients/client-ecr/src/models/models_0.ts b/clients/client-ecr/src/models/models_0.ts index 94c28a15c1c39..591e4e8230a4c 100644 --- a/clients/client-ecr/src/models/models_0.ts +++ b/clients/client-ecr/src/models/models_0.ts @@ -855,11 +855,6 @@ export interface CreatePullThroughCacheRuleRequest { * .azurecr.io *

* - *
  • - *

    GitLab Container Registry (gitlab-container-registry) - - * registry.gitlab.com - *

    - *
  • * * @public */ @@ -1052,7 +1047,7 @@ export type EncryptionType = (typeof EncryptionType)[keyof typeof EncryptionType * your repository are encrypted at rest.

    *

    By default, when no encryption configuration is set or the AES256 * encryption type is used, Amazon ECR uses server-side encryption with Amazon S3-managed encryption - * keys which encrypts your data at rest using an AES-256 encryption algorithm. This does + * keys which encrypts your data at rest using an AES256 encryption algorithm. This does * not require any action on your part.

    *

    For more control over the encryption of the contents of your repository, you can use * server-side encryption with Key Management Service key stored in Key Management Service (KMS) to encrypt your @@ -1072,7 +1067,7 @@ export interface EncryptionConfiguration { * Amazon Simple Storage Service Console Developer Guide.

    *

    If you use the AES256 encryption type, Amazon ECR uses server-side encryption * with Amazon S3-managed encryption keys which encrypts the images in the repository using an - * AES-256 encryption algorithm. For more information, see Protecting data using + * AES256 encryption algorithm. For more information, see Protecting data using * server-side encryption with Amazon S3-managed encryption keys (SSE-S3) in the * Amazon Simple Storage Service Console Developer Guide.

    * @public @@ -1324,6 +1319,260 @@ export class TooManyTagsException extends __BaseException { } } +/** + * @public + * @enum + */ +export const RCTAppliedFor = { + PULL_THROUGH_CACHE: "PULL_THROUGH_CACHE", + REPLICATION: "REPLICATION", +} as const; + +/** + * @public + */ +export type RCTAppliedFor = (typeof RCTAppliedFor)[keyof typeof RCTAppliedFor]; + +/** + *

    The encryption configuration to associate with the repository creation + * template.

    + * @public + */ +export interface EncryptionConfigurationForRepositoryCreationTemplate { + /** + *

    The encryption type to use.

    + *

    If you use the KMS encryption type, the contents of the repository will + * be encrypted using server-side encryption with Key Management Service key stored in KMS. When you + * use KMS to encrypt your data, you can either use the default Amazon Web Services managed KMS key + * for Amazon ECR, or specify your own KMS key, which you already created. For more + * information, see Protecting data using server-side + * encryption with an KMS key stored in Key Management Service (SSE-KMS) in the + * Amazon Simple Storage Service Console Developer Guide.

    + *

    If you use the AES256 encryption type, Amazon ECR uses server-side encryption + * with Amazon S3-managed encryption keys which encrypts the images in the repository using an + * AES256 encryption algorithm. For more information, see Protecting data using + * server-side encryption with Amazon S3-managed encryption keys (SSE-S3) in the + * Amazon Simple Storage Service Console Developer Guide.

    + * @public + */ + encryptionType: EncryptionType | undefined; + + /** + *

    If you use the KMS encryption type, specify the KMS key to use for + * encryption. The full ARN of the KMS key must be specified. The key must exist in the + * same Region as the repository. If no key is specified, the default Amazon Web Services managed KMS + * key for Amazon ECR will be used.

    + * @public + */ + kmsKey?: string; +} + +/** + * @public + */ +export interface CreateRepositoryCreationTemplateRequest { + /** + *

    The repository namespace prefix to associate with the template. All repositories + * created using this namespace prefix will have the settings defined in this template + * applied. For example, a prefix of prod would apply to all repositories + * beginning with prod/. Similarly, a prefix of prod/team would + * apply to all repositories beginning with prod/team/.

    + *

    To apply a template to all repositories in your registry that don't have an associated + * creation template, you can use ROOT as the prefix.

    + * + *

    There is always an assumed / applied to the end of the prefix. If you + * specify ecr-public as the prefix, Amazon ECR treats that as + * ecr-public/. When using a pull through cache rule, the repository + * prefix you specify during rule creation is what you should specify as your + * repository creation template prefix as well.

    + *
    + * @public + */ + prefix: string | undefined; + + /** + *

    A description for the repository creation template.

    + * @public + */ + description?: string; + + /** + *

    The encryption configuration to use for repositories created using the + * template.

    + * @public + */ + encryptionConfiguration?: EncryptionConfigurationForRepositoryCreationTemplate; + + /** + *

    The metadata to apply to the repository to help you categorize and organize. Each tag + * consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have + * a maximum length of 256 characters.

    + * @public + */ + resourceTags?: Tag[]; + + /** + *

    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. If IMMUTABLE is specified, all image tags within the + * repository will be immutable which will prevent them from being overwritten.

    + * @public + */ + imageTagMutability?: ImageTagMutability; + + /** + *

    The repository policy to apply to repositories created using the template. A + * repository policy is a permissions policy associated with a repository to control access + * permissions.

    + * @public + */ + repositoryPolicy?: string; + + /** + *

    The lifecycle policy to use for repositories created using the template.

    + * @public + */ + lifecyclePolicy?: string; + + /** + *

    A list of enumerable strings representing the Amazon ECR repository creation scenarios that + * this template will apply towards. The two supported scenarios are + * PULL_THROUGH_CACHE and REPLICATION + *

    + * @public + */ + appliedFor: RCTAppliedFor[] | undefined; + + /** + *

    The ARN of the role to be assumed by Amazon ECR. This role must be in the same account as + * the registry that you are configuring.

    + * @public + */ + customRoleArn?: string; +} + +/** + *

    The details of the repository creation template associated with the request.

    + * @public + */ +export interface RepositoryCreationTemplate { + /** + *

    The repository namespace prefix associated with the repository creation + * template.

    + * @public + */ + prefix?: string; + + /** + *

    The description associated with the repository creation template.

    + * @public + */ + description?: string; + + /** + *

    The encryption configuration associated with the repository creation template.

    + * @public + */ + encryptionConfiguration?: EncryptionConfigurationForRepositoryCreationTemplate; + + /** + *

    The metadata to apply to the repository to help you categorize and organize. Each tag + * consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have + * a maximum length of 256 characters.

    + * @public + */ + resourceTags?: Tag[]; + + /** + *

    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. + * If IMMUTABLE is specified, all image tags within the repository will be immutable which + * will prevent them from being overwritten.

    + * @public + */ + imageTagMutability?: ImageTagMutability; + + /** + *

    he repository policy to apply to repositories created using the template. A repository + * policy is a permissions policy associated with a repository to control access + * permissions.

    + * @public + */ + repositoryPolicy?: string; + + /** + *

    The lifecycle policy to use for repositories created using the template.

    + * @public + */ + lifecyclePolicy?: string; + + /** + *

    A list of enumerable Strings representing the repository creation scenarios that this + * template will apply towards. The two supported scenarios are PULL_THROUGH_CACHE and + * REPLICATION

    + * @public + */ + appliedFor?: RCTAppliedFor[]; + + /** + *

    The ARN of the role to be assumed by Amazon ECR.

    + * @public + */ + customRoleArn?: string; + + /** + *

    The date and time, in JavaScript date format, when the repository creation template + * was created.

    + * @public + */ + createdAt?: Date; + + /** + *

    The date and time, in JavaScript date format, when the repository creation template + * was last updated.

    + * @public + */ + updatedAt?: Date; +} + +/** + * @public + */ +export interface CreateRepositoryCreationTemplateResponse { + /** + *

    The registry ID associated with the request.

    + * @public + */ + registryId?: string; + + /** + *

    The details of the repository creation template associated with the request.

    + * @public + */ + repositoryCreationTemplate?: RepositoryCreationTemplate; +} + +/** + *

    The repository creation template already exists. Specify a unique prefix and try + * again.

    + * @public + */ +export class TemplateAlreadyExistsException extends __BaseException { + readonly name: "TemplateAlreadyExistsException" = "TemplateAlreadyExistsException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "TemplateAlreadyExistsException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, TemplateAlreadyExistsException.prototype); + } +} + /** * @public */ @@ -1567,6 +1816,56 @@ export class RepositoryNotEmptyException extends __BaseException { } } +/** + * @public + */ +export interface DeleteRepositoryCreationTemplateRequest { + /** + *

    The repository namespace prefix associated with the repository creation + * template.

    + * @public + */ + prefix: string | undefined; +} + +/** + * @public + */ +export interface DeleteRepositoryCreationTemplateResponse { + /** + *

    The registry ID associated with the request.

    + * @public + */ + registryId?: string; + + /** + *

    The details of the repository creation template that was deleted.

    + * @public + */ + repositoryCreationTemplate?: RepositoryCreationTemplate; +} + +/** + *

    The specified repository creation template can't be found. Verify the registry ID and + * prefix and try again.

    + * @public + */ +export class TemplateNotFoundException extends __BaseException { + readonly name: "TemplateNotFoundException" = "TemplateNotFoundException"; + readonly $fault: "client" = "client"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "TemplateNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, TemplateNotFoundException.prototype); + } +} + /** * @public */ @@ -2884,7 +3183,7 @@ export interface ReplicationConfiguration { */ export interface DescribeRegistryResponse { /** - *

    The ID of the registry.

    + *

    The registry ID associated with the request.

    * @public */ registryId?: string; @@ -2966,6 +3265,78 @@ export interface DescribeRepositoriesResponse { nextToken?: string; } +/** + * @public + */ +export interface DescribeRepositoryCreationTemplatesRequest { + /** + *

    The repository namespace prefixes associated with the repository creation templates to + * describe. If this value is not specified, all repository creation templates are + * returned.

    + * @public + */ + prefixes?: string[]; + + /** + *

    The nextToken value returned from a previous paginated + * DescribeRepositoryCreationTemplates request where + * maxResults was used and the results exceeded the value of that + * parameter. Pagination continues from the end of the previous results that returned the + * nextToken value. This value is null when there are no more + * results to return.

    + * + *

    This token should be treated as an opaque identifier that is only used to + * retrieve the next items in a list and not for other programmatic purposes.

    + *
    + * @public + */ + nextToken?: string; + + /** + *

    The maximum number of repository results returned by + * DescribeRepositoryCreationTemplatesRequest in paginated output. When + * this parameter is used, DescribeRepositoryCreationTemplatesRequest only + * returns maxResults results in a single page along with a + * nextToken response element. The remaining results of the initial + * request can be seen by sending another + * DescribeRepositoryCreationTemplatesRequest request with the returned + * nextToken value. This value can be between 1 and + * 1000. If this parameter is not used, then + * DescribeRepositoryCreationTemplatesRequest returns up to + * 100 results and a nextToken value, if applicable.

    + * @public + */ + maxResults?: number; +} + +/** + * @public + */ +export interface DescribeRepositoryCreationTemplatesResponse { + /** + *

    The registry ID associated with the request.

    + * @public + */ + registryId?: string; + + /** + *

    The details of the repository creation templates.

    + * @public + */ + repositoryCreationTemplates?: RepositoryCreationTemplate[]; + + /** + *

    The nextToken value to include in a future + * DescribeRepositoryCreationTemplates request. When the results of a + * DescribeRepositoryCreationTemplates request exceed + * maxResults, this value can be used to retrieve the next page of + * results. This value is null when there are no more results to + * return.

    + * @public + */ + nextToken?: string; +} + /** * @public */ @@ -3416,7 +3787,7 @@ export interface GetRegistryPolicyRequest {} */ export interface GetRegistryPolicyResponse { /** - *

    The ID of the registry.

    + *

    The registry ID associated with the request.

    * @public */ registryId?: string; @@ -3494,7 +3865,7 @@ export interface RegistryScanningConfiguration { */ export interface GetRegistryScanningConfigurationResponse { /** - *

    The ID of the registry.

    + *

    The registry ID associated with the request.

    * @public */ registryId?: string; @@ -3999,7 +4370,7 @@ export interface PutRegistryPolicyRequest { */ export interface PutRegistryPolicyResponse { /** - *

    The registry ID.

    + *

    The registry ID associated with the request.

    * @public */ registryId?: string; @@ -4380,6 +4751,101 @@ export interface UpdatePullThroughCacheRuleResponse { credentialArn?: string; } +/** + * @public + */ +export interface UpdateRepositoryCreationTemplateRequest { + /** + *

    The repository namespace prefix that matches an existing repository creation template + * in the registry. All repositories created using this namespace prefix will have the + * settings defined in this template applied. For example, a prefix of prod + * would apply to all repositories beginning with prod/. This includes a + * repository named prod/team1 as well as a repository named + * prod/repository1.

    + *

    To apply a template to all repositories in your registry that don't have an associated + * creation template, you can use ROOT as the prefix.

    + * @public + */ + prefix: string | undefined; + + /** + *

    A description for the repository creation template.

    + * @public + */ + description?: string; + + /** + *

    The encryption configuration to associate with the repository creation + * template.

    + * @public + */ + encryptionConfiguration?: EncryptionConfigurationForRepositoryCreationTemplate; + + /** + *

    The metadata to apply to the repository to help you categorize and organize. Each tag + * consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have + * a maximum length of 256 characters.

    + * @public + */ + resourceTags?: Tag[]; + + /** + *

    Updates 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. If IMMUTABLE is specified, all image tags within the + * repository will be immutable which will prevent them from being overwritten.

    + * @public + */ + imageTagMutability?: ImageTagMutability; + + /** + *

    Updates the repository policy created using the template. A repository policy is a + * permissions policy associated with a repository to control access permissions.

    + * @public + */ + repositoryPolicy?: string; + + /** + *

    Updates the lifecycle policy associated with the specified repository creation + * template.

    + * @public + */ + lifecyclePolicy?: string; + + /** + *

    Updates the list of enumerable strings representing the Amazon ECR repository creation + * scenarios that this template will apply towards. The two supported scenarios are + * PULL_THROUGH_CACHE and REPLICATION + *

    + * @public + */ + appliedFor?: RCTAppliedFor[]; + + /** + *

    The ARN of the role to be assumed by Amazon ECR. This role must be in the same account as + * the registry that you are configuring.

    + * @public + */ + customRoleArn?: string; +} + +/** + * @public + */ +export interface UpdateRepositoryCreationTemplateResponse { + /** + *

    The registry ID associated with the request.

    + * @public + */ + registryId?: string; + + /** + *

    The details of the repository creation template associated with the request.

    + * @public + */ + repositoryCreationTemplate?: RepositoryCreationTemplate; +} + /** *

    The layer part size is not valid, or the first byte specified is not consecutive to * the last byte of a previous layer part upload.

    diff --git a/clients/client-ecr/src/pagination/DescribeRepositoryCreationTemplatesPaginator.ts b/clients/client-ecr/src/pagination/DescribeRepositoryCreationTemplatesPaginator.ts new file mode 100644 index 0000000000000..3cbb5ff374c24 --- /dev/null +++ b/clients/client-ecr/src/pagination/DescribeRepositoryCreationTemplatesPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { + DescribeRepositoryCreationTemplatesCommand, + DescribeRepositoryCreationTemplatesCommandInput, + DescribeRepositoryCreationTemplatesCommandOutput, +} from "../commands/DescribeRepositoryCreationTemplatesCommand"; +import { ECRClient } from "../ECRClient"; +import { ECRPaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateDescribeRepositoryCreationTemplates: ( + config: ECRPaginationConfiguration, + input: DescribeRepositoryCreationTemplatesCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + ECRPaginationConfiguration, + DescribeRepositoryCreationTemplatesCommandInput, + DescribeRepositoryCreationTemplatesCommandOutput +>(ECRClient, DescribeRepositoryCreationTemplatesCommand, "nextToken", "nextToken", "maxResults"); diff --git a/clients/client-ecr/src/pagination/index.ts b/clients/client-ecr/src/pagination/index.ts index 5da38279308f4..7f6be5ee21e00 100644 --- a/clients/client-ecr/src/pagination/index.ts +++ b/clients/client-ecr/src/pagination/index.ts @@ -6,6 +6,8 @@ export * from "./DescribePullThroughCacheRulesPaginator"; export * from "./DescribeRepositoriesPaginator"; +export * from "./DescribeRepositoryCreationTemplatesPaginator"; + export * from "./GetLifecyclePolicyPreviewPaginator"; // smithy-typescript generated code export * from "./Interfaces"; diff --git a/clients/client-ecr/src/protocols/Aws_json1_1.ts b/clients/client-ecr/src/protocols/Aws_json1_1.ts index 7f961e83d9964..32bcc39806849 100644 --- a/clients/client-ecr/src/protocols/Aws_json1_1.ts +++ b/clients/client-ecr/src/protocols/Aws_json1_1.ts @@ -41,6 +41,10 @@ import { CreatePullThroughCacheRuleCommandOutput, } from "../commands/CreatePullThroughCacheRuleCommand"; import { CreateRepositoryCommandInput, CreateRepositoryCommandOutput } from "../commands/CreateRepositoryCommand"; +import { + CreateRepositoryCreationTemplateCommandInput, + CreateRepositoryCreationTemplateCommandOutput, +} from "../commands/CreateRepositoryCreationTemplateCommand"; import { DeleteLifecyclePolicyCommandInput, DeleteLifecyclePolicyCommandOutput, @@ -54,6 +58,10 @@ import { DeleteRegistryPolicyCommandOutput, } from "../commands/DeleteRegistryPolicyCommand"; import { DeleteRepositoryCommandInput, DeleteRepositoryCommandOutput } from "../commands/DeleteRepositoryCommand"; +import { + DeleteRepositoryCreationTemplateCommandInput, + DeleteRepositoryCreationTemplateCommandOutput, +} from "../commands/DeleteRepositoryCreationTemplateCommand"; import { DeleteRepositoryPolicyCommandInput, DeleteRepositoryPolicyCommandOutput, @@ -76,6 +84,10 @@ import { DescribeRepositoriesCommandInput, DescribeRepositoriesCommandOutput, } from "../commands/DescribeRepositoriesCommand"; +import { + DescribeRepositoryCreationTemplatesCommandInput, + DescribeRepositoryCreationTemplatesCommandOutput, +} from "../commands/DescribeRepositoryCreationTemplatesCommand"; import { GetAuthorizationTokenCommandInput, GetAuthorizationTokenCommandOutput, @@ -141,6 +153,10 @@ import { UpdatePullThroughCacheRuleCommandInput, UpdatePullThroughCacheRuleCommandOutput, } from "../commands/UpdatePullThroughCacheRuleCommand"; +import { + UpdateRepositoryCreationTemplateCommandInput, + UpdateRepositoryCreationTemplateCommandOutput, +} from "../commands/UpdateRepositoryCreationTemplateCommand"; import { UploadLayerPartCommandInput, UploadLayerPartCommandOutput } from "../commands/UploadLayerPartCommand"; import { ValidatePullThroughCacheRuleCommandInput, @@ -157,6 +173,8 @@ import { CompleteLayerUploadRequest, CreatePullThroughCacheRuleRequest, CreatePullThroughCacheRuleResponse, + CreateRepositoryCreationTemplateRequest, + CreateRepositoryCreationTemplateResponse, CreateRepositoryRequest, CreateRepositoryResponse, CvssScore, @@ -166,6 +184,8 @@ import { DeletePullThroughCacheRuleRequest, DeletePullThroughCacheRuleResponse, DeleteRegistryPolicyRequest, + DeleteRepositoryCreationTemplateRequest, + DeleteRepositoryCreationTemplateResponse, DeleteRepositoryPolicyRequest, DeleteRepositoryRequest, DeleteRepositoryResponse, @@ -180,8 +200,11 @@ import { DescribeRegistryRequest, DescribeRepositoriesRequest, DescribeRepositoriesResponse, + DescribeRepositoryCreationTemplatesRequest, + DescribeRepositoryCreationTemplatesResponse, EmptyUploadException, EncryptionConfiguration, + EncryptionConfigurationForRepositoryCreationTemplate, EnhancedImageScanFinding, GetAuthorizationTokenRequest, GetAuthorizationTokenResponse, @@ -232,6 +255,7 @@ import { PutRegistryPolicyRequest, PutRegistryScanningConfigurationRequest, PutReplicationConfigurationRequest, + RCTAppliedFor, ReferencedImagesNotFoundException, RegistryPolicyNotFoundException, RegistryScanningRule, @@ -240,6 +264,7 @@ import { ReplicationRule, Repository, RepositoryAlreadyExistsException, + RepositoryCreationTemplate, RepositoryFilter, RepositoryNotEmptyException, RepositoryNotFoundException, @@ -256,6 +281,8 @@ import { StartLifecyclePolicyPreviewRequest, Tag, TagResourceRequest, + TemplateAlreadyExistsException, + TemplateNotFoundException, TooManyTagsException, UnableToAccessSecretException, UnableToDecryptSecretValueException, @@ -266,6 +293,8 @@ import { UntagResourceRequest, UpdatePullThroughCacheRuleRequest, UpdatePullThroughCacheRuleResponse, + UpdateRepositoryCreationTemplateRequest, + UpdateRepositoryCreationTemplateResponse, UploadLayerPartRequest, UploadNotFoundException, ValidatePullThroughCacheRuleRequest, @@ -363,6 +392,19 @@ export const se_CreateRepositoryCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_1CreateRepositoryCreationTemplateCommand + */ +export const se_CreateRepositoryCreationTemplateCommand = async ( + input: CreateRepositoryCreationTemplateCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("CreateRepositoryCreationTemplate"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_1DeleteLifecyclePolicyCommand */ @@ -415,6 +457,19 @@ export const se_DeleteRepositoryCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_1DeleteRepositoryCreationTemplateCommand + */ +export const se_DeleteRepositoryCreationTemplateCommand = async ( + input: DeleteRepositoryCreationTemplateCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("DeleteRepositoryCreationTemplate"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_1DeleteRepositoryPolicyCommand */ @@ -506,6 +561,19 @@ export const se_DescribeRepositoriesCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_1DescribeRepositoryCreationTemplatesCommand + */ +export const se_DescribeRepositoryCreationTemplatesCommand = async ( + input: DescribeRepositoryCreationTemplatesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("DescribeRepositoryCreationTemplates"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_1GetAuthorizationTokenCommand */ @@ -805,6 +873,19 @@ export const se_UpdatePullThroughCacheRuleCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_1UpdateRepositoryCreationTemplateCommand + */ +export const se_UpdateRepositoryCreationTemplateCommand = async ( + input: UpdateRepositoryCreationTemplateCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("UpdateRepositoryCreationTemplate"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_1UploadLayerPartCommand */ @@ -971,6 +1052,26 @@ export const de_CreateRepositoryCommand = async ( return response; }; +/** + * deserializeAws_json1_1CreateRepositoryCreationTemplateCommand + */ +export const de_CreateRepositoryCreationTemplateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateRepositoryCreationTemplateResponse(data, context); + const response: CreateRepositoryCreationTemplateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + /** * deserializeAws_json1_1DeleteLifecyclePolicyCommand */ @@ -1051,6 +1152,26 @@ export const de_DeleteRepositoryCommand = async ( return response; }; +/** + * deserializeAws_json1_1DeleteRepositoryCreationTemplateCommand + */ +export const de_DeleteRepositoryCreationTemplateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DeleteRepositoryCreationTemplateResponse(data, context); + const response: DeleteRepositoryCreationTemplateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + /** * deserializeAws_json1_1DeleteRepositoryPolicyCommand */ @@ -1191,6 +1312,26 @@ export const de_DescribeRepositoriesCommand = async ( return response; }; +/** + * deserializeAws_json1_1DescribeRepositoryCreationTemplatesCommand + */ +export const de_DescribeRepositoryCreationTemplatesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_DescribeRepositoryCreationTemplatesResponse(data, context); + const response: DescribeRepositoryCreationTemplatesCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + /** * deserializeAws_json1_1GetAuthorizationTokenCommand */ @@ -1651,6 +1792,26 @@ export const de_UpdatePullThroughCacheRuleCommand = async ( return response; }; +/** + * deserializeAws_json1_1UpdateRepositoryCreationTemplateCommand + */ +export const de_UpdateRepositoryCreationTemplateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateRepositoryCreationTemplateResponse(data, context); + const response: UpdateRepositoryCreationTemplateCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + /** * deserializeAws_json1_1UploadLayerPartCommand */ @@ -1761,6 +1922,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): case "TooManyTagsException": case "com.amazonaws.ecr#TooManyTagsException": throw await de_TooManyTagsExceptionRes(parsedOutput, context); + case "TemplateAlreadyExistsException": + case "com.amazonaws.ecr#TemplateAlreadyExistsException": + throw await de_TemplateAlreadyExistsExceptionRes(parsedOutput, context); case "LifecyclePolicyNotFoundException": case "com.amazonaws.ecr#LifecyclePolicyNotFoundException": throw await de_LifecyclePolicyNotFoundExceptionRes(parsedOutput, context); @@ -1773,6 +1937,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): case "RepositoryNotEmptyException": case "com.amazonaws.ecr#RepositoryNotEmptyException": throw await de_RepositoryNotEmptyExceptionRes(parsedOutput, context); + case "TemplateNotFoundException": + case "com.amazonaws.ecr#TemplateNotFoundException": + throw await de_TemplateNotFoundExceptionRes(parsedOutput, context); case "RepositoryPolicyNotFoundException": case "com.amazonaws.ecr#RepositoryPolicyNotFoundException": throw await de_RepositoryPolicyNotFoundExceptionRes(parsedOutput, context); @@ -2283,6 +2450,38 @@ const de_ServerExceptionRes = async (parsedOutput: any, context: __SerdeContext) return __decorateServiceException(exception, body); }; +/** + * deserializeAws_json1_1TemplateAlreadyExistsExceptionRes + */ +const de_TemplateAlreadyExistsExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new TemplateAlreadyExistsException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_1TemplateNotFoundExceptionRes + */ +const de_TemplateNotFoundExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new TemplateNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + /** * deserializeAws_json1_1TooManyTagsExceptionRes */ @@ -2438,6 +2637,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_CreatePullThroughCacheRuleRequest omitted. +// se_CreateRepositoryCreationTemplateRequest omitted. + // se_CreateRepositoryRequest omitted. // se_DeleteLifecyclePolicyRequest omitted. @@ -2446,6 +2647,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_DeleteRegistryPolicyRequest omitted. +// se_DeleteRepositoryCreationTemplateRequest omitted. + // se_DeleteRepositoryPolicyRequest omitted. // se_DeleteRepositoryRequest omitted. @@ -2464,8 +2667,12 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_DescribeRepositoriesRequest omitted. +// se_DescribeRepositoryCreationTemplatesRequest omitted. + // se_EncryptionConfiguration omitted. +// se_EncryptionConfigurationForRepositoryCreationTemplate omitted. + // se_GetAuthorizationTokenRegistryIdList omitted. // se_GetAuthorizationTokenRequest omitted. @@ -2502,6 +2709,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_MediaTypeList omitted. +// se_PrefixList omitted. + // se_PullThroughCacheRuleRepositoryPrefixList omitted. // se_PutImageRequest omitted. @@ -2518,6 +2727,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_PutReplicationConfigurationRequest omitted. +// se_RCTAppliedForList omitted. + // se_RegistryScanningRule omitted. // se_RegistryScanningRuleList omitted. @@ -2562,6 +2773,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_UpdatePullThroughCacheRuleRequest omitted. +// se_UpdateRepositoryCreationTemplateRequest omitted. + /** * serializeAws_json1_1UploadLayerPartRequest */ @@ -2648,6 +2861,19 @@ const de_CreatePullThroughCacheRuleResponse = ( }) as any; }; +/** + * deserializeAws_json1_1CreateRepositoryCreationTemplateResponse + */ +const de_CreateRepositoryCreationTemplateResponse = ( + output: any, + context: __SerdeContext +): CreateRepositoryCreationTemplateResponse => { + return take(output, { + registryId: __expectString, + repositoryCreationTemplate: (_: any) => de_RepositoryCreationTemplate(_, context), + }) as any; +}; + /** * deserializeAws_json1_1CreateRepositoryResponse */ @@ -2728,6 +2954,19 @@ const de_DeletePullThroughCacheRuleResponse = ( // de_DeleteRegistryPolicyResponse omitted. +/** + * deserializeAws_json1_1DeleteRepositoryCreationTemplateResponse + */ +const de_DeleteRepositoryCreationTemplateResponse = ( + output: any, + context: __SerdeContext +): DeleteRepositoryCreationTemplateResponse => { + return take(output, { + registryId: __expectString, + repositoryCreationTemplate: (_: any) => de_RepositoryCreationTemplate(_, context), + }) as any; +}; + // de_DeleteRepositoryPolicyResponse omitted. /** @@ -2793,10 +3032,26 @@ const de_DescribeRepositoriesResponse = (output: any, context: __SerdeContext): }) as any; }; +/** + * deserializeAws_json1_1DescribeRepositoryCreationTemplatesResponse + */ +const de_DescribeRepositoryCreationTemplatesResponse = ( + output: any, + context: __SerdeContext +): DescribeRepositoryCreationTemplatesResponse => { + return take(output, { + nextToken: __expectString, + registryId: __expectString, + repositoryCreationTemplates: (_: any) => de_RepositoryCreationTemplateList(_, context), + }) as any; +}; + // de_EmptyUploadException omitted. // de_EncryptionConfiguration omitted. +// de_EncryptionConfigurationForRepositoryCreationTemplate omitted. + /** * deserializeAws_json1_1EnhancedImageScanFinding */ @@ -3104,6 +3359,8 @@ const de_PullThroughCacheRuleList = (output: any, context: __SerdeContext): Pull // de_PutReplicationConfigurationResponse omitted. +// de_RCTAppliedForList omitted. + // de_Recommendation omitted. // de_ReferencedImagesNotFoundException omitted. @@ -3150,6 +3407,37 @@ const de_Repository = (output: any, context: __SerdeContext): Repository => { // de_RepositoryAlreadyExistsException omitted. +/** + * deserializeAws_json1_1RepositoryCreationTemplate + */ +const de_RepositoryCreationTemplate = (output: any, context: __SerdeContext): RepositoryCreationTemplate => { + return take(output, { + appliedFor: _json, + createdAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + customRoleArn: __expectString, + description: __expectString, + encryptionConfiguration: _json, + imageTagMutability: __expectString, + lifecyclePolicy: __expectString, + prefix: __expectString, + repositoryPolicy: __expectString, + resourceTags: _json, + updatedAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }) as any; +}; + +/** + * deserializeAws_json1_1RepositoryCreationTemplateList + */ +const de_RepositoryCreationTemplateList = (output: any, context: __SerdeContext): RepositoryCreationTemplate[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_RepositoryCreationTemplate(entry, context); + }); + return retVal; +}; + // de_RepositoryFilter omitted. // de_RepositoryFilterList omitted. @@ -3246,6 +3534,10 @@ const de_ScoreDetails = (output: any, context: __SerdeContext): ScoreDetails => // de_Tags omitted. +// de_TemplateAlreadyExistsException omitted. + +// de_TemplateNotFoundException omitted. + // de_TooManyTagsException omitted. // de_UnableToAccessSecretException omitted. @@ -3277,6 +3569,19 @@ const de_UpdatePullThroughCacheRuleResponse = ( }) as any; }; +/** + * deserializeAws_json1_1UpdateRepositoryCreationTemplateResponse + */ +const de_UpdateRepositoryCreationTemplateResponse = ( + output: any, + context: __SerdeContext +): UpdateRepositoryCreationTemplateResponse => { + return take(output, { + registryId: __expectString, + repositoryCreationTemplate: (_: any) => de_RepositoryCreationTemplate(_, context), + }) as any; +}; + // de_UploadLayerPartResponse omitted. // de_UploadNotFoundException omitted. diff --git a/codegen/sdk-codegen/aws-models/ecr.json b/codegen/sdk-codegen/aws-models/ecr.json index b17d15f302cdc..6553ac7d64e68 100644 --- a/codegen/sdk-codegen/aws-models/ecr.json +++ b/codegen/sdk-codegen/aws-models/ecr.json @@ -54,6 +54,9 @@ { "target": "com.amazonaws.ecr#CreateRepository" }, + { + "target": "com.amazonaws.ecr#CreateRepositoryCreationTemplate" + }, { "target": "com.amazonaws.ecr#DeleteLifecyclePolicy" }, @@ -66,6 +69,9 @@ { "target": "com.amazonaws.ecr#DeleteRepository" }, + { + "target": "com.amazonaws.ecr#DeleteRepositoryCreationTemplate" + }, { "target": "com.amazonaws.ecr#DeleteRepositoryPolicy" }, @@ -87,6 +93,9 @@ { "target": "com.amazonaws.ecr#DescribeRepositories" }, + { + "target": "com.amazonaws.ecr#DescribeRepositoryCreationTemplates" + }, { "target": "com.amazonaws.ecr#GetAuthorizationToken" }, @@ -156,6 +165,9 @@ { "target": "com.amazonaws.ecr#UpdatePullThroughCacheRule" }, + { + "target": "com.amazonaws.ecr#UpdateRepositoryCreationTemplate" + }, { "target": "com.amazonaws.ecr#UploadLayerPart" }, @@ -1905,7 +1917,7 @@ "upstreamRegistryUrl": { "target": "com.amazonaws.ecr#Url", "traits": { - "smithy.api#documentation": "

    The registry URL of the upstream public registry to use as the source for the pull\n through cache rule. The following is the syntax to use for each supported upstream\n registry.

    \n
      \n
    • \n

      Amazon ECR Public (ecr-public) - public.ecr.aws\n

      \n
    • \n
    • \n

      Docker Hub (docker-hub) -\n registry-1.docker.io\n

      \n
    • \n
    • \n

      Quay (quay) - quay.io\n

      \n
    • \n
    • \n

      Kubernetes (k8s) - registry.k8s.io\n

      \n
    • \n
    • \n

      GitHub Container Registry (github-container-registry) -\n ghcr.io\n

      \n
    • \n
    • \n

      Microsoft Azure Container Registry (azure-container-registry) -\n .azurecr.io\n

      \n
    • \n
    • \n

      GitLab Container Registry (gitlab-container-registry) -\n registry.gitlab.com\n

      \n
    • \n
    ", + "smithy.api#documentation": "

    The registry URL of the upstream public registry to use as the source for the pull\n through cache rule. The following is the syntax to use for each supported upstream\n registry.

    \n
      \n
    • \n

      Amazon ECR Public (ecr-public) - public.ecr.aws\n

      \n
    • \n
    • \n

      Docker Hub (docker-hub) -\n registry-1.docker.io\n

      \n
    • \n
    • \n

      Quay (quay) - quay.io\n

      \n
    • \n
    • \n

      Kubernetes (k8s) - registry.k8s.io\n

      \n
    • \n
    • \n

      GitHub Container Registry (github-container-registry) -\n ghcr.io\n

      \n
    • \n
    • \n

      Microsoft Azure Container Registry (azure-container-registry) -\n .azurecr.io\n

      \n
    • \n
    ", "smithy.api#required": {} } }, @@ -2027,6 +2039,119 @@ ] } }, + "com.amazonaws.ecr#CreateRepositoryCreationTemplate": { + "type": "operation", + "input": { + "target": "com.amazonaws.ecr#CreateRepositoryCreationTemplateRequest" + }, + "output": { + "target": "com.amazonaws.ecr#CreateRepositoryCreationTemplateResponse" + }, + "errors": [ + { + "target": "com.amazonaws.ecr#InvalidParameterException" + }, + { + "target": "com.amazonaws.ecr#LimitExceededException" + }, + { + "target": "com.amazonaws.ecr#ServerException" + }, + { + "target": "com.amazonaws.ecr#TemplateAlreadyExistsException" + }, + { + "target": "com.amazonaws.ecr#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

    Creates a repository creation template. This template is used to define the settings\n for repositories created by Amazon ECR on your behalf. For example, repositories created\n through pull through cache actions. For more information, see Private\n repository creation templates in the\n Amazon Elastic Container Registry User Guide.

    " + } + }, + "com.amazonaws.ecr#CreateRepositoryCreationTemplateRequest": { + "type": "structure", + "members": { + "prefix": { + "target": "com.amazonaws.ecr#Prefix", + "traits": { + "smithy.api#documentation": "

    The repository namespace prefix to associate with the template. All repositories\n created using this namespace prefix will have the settings defined in this template\n applied. For example, a prefix of prod would apply to all repositories\n beginning with prod/. Similarly, a prefix of prod/team would\n apply to all repositories beginning with prod/team/.

    \n

    To apply a template to all repositories in your registry that don't have an associated\n creation template, you can use ROOT as the prefix.

    \n \n

    There is always an assumed / applied to the end of the prefix. If you\n specify ecr-public as the prefix, Amazon ECR treats that as\n ecr-public/. When using a pull through cache rule, the repository\n prefix you specify during rule creation is what you should specify as your\n repository creation template prefix as well.

    \n
    ", + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.ecr#RepositoryTemplateDescription", + "traits": { + "smithy.api#documentation": "

    A description for the repository creation template.

    " + } + }, + "encryptionConfiguration": { + "target": "com.amazonaws.ecr#EncryptionConfigurationForRepositoryCreationTemplate", + "traits": { + "smithy.api#documentation": "

    The encryption configuration to use for repositories created using the\n template.

    " + } + }, + "resourceTags": { + "target": "com.amazonaws.ecr#TagList", + "traits": { + "smithy.api#documentation": "

    The metadata to apply to the repository to help you categorize and organize. Each tag\n consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have\n a maximum length of 256 characters.

    " + } + }, + "imageTagMutability": { + "target": "com.amazonaws.ecr#ImageTagMutability", + "traits": { + "smithy.api#documentation": "

    The tag mutability setting for the repository. If this parameter is omitted, the\n default setting of MUTABLE will be used which will allow image tags to be\n overwritten. If IMMUTABLE is specified, all image tags within the\n repository will be immutable which will prevent them from being overwritten.

    " + } + }, + "repositoryPolicy": { + "target": "com.amazonaws.ecr#RepositoryPolicyText", + "traits": { + "smithy.api#documentation": "

    The repository policy to apply to repositories created using the template. A\n repository policy is a permissions policy associated with a repository to control access\n permissions.

    " + } + }, + "lifecyclePolicy": { + "target": "com.amazonaws.ecr#LifecyclePolicyTextForRepositoryCreationTemplate", + "traits": { + "smithy.api#documentation": "

    The lifecycle policy to use for repositories created using the template.

    " + } + }, + "appliedFor": { + "target": "com.amazonaws.ecr#RCTAppliedForList", + "traits": { + "smithy.api#documentation": "

    A list of enumerable strings representing the Amazon ECR repository creation scenarios that\n this template will apply towards. The two supported scenarios are\n PULL_THROUGH_CACHE and REPLICATION\n

    ", + "smithy.api#required": {} + } + }, + "customRoleArn": { + "target": "com.amazonaws.ecr#CustomRoleArn", + "traits": { + "smithy.api#documentation": "

    The ARN of the role to be assumed by Amazon ECR. This role must be in the same account as\n the registry that you are configuring.

    " + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.ecr#CreateRepositoryCreationTemplateResponse": { + "type": "structure", + "members": { + "registryId": { + "target": "com.amazonaws.ecr#RegistryId", + "traits": { + "smithy.api#documentation": "

    The registry ID associated with the request.

    " + } + }, + "repositoryCreationTemplate": { + "target": "com.amazonaws.ecr#RepositoryCreationTemplate", + "traits": { + "smithy.api#documentation": "

    The details of the repository creation template associated with the request.

    " + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.ecr#CreateRepositoryRequest": { "type": "structure", "members": { @@ -2099,6 +2224,15 @@ "smithy.api#pattern": "^arn:aws:secretsmanager:[a-zA-Z0-9-:]+:secret:ecr\\-pullthroughcache\\/[a-zA-Z0-9\\/_+=.@-]+$" } }, + "com.amazonaws.ecr#CustomRoleArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 2048 + } + } + }, "com.amazonaws.ecr#CvssScore": { "type": "structure", "members": { @@ -2472,6 +2606,67 @@ ] } }, + "com.amazonaws.ecr#DeleteRepositoryCreationTemplate": { + "type": "operation", + "input": { + "target": "com.amazonaws.ecr#DeleteRepositoryCreationTemplateRequest" + }, + "output": { + "target": "com.amazonaws.ecr#DeleteRepositoryCreationTemplateResponse" + }, + "errors": [ + { + "target": "com.amazonaws.ecr#InvalidParameterException" + }, + { + "target": "com.amazonaws.ecr#ServerException" + }, + { + "target": "com.amazonaws.ecr#TemplateNotFoundException" + }, + { + "target": "com.amazonaws.ecr#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

    Deletes a repository creation template.

    " + } + }, + "com.amazonaws.ecr#DeleteRepositoryCreationTemplateRequest": { + "type": "structure", + "members": { + "prefix": { + "target": "com.amazonaws.ecr#Prefix", + "traits": { + "smithy.api#documentation": "

    The repository namespace prefix associated with the repository creation\n template.

    ", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.ecr#DeleteRepositoryCreationTemplateResponse": { + "type": "structure", + "members": { + "registryId": { + "target": "com.amazonaws.ecr#RegistryId", + "traits": { + "smithy.api#documentation": "

    The registry ID associated with the request.

    " + } + }, + "repositoryCreationTemplate": { + "target": "com.amazonaws.ecr#RepositoryCreationTemplate", + "traits": { + "smithy.api#documentation": "

    The details of the repository creation template that was deleted.

    " + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.ecr#DeleteRepositoryPolicy": { "type": "operation", "input": { @@ -3056,7 +3251,7 @@ "registryId": { "target": "com.amazonaws.ecr#RegistryId", "traits": { - "smithy.api#documentation": "

    The ID of the registry.

    " + "smithy.api#documentation": "

    The registry ID associated with the request.

    " } }, "replicationConfiguration": { @@ -3171,6 +3366,87 @@ "smithy.api#output": {} } }, + "com.amazonaws.ecr#DescribeRepositoryCreationTemplates": { + "type": "operation", + "input": { + "target": "com.amazonaws.ecr#DescribeRepositoryCreationTemplatesRequest" + }, + "output": { + "target": "com.amazonaws.ecr#DescribeRepositoryCreationTemplatesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.ecr#InvalidParameterException" + }, + { + "target": "com.amazonaws.ecr#ServerException" + }, + { + "target": "com.amazonaws.ecr#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

    Returns details about the repository creation templates in a registry. The\n prefixes request parameter can be used to return the details for a\n specific repository creation template.

    ", + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "items": "repositoryCreationTemplates", + "pageSize": "maxResults" + } + } + }, + "com.amazonaws.ecr#DescribeRepositoryCreationTemplatesRequest": { + "type": "structure", + "members": { + "prefixes": { + "target": "com.amazonaws.ecr#PrefixList", + "traits": { + "smithy.api#documentation": "

    The repository namespace prefixes associated with the repository creation templates to\n describe. If this value is not specified, all repository creation templates are\n returned.

    " + } + }, + "nextToken": { + "target": "com.amazonaws.ecr#NextToken", + "traits": { + "smithy.api#documentation": "

    The nextToken value returned from a previous paginated\n DescribeRepositoryCreationTemplates request where\n maxResults was used and the results exceeded the value of that\n parameter. Pagination continues from the end of the previous results that returned the\n nextToken value. This value is null when there are no more\n results to return.

    \n \n

    This token should be treated as an opaque identifier that is only used to\n retrieve the next items in a list and not for other programmatic purposes.

    \n
    " + } + }, + "maxResults": { + "target": "com.amazonaws.ecr#MaxResults", + "traits": { + "smithy.api#documentation": "

    The maximum number of repository results returned by\n DescribeRepositoryCreationTemplatesRequest in paginated output. When\n this parameter is used, DescribeRepositoryCreationTemplatesRequest only\n returns maxResults results in a single page along with a\n nextToken response element. The remaining results of the initial\n request can be seen by sending another\n DescribeRepositoryCreationTemplatesRequest request with the returned\n nextToken value. This value can be between 1 and\n 1000. If this parameter is not used, then\n DescribeRepositoryCreationTemplatesRequest returns up to\n 100 results and a nextToken value, if applicable.

    " + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.ecr#DescribeRepositoryCreationTemplatesResponse": { + "type": "structure", + "members": { + "registryId": { + "target": "com.amazonaws.ecr#RegistryId", + "traits": { + "smithy.api#documentation": "

    The registry ID associated with the request.

    " + } + }, + "repositoryCreationTemplates": { + "target": "com.amazonaws.ecr#RepositoryCreationTemplateList", + "traits": { + "smithy.api#documentation": "

    The details of the repository creation templates.

    " + } + }, + "nextToken": { + "target": "com.amazonaws.ecr#NextToken", + "traits": { + "smithy.api#documentation": "

    The nextToken value to include in a future\n DescribeRepositoryCreationTemplates request. When the results of a\n DescribeRepositoryCreationTemplates request exceed\n maxResults, this value can be used to retrieve the next page of\n results. This value is null when there are no more results to\n return.

    " + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.ecr#EmptyUploadException": { "type": "structure", "members": { @@ -3192,7 +3468,7 @@ "encryptionType": { "target": "com.amazonaws.ecr#EncryptionType", "traits": { - "smithy.api#documentation": "

    The encryption type to use.

    \n

    If you use the KMS encryption type, the contents of the repository will\n be encrypted using server-side encryption with Key Management Service key stored in KMS. When you\n use KMS to encrypt your data, you can either use the default Amazon Web Services managed KMS key\n for Amazon ECR, or specify your own KMS key, which you already created. For more\n information, see Protecting data using server-side\n encryption with an KMS key stored in Key Management Service (SSE-KMS) in the\n Amazon Simple Storage Service Console Developer Guide.

    \n

    If you use the AES256 encryption type, Amazon ECR uses server-side encryption\n with Amazon S3-managed encryption keys which encrypts the images in the repository using an\n AES-256 encryption algorithm. For more information, see Protecting data using\n server-side encryption with Amazon S3-managed encryption keys (SSE-S3) in the\n Amazon Simple Storage Service Console Developer Guide.

    ", + "smithy.api#documentation": "

    The encryption type to use.

    \n

    If you use the KMS encryption type, the contents of the repository will\n be encrypted using server-side encryption with Key Management Service key stored in KMS. When you\n use KMS to encrypt your data, you can either use the default Amazon Web Services managed KMS key\n for Amazon ECR, or specify your own KMS key, which you already created. For more\n information, see Protecting data using server-side\n encryption with an KMS key stored in Key Management Service (SSE-KMS) in the\n Amazon Simple Storage Service Console Developer Guide.

    \n

    If you use the AES256 encryption type, Amazon ECR uses server-side encryption\n with Amazon S3-managed encryption keys which encrypts the images in the repository using an\n AES256 encryption algorithm. For more information, see Protecting data using\n server-side encryption with Amazon S3-managed encryption keys (SSE-S3) in the\n Amazon Simple Storage Service Console Developer Guide.

    ", "smithy.api#required": {} } }, @@ -3204,7 +3480,28 @@ } }, "traits": { - "smithy.api#documentation": "

    The encryption configuration for the repository. This determines how the contents of\n your repository are encrypted at rest.

    \n

    By default, when no encryption configuration is set or the AES256\n encryption type is used, Amazon ECR uses server-side encryption with Amazon S3-managed encryption\n keys which encrypts your data at rest using an AES-256 encryption algorithm. This does\n not require any action on your part.

    \n

    For more control over the encryption of the contents of your repository, you can use\n server-side encryption with Key Management Service key stored in Key Management Service (KMS) to encrypt your\n images. For more information, see Amazon ECR encryption at\n rest in the Amazon Elastic Container Registry User Guide.

    " + "smithy.api#documentation": "

    The encryption configuration for the repository. This determines how the contents of\n your repository are encrypted at rest.

    \n

    By default, when no encryption configuration is set or the AES256\n encryption type is used, Amazon ECR uses server-side encryption with Amazon S3-managed encryption\n keys which encrypts your data at rest using an AES256 encryption algorithm. This does\n not require any action on your part.

    \n

    For more control over the encryption of the contents of your repository, you can use\n server-side encryption with Key Management Service key stored in Key Management Service (KMS) to encrypt your\n images. For more information, see Amazon ECR encryption at\n rest in the Amazon Elastic Container Registry User Guide.

    " + } + }, + "com.amazonaws.ecr#EncryptionConfigurationForRepositoryCreationTemplate": { + "type": "structure", + "members": { + "encryptionType": { + "target": "com.amazonaws.ecr#EncryptionType", + "traits": { + "smithy.api#documentation": "

    The encryption type to use.

    \n

    If you use the KMS encryption type, the contents of the repository will\n be encrypted using server-side encryption with Key Management Service key stored in KMS. When you\n use KMS to encrypt your data, you can either use the default Amazon Web Services managed KMS key\n for Amazon ECR, or specify your own KMS key, which you already created. For more\n information, see Protecting data using server-side\n encryption with an KMS key stored in Key Management Service (SSE-KMS) in the\n Amazon Simple Storage Service Console Developer Guide.

    \n

    If you use the AES256 encryption type, Amazon ECR uses server-side encryption\n with Amazon S3-managed encryption keys which encrypts the images in the repository using an\n AES256 encryption algorithm. For more information, see Protecting data using\n server-side encryption with Amazon S3-managed encryption keys (SSE-S3) in the\n Amazon Simple Storage Service Console Developer Guide.

    ", + "smithy.api#required": {} + } + }, + "kmsKey": { + "target": "com.amazonaws.ecr#KmsKeyForRepositoryCreationTemplate", + "traits": { + "smithy.api#documentation": "

    If you use the KMS encryption type, specify the KMS key to use for\n encryption. The full ARN of the KMS key must be specified. The key must exist in the\n same Region as the repository. If no key is specified, the default Amazon Web Services managed KMS\n key for Amazon ECR will be used.

    " + } + } + }, + "traits": { + "smithy.api#documentation": "

    The encryption configuration to associate with the repository creation\n template.

    " } }, "com.amazonaws.ecr#EncryptionType": { @@ -3831,7 +4128,7 @@ "registryId": { "target": "com.amazonaws.ecr#RegistryId", "traits": { - "smithy.api#documentation": "

    The ID of the registry.

    " + "smithy.api#documentation": "

    The registry ID associated with the request.

    " } }, "policyText": { @@ -3881,7 +4178,7 @@ "registryId": { "target": "com.amazonaws.ecr#RegistryId", "traits": { - "smithy.api#documentation": "

    The ID of the registry.

    " + "smithy.api#documentation": "

    The registry ID associated with the request.

    " } }, "scanningConfiguration": { @@ -4726,6 +5023,16 @@ } } }, + "com.amazonaws.ecr#KmsKeyForRepositoryCreationTemplate": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 2048 + }, + "smithy.api#pattern": "^$|arn:aws:kms:[a-z0-9-]+:[0-9]{12}:key\\/[a-z0-9-]+$" + } + }, "com.amazonaws.ecr#Layer": { "type": "structure", "members": { @@ -5091,6 +5398,15 @@ } } }, + "com.amazonaws.ecr#LifecyclePolicyTextForRepositoryCreationTemplate": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 30720 + } + } + }, "com.amazonaws.ecr#LifecyclePreviewMaxResults": { "type": "integer", "traits": { @@ -5401,6 +5717,22 @@ "com.amazonaws.ecr#Platform": { "type": "string" }, + "com.amazonaws.ecr#Prefix": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 256 + }, + "smithy.api#pattern": "^((?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*/?|ROOT)$" + } + }, + "com.amazonaws.ecr#PrefixList": { + "type": "list", + "member": { + "target": "com.amazonaws.ecr#Prefix" + } + }, "com.amazonaws.ecr#ProxyEndpoint": { "type": "string" }, @@ -5894,7 +6226,7 @@ "registryId": { "target": "com.amazonaws.ecr#RegistryId", "traits": { - "smithy.api#documentation": "

    The registry ID.

    " + "smithy.api#documentation": "

    The registry ID associated with the request.

    " } }, "policyText": { @@ -5985,7 +6317,7 @@ } ], "traits": { - "smithy.api#documentation": "

    Creates or updates the replication configuration for a registry. The existing\n replication configuration for a repository can be retrieved with the DescribeRegistry API action. The first time the\n PutReplicationConfiguration API is called, a service-linked IAM role is created in\n your account for the replication process. For more information, see Using\n service-linked roles for Amazon ECR in the\n Amazon Elastic Container Registry User Guide.

    \n \n

    When configuring cross-account replication, the destination account must grant the\n source account permission to replicate. This permission is controlled using a\n registry permissions policy. For more information, see PutRegistryPolicy.

    \n
    " + "smithy.api#documentation": "

    Creates or updates the replication configuration for a registry. The existing\n replication configuration for a repository can be retrieved with the DescribeRegistry API action. The first time the\n PutReplicationConfiguration API is called, a service-linked IAM role is created in\n your account for the replication process. For more information, see Using\n service-linked roles for Amazon ECR in the Amazon Elastic Container Registry User Guide.\n For more information on the custom role for replication, see Creating an IAM role for replication.

    \n \n

    When configuring cross-account replication, the destination account must grant the\n source account permission to replicate. This permission is controlled using a\n registry permissions policy. For more information, see PutRegistryPolicy.

    \n
    " } }, "com.amazonaws.ecr#PutReplicationConfigurationRequest": { @@ -6017,6 +6349,29 @@ "smithy.api#output": {} } }, + "com.amazonaws.ecr#RCTAppliedFor": { + "type": "enum", + "members": { + "REPLICATION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "REPLICATION" + } + }, + "PULL_THROUGH_CACHE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PULL_THROUGH_CACHE" + } + } + } + }, + "com.amazonaws.ecr#RCTAppliedForList": { + "type": "list", + "member": { + "target": "com.amazonaws.ecr#RCTAppliedFor" + } + }, "com.amazonaws.ecr#Reason": { "type": "string" }, @@ -6357,6 +6712,86 @@ "smithy.api#error": "client" } }, + "com.amazonaws.ecr#RepositoryCreationTemplate": { + "type": "structure", + "members": { + "prefix": { + "target": "com.amazonaws.ecr#Prefix", + "traits": { + "smithy.api#documentation": "

    The repository namespace prefix associated with the repository creation\n template.

    " + } + }, + "description": { + "target": "com.amazonaws.ecr#RepositoryTemplateDescription", + "traits": { + "smithy.api#documentation": "

    The description associated with the repository creation template.

    " + } + }, + "encryptionConfiguration": { + "target": "com.amazonaws.ecr#EncryptionConfigurationForRepositoryCreationTemplate", + "traits": { + "smithy.api#documentation": "

    The encryption configuration associated with the repository creation template.

    " + } + }, + "resourceTags": { + "target": "com.amazonaws.ecr#TagList", + "traits": { + "smithy.api#documentation": "

    The metadata to apply to the repository to help you categorize and organize. Each tag\n consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have\n a maximum length of 256 characters.

    " + } + }, + "imageTagMutability": { + "target": "com.amazonaws.ecr#ImageTagMutability", + "traits": { + "smithy.api#documentation": "

    The tag mutability setting for the repository. If this parameter is omitted, the\n default setting of MUTABLE will be used which will allow image tags to be overwritten.\n If IMMUTABLE is specified, all image tags within the repository will be immutable which\n will prevent them from being overwritten.

    " + } + }, + "repositoryPolicy": { + "target": "com.amazonaws.ecr#RepositoryPolicyText", + "traits": { + "smithy.api#documentation": "

    he repository policy to apply to repositories created using the template. A repository\n policy is a permissions policy associated with a repository to control access\n permissions.

    " + } + }, + "lifecyclePolicy": { + "target": "com.amazonaws.ecr#LifecyclePolicyTextForRepositoryCreationTemplate", + "traits": { + "smithy.api#documentation": "

    The lifecycle policy to use for repositories created using the template.

    " + } + }, + "appliedFor": { + "target": "com.amazonaws.ecr#RCTAppliedForList", + "traits": { + "smithy.api#documentation": "

    A list of enumerable Strings representing the repository creation scenarios that this\n template will apply towards. The two supported scenarios are PULL_THROUGH_CACHE and\n REPLICATION

    " + } + }, + "customRoleArn": { + "target": "com.amazonaws.ecr#CustomRoleArn", + "traits": { + "smithy.api#documentation": "

    The ARN of the role to be assumed by Amazon ECR.

    " + } + }, + "createdAt": { + "target": "com.amazonaws.ecr#Date", + "traits": { + "smithy.api#documentation": "

    The date and time, in JavaScript date format, when the repository creation template\n was created.

    " + } + }, + "updatedAt": { + "target": "com.amazonaws.ecr#Date", + "traits": { + "smithy.api#documentation": "

    The date and time, in JavaScript date format, when the repository creation template\n was last updated.

    " + } + } + }, + "traits": { + "smithy.api#documentation": "

    The details of the repository creation template associated with the request.

    " + } + }, + "com.amazonaws.ecr#RepositoryCreationTemplateList": { + "type": "list", + "member": { + "target": "com.amazonaws.ecr#RepositoryCreationTemplate" + } + }, "com.amazonaws.ecr#RepositoryFilter": { "type": "structure", "members": { @@ -6571,6 +7006,15 @@ "target": "com.amazonaws.ecr#RepositoryScanningConfiguration" } }, + "com.amazonaws.ecr#RepositoryTemplateDescription": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 256 + } + } + }, "com.amazonaws.ecr#Resource": { "type": "structure", "members": { @@ -7290,6 +7734,30 @@ "target": "com.amazonaws.ecr#TagValue" } }, + "com.amazonaws.ecr#TemplateAlreadyExistsException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.ecr#ExceptionMessage" + } + }, + "traits": { + "smithy.api#documentation": "

    The repository creation template already exists. Specify a unique prefix and try\n again.

    ", + "smithy.api#error": "client" + } + }, + "com.amazonaws.ecr#TemplateNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.ecr#ExceptionMessage" + } + }, + "traits": { + "smithy.api#documentation": "

    The specified repository creation template can't be found. Verify the registry ID and\n prefix and try again.

    ", + "smithy.api#error": "client" + } + }, "com.amazonaws.ecr#Title": { "type": "string" }, @@ -7533,6 +8001,112 @@ "smithy.api#output": {} } }, + "com.amazonaws.ecr#UpdateRepositoryCreationTemplate": { + "type": "operation", + "input": { + "target": "com.amazonaws.ecr#UpdateRepositoryCreationTemplateRequest" + }, + "output": { + "target": "com.amazonaws.ecr#UpdateRepositoryCreationTemplateResponse" + }, + "errors": [ + { + "target": "com.amazonaws.ecr#InvalidParameterException" + }, + { + "target": "com.amazonaws.ecr#ServerException" + }, + { + "target": "com.amazonaws.ecr#TemplateNotFoundException" + }, + { + "target": "com.amazonaws.ecr#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

    Updates an existing repository creation template.

    " + } + }, + "com.amazonaws.ecr#UpdateRepositoryCreationTemplateRequest": { + "type": "structure", + "members": { + "prefix": { + "target": "com.amazonaws.ecr#Prefix", + "traits": { + "smithy.api#documentation": "

    The repository namespace prefix that matches an existing repository creation template\n in the registry. All repositories created using this namespace prefix will have the\n settings defined in this template applied. For example, a prefix of prod\n would apply to all repositories beginning with prod/. This includes a\n repository named prod/team1 as well as a repository named\n prod/repository1.

    \n

    To apply a template to all repositories in your registry that don't have an associated\n creation template, you can use ROOT as the prefix.

    ", + "smithy.api#required": {} + } + }, + "description": { + "target": "com.amazonaws.ecr#RepositoryTemplateDescription", + "traits": { + "smithy.api#documentation": "

    A description for the repository creation template.

    " + } + }, + "encryptionConfiguration": { + "target": "com.amazonaws.ecr#EncryptionConfigurationForRepositoryCreationTemplate" + }, + "resourceTags": { + "target": "com.amazonaws.ecr#TagList", + "traits": { + "smithy.api#documentation": "

    The metadata to apply to the repository to help you categorize and organize. Each tag\n consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have\n a maximum length of 256 characters.

    " + } + }, + "imageTagMutability": { + "target": "com.amazonaws.ecr#ImageTagMutability", + "traits": { + "smithy.api#documentation": "

    Updates the tag mutability setting for the repository. If this parameter is omitted,\n the default setting of MUTABLE will be used which will allow image tags to\n be overwritten. If IMMUTABLE is specified, all image tags within the\n repository will be immutable which will prevent them from being overwritten.

    " + } + }, + "repositoryPolicy": { + "target": "com.amazonaws.ecr#RepositoryPolicyText", + "traits": { + "smithy.api#documentation": "

    Updates the repository policy created using the template. A repository policy is a\n permissions policy associated with a repository to control access permissions.

    " + } + }, + "lifecyclePolicy": { + "target": "com.amazonaws.ecr#LifecyclePolicyTextForRepositoryCreationTemplate", + "traits": { + "smithy.api#documentation": "

    Updates the lifecycle policy associated with the specified repository creation\n template.

    " + } + }, + "appliedFor": { + "target": "com.amazonaws.ecr#RCTAppliedForList", + "traits": { + "smithy.api#documentation": "

    Updates the list of enumerable strings representing the Amazon ECR repository creation\n scenarios that this template will apply towards. The two supported scenarios are\n PULL_THROUGH_CACHE and REPLICATION\n

    " + } + }, + "customRoleArn": { + "target": "com.amazonaws.ecr#CustomRoleArn", + "traits": { + "smithy.api#documentation": "

    The ARN of the role to be assumed by Amazon ECR. This role must be in the same account as\n the registry that you are configuring.

    " + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.ecr#UpdateRepositoryCreationTemplateResponse": { + "type": "structure", + "members": { + "registryId": { + "target": "com.amazonaws.ecr#RegistryId", + "traits": { + "smithy.api#documentation": "

    The registry ID associated with the request.

    " + } + }, + "repositoryCreationTemplate": { + "target": "com.amazonaws.ecr#RepositoryCreationTemplate", + "traits": { + "smithy.api#documentation": "

    The details of the repository creation template associated with the request.

    " + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, "com.amazonaws.ecr#UpdatedTimestamp": { "type": "timestamp" },