From bf10da9ab7e12423e05450c3b938e5102fbbe88c Mon Sep 17 00:00:00 2001 From: awstools Date: Fri, 8 Nov 2024 19:22:22 +0000 Subject: [PATCH] feat(client-batch): This feature allows override LaunchTemplates to be specified in an AWS Batch Compute Environment. --- .../CreateComputeEnvironmentCommand.ts | 10 ++ .../DescribeComputeEnvironmentsCommand.ts | 10 ++ .../UpdateComputeEnvironmentCommand.ts | 10 ++ clients/client-batch/src/models/models_0.ts | 110 ++++++++++++++++-- .../src/protocols/Aws_restJson1.ts | 9 ++ codegen/sdk-codegen/aws-models/batch.json | 46 +++++++- 6 files changed, 187 insertions(+), 8 deletions(-) diff --git a/clients/client-batch/src/commands/CreateComputeEnvironmentCommand.ts b/clients/client-batch/src/commands/CreateComputeEnvironmentCommand.ts index 3237985ee8e2..a353a128a046 100644 --- a/clients/client-batch/src/commands/CreateComputeEnvironmentCommand.ts +++ b/clients/client-batch/src/commands/CreateComputeEnvironmentCommand.ts @@ -164,6 +164,16 @@ export interface CreateComputeEnvironmentCommandOutput extends CreateComputeEnvi * launchTemplateId: "STRING_VALUE", * launchTemplateName: "STRING_VALUE", * version: "STRING_VALUE", + * overrides: [ // LaunchTemplateSpecificationOverrideList + * { // LaunchTemplateSpecificationOverride + * launchTemplateId: "STRING_VALUE", + * launchTemplateName: "STRING_VALUE", + * version: "STRING_VALUE", + * targetInstanceTypes: [ + * "STRING_VALUE", + * ], + * }, + * ], * }, * ec2Configuration: [ // Ec2ConfigurationList * { // Ec2Configuration diff --git a/clients/client-batch/src/commands/DescribeComputeEnvironmentsCommand.ts b/clients/client-batch/src/commands/DescribeComputeEnvironmentsCommand.ts index ad6272a84b81..1ab85702781d 100644 --- a/clients/client-batch/src/commands/DescribeComputeEnvironmentsCommand.ts +++ b/clients/client-batch/src/commands/DescribeComputeEnvironmentsCommand.ts @@ -94,6 +94,16 @@ export interface DescribeComputeEnvironmentsCommandOutput * // launchTemplateId: "STRING_VALUE", * // launchTemplateName: "STRING_VALUE", * // version: "STRING_VALUE", + * // overrides: [ // LaunchTemplateSpecificationOverrideList + * // { // LaunchTemplateSpecificationOverride + * // launchTemplateId: "STRING_VALUE", + * // launchTemplateName: "STRING_VALUE", + * // version: "STRING_VALUE", + * // targetInstanceTypes: [ + * // "STRING_VALUE", + * // ], + * // }, + * // ], * // }, * // ec2Configuration: [ // Ec2ConfigurationList * // { // Ec2Configuration diff --git a/clients/client-batch/src/commands/UpdateComputeEnvironmentCommand.ts b/clients/client-batch/src/commands/UpdateComputeEnvironmentCommand.ts index 1c79fd083bb3..6bb44423593f 100644 --- a/clients/client-batch/src/commands/UpdateComputeEnvironmentCommand.ts +++ b/clients/client-batch/src/commands/UpdateComputeEnvironmentCommand.ts @@ -64,6 +64,16 @@ export interface UpdateComputeEnvironmentCommandOutput extends UpdateComputeEnvi * launchTemplateId: "STRING_VALUE", * launchTemplateName: "STRING_VALUE", * version: "STRING_VALUE", + * overrides: [ // LaunchTemplateSpecificationOverrideList + * { // LaunchTemplateSpecificationOverride + * launchTemplateId: "STRING_VALUE", + * launchTemplateName: "STRING_VALUE", + * version: "STRING_VALUE", + * targetInstanceTypes: [ + * "STRING_VALUE", + * ], + * }, + * ], * }, * ec2Configuration: [ // Ec2ConfigurationList * { // Ec2Configuration diff --git a/clients/client-batch/src/models/models_0.ts b/clients/client-batch/src/models/models_0.ts index e316decc011b..9a3fb9d9ae3e 100644 --- a/clients/client-batch/src/models/models_0.ts +++ b/clients/client-batch/src/models/models_0.ts @@ -450,6 +450,90 @@ export interface Ec2Configuration { imageKubernetesVersion?: string; } +/** + *

An object that represents a launch template to use in place of the default launch template. You must specify either the launch template ID or launch template name in the request, but not + * both.

+ *

If security groups are specified using both the securityGroupIds parameter of + * CreateComputeEnvironment and the launch template, the values in the + * securityGroupIds parameter of CreateComputeEnvironment will be + * used.

+ *

You can define up to ten (10) overrides for each compute environment.

+ * + *

This object isn't applicable to jobs that are running on Fargate resources.

+ *
+ * + *

To unset all override templates for a compute environment, you can pass an empty array to the UpdateComputeEnvironment.overrides parameter, or not include the overrides parameter when submitting the UpdateComputeEnvironment API operation.

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

The ID of the launch template.

+ *

+ * Note: If you specify the launchTemplateId you can't specify the launchTemplateName as well.

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

The name of the launch template.

+ *

+ * Note: If you specify the launchTemplateName you can't specify the launchTemplateId as well.

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

The version number of the launch template, + * $Default, or $Latest.

+ *

If the value is $Default, the default version of the launch template is used. If the value is $Latest, the latest version of the launch template is used.

+ * + *

If the AMI ID that's used in a compute environment is from the launch template, the AMI + * isn't changed when the compute environment is updated. It's only changed if the + * updateToLatestImageVersion parameter for the compute environment is set to + * true. During an infrastructure update, if either $Default or $Latest is specified, Batch re-evaluates the launch template version, and it + * might use a different version of the launch template. This is the case even if the launch + * template isn't specified in the update. When updating a compute environment, changing the launch + * template requires an infrastructure update of the compute environment. For more information, see + * Updating compute + * environments in the Batch User Guide.

+ *
+ *

Default: $Default + *

+ *

Latest: $Latest + *

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

The instance type or family that this this override launch template should be applied to.

+ *

This parameter is required when defining a launch template override.

+ *

Information included in this parameter must meet the following requirements:

+ * + * @public + */ + targetInstanceTypes?: string[]; +} + /** *

An object that represents a launch template that's associated with a compute resource. You * must specify either the launch template ID or launch template name in the request, but not @@ -477,26 +561,38 @@ export interface LaunchTemplateSpecification { launchTemplateName?: string; /** - *

The version number of the launch template, $Latest, or - * $Default.

- *

If the value is $Latest, the latest version of the launch template is used. If - * the value is $Default, the default version of the launch template is used.

+ *

The version number of the launch template, + * $Default, or $Latest.

+ *

If the value is $Default, the default version of the launch template is used. If the value is $Latest, the latest version of the launch template is used.

* *

If the AMI ID that's used in a compute environment is from the launch template, the AMI * isn't changed when the compute environment is updated. It's only changed if the * updateToLatestImageVersion parameter for the compute environment is set to - * true. During an infrastructure update, if either $Latest or - * $Default is specified, Batch re-evaluates the launch template version, and it + * true. During an infrastructure update, if either $Default or + * $Latest is specified, Batch re-evaluates the launch template version, and it * might use a different version of the launch template. This is the case even if the launch * template isn't specified in the update. When updating a compute environment, changing the launch * template requires an infrastructure update of the compute environment. For more information, see * Updating compute * environments in the Batch User Guide.

*
- *

Default: $Default.

+ *

Default: $Default + *

+ *

Latest: $Latest + *

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

A launch template to use in place of the default launch template. You must specify either the launch template ID or launch template name in the request, but not both.

+ *

You can specify up to ten (10) launch template overrides that are associated to unique instance types or families for each compute environment.

+ * + *

To unset all override templates for a compute environment, you can pass an empty array to the UpdateComputeEnvironment.overrides parameter, or not include the overrides parameter when submitting the UpdateComputeEnvironment API operation.

+ *
+ * @public + */ + overrides?: LaunchTemplateSpecificationOverride[]; } /** diff --git a/clients/client-batch/src/protocols/Aws_restJson1.ts b/clients/client-batch/src/protocols/Aws_restJson1.ts index 7e825586f1a3..3e38b742af74 100644 --- a/clients/client-batch/src/protocols/Aws_restJson1.ts +++ b/clients/client-batch/src/protocols/Aws_restJson1.ts @@ -140,6 +140,7 @@ import { KeyValuePair, KeyValuesPair, LaunchTemplateSpecification, + LaunchTemplateSpecificationOverride, LinuxParameters, LogConfiguration, MountPoint, @@ -1470,6 +1471,10 @@ const se_FairsharePolicy = (input: FairsharePolicy, context: __SerdeContext): an // se_LaunchTemplateSpecification omitted. +// se_LaunchTemplateSpecificationOverride omitted. + +// se_LaunchTemplateSpecificationOverrideList omitted. + // se_LinuxParameters omitted. // se_ListEcsTaskProperties omitted. @@ -1842,6 +1847,10 @@ const de_JobDetailList = (output: any, context: __SerdeContext): JobDetail[] => // de_LaunchTemplateSpecification omitted. +// de_LaunchTemplateSpecificationOverride omitted. + +// de_LaunchTemplateSpecificationOverrideList omitted. + // de_LinuxParameters omitted. // de_ListAttemptEcsTaskDetails omitted. diff --git a/codegen/sdk-codegen/aws-models/batch.json b/codegen/sdk-codegen/aws-models/batch.json index 92505eed11c7..48d478ba4e8d 100644 --- a/codegen/sdk-codegen/aws-models/batch.json +++ b/codegen/sdk-codegen/aws-models/batch.json @@ -5811,7 +5811,13 @@ "version": { "target": "com.amazonaws.batch#String", "traits": { - "smithy.api#documentation": "

The version number of the launch template, $Latest, or\n $Default.

\n

If the value is $Latest, the latest version of the launch template is used. If\n the value is $Default, the default version of the launch template is used.

\n \n

If the AMI ID that's used in a compute environment is from the launch template, the AMI\n isn't changed when the compute environment is updated. It's only changed if the\n updateToLatestImageVersion parameter for the compute environment is set to\n true. During an infrastructure update, if either $Latest or\n $Default is specified, Batch re-evaluates the launch template version, and it\n might use a different version of the launch template. This is the case even if the launch\n template isn't specified in the update. When updating a compute environment, changing the launch\n template requires an infrastructure update of the compute environment. For more information, see\n Updating compute\n environments in the Batch User Guide.

\n
\n

Default: $Default.

" + "smithy.api#documentation": "

The version number of the launch template, \n $Default, or $Latest.

\n

If the value is $Default, the default version of the launch template is used. If the value is $Latest, the latest version of the launch template is used.

\n \n

If the AMI ID that's used in a compute environment is from the launch template, the AMI\n isn't changed when the compute environment is updated. It's only changed if the\n updateToLatestImageVersion parameter for the compute environment is set to\n true. During an infrastructure update, if either $Default or\n $Latest is specified, Batch re-evaluates the launch template version, and it\n might use a different version of the launch template. This is the case even if the launch\n template isn't specified in the update. When updating a compute environment, changing the launch\n template requires an infrastructure update of the compute environment. For more information, see\n Updating compute\n environments in the Batch User Guide.

\n
\n

Default: $Default\n

\n

Latest: $Latest\n

" + } + }, + "overrides": { + "target": "com.amazonaws.batch#LaunchTemplateSpecificationOverrideList", + "traits": { + "smithy.api#documentation": "

A launch template to use in place of the default launch template. You must specify either the launch template ID or launch template name in the request, but not both.

\n

You can specify up to ten (10) launch template overrides that are associated to unique instance types or families for each compute environment.

\n \n

To unset all override templates for a compute environment, you can pass an empty array to the UpdateComputeEnvironment.overrides parameter, or not include the overrides parameter when submitting the UpdateComputeEnvironment API operation.

\n
" } } }, @@ -5819,6 +5825,44 @@ "smithy.api#documentation": "

An object that represents a launch template that's associated with a compute resource. You\n must specify either the launch template ID or launch template name in the request, but not\n both.

\n

If security groups are specified using both the securityGroupIds parameter of\n CreateComputeEnvironment and the launch template, the values in the\n securityGroupIds parameter of CreateComputeEnvironment will be\n used.

\n \n

This object isn't applicable to jobs that are running on Fargate resources.

\n
" } }, + "com.amazonaws.batch#LaunchTemplateSpecificationOverride": { + "type": "structure", + "members": { + "launchTemplateId": { + "target": "com.amazonaws.batch#String", + "traits": { + "smithy.api#documentation": "

The ID of the launch template.

\n

\n Note: If you specify the launchTemplateId you can't specify the launchTemplateName as well.

" + } + }, + "launchTemplateName": { + "target": "com.amazonaws.batch#String", + "traits": { + "smithy.api#documentation": "

The name of the launch template.

\n

\n Note: If you specify the launchTemplateName you can't specify the launchTemplateId as well.

" + } + }, + "version": { + "target": "com.amazonaws.batch#String", + "traits": { + "smithy.api#documentation": "

The version number of the launch template, \n $Default, or $Latest.

\n

If the value is $Default, the default version of the launch template is used. If the value is $Latest, the latest version of the launch template is used.

\n \n

If the AMI ID that's used in a compute environment is from the launch template, the AMI\n isn't changed when the compute environment is updated. It's only changed if the\n updateToLatestImageVersion parameter for the compute environment is set to\n true. During an infrastructure update, if either $Default or $Latest is specified, Batch re-evaluates the launch template version, and it\n might use a different version of the launch template. This is the case even if the launch\n template isn't specified in the update. When updating a compute environment, changing the launch\n template requires an infrastructure update of the compute environment. For more information, see\n Updating compute\n environments in the Batch User Guide.

\n
\n

Default: $Default\n

\n

Latest: $Latest\n

" + } + }, + "targetInstanceTypes": { + "target": "com.amazonaws.batch#StringList", + "traits": { + "smithy.api#documentation": "

The instance type or family that this this override launch template should be applied to.

\n

This parameter is required when defining a launch template override.

\n

Information included in this parameter must meet the following requirements:

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

An object that represents a launch template to use in place of the default launch template. You must specify either the launch template ID or launch template name in the request, but not\n both.

\n

If security groups are specified using both the securityGroupIds parameter of\n CreateComputeEnvironment and the launch template, the values in the\n securityGroupIds parameter of CreateComputeEnvironment will be\n used.

\n

You can define up to ten (10) overrides for each compute environment.

\n \n

This object isn't applicable to jobs that are running on Fargate resources.

\n
\n \n

To unset all override templates for a compute environment, you can pass an empty array to the UpdateComputeEnvironment.overrides parameter, or not include the overrides parameter when submitting the UpdateComputeEnvironment API operation.

\n
" + } + }, + "com.amazonaws.batch#LaunchTemplateSpecificationOverrideList": { + "type": "list", + "member": { + "target": "com.amazonaws.batch#LaunchTemplateSpecificationOverride" + } + }, "com.amazonaws.batch#LinuxParameters": { "type": "structure", "members": {