update_compute_environment
async
¶
update_compute_environment(
*,
config_overrides: Optional[AsyncBatchClientConfig] = None,
compute_environment: Optional[String] = None,
state: Optional[CEState] = None,
unmanagedv_cpus: Optional[Integer] = None,
compute_resources: Optional[ComputeResourceUpdate] = None,
service_role: Optional[String] = None,
update_policy: Optional[UpdatePolicy] = None,
context: Optional[String] = None,
ecs_settings: Optional[EcsSettings] = None,
eks_configuration: Optional[EksConfigurationUpdate] = None,
) -> UpdateComputeEnvironmentResponse
Updates an Batch compute environment.
Parameters:
-
compute_environment(Optional[String], default:None) –The name or full Amazon Resource Name (ARN) of the compute environment to update.
-
state(Optional[CEState], default:None) –The state of the compute environment. Compute environments in the
ENABLEDstate can accept jobs from a queue and scale in or out automatically based on the workload demand of its associated queues.If the state is
ENABLED, then the Batch scheduler can attempt to place jobs from an associated job queue on the compute resources within the environment. If the compute environment is managed, then it can scale its instances out or in automatically, based on the job queue demand.If the state is
DISABLED, then the Batch scheduler doesn't attempt to place jobs within the environment. Jobs in aSTARTINGorRUNNINGstate continue to progress normally. Managed compute environments in theDISABLEDstate don't scale out.Compute environments in a
DISABLEDstate may continue to incur billing charges, for example, if they have running instances due to jobs that are still executing or a non-zerominvCpussetting. To prevent additional charges, disable and delete the compute environment.When an instance is idle, the instance scales down to the
minvCpusvalue. However, the instance size doesn't change. For example, consider ac5.8xlargeinstance with aminvCpusvalue of4and adesiredvCpusvalue of36. This instance doesn't scale down to ac5.largeinstance. -
unmanagedv_cpus(Optional[Integer], default:None) –The maximum number of vCPUs expected to be used for an unmanaged compute environment. Don't specify this parameter for a managed compute environment. This parameter is only used for fair-share scheduling to reserve vCPU capacity for new share identifiers. If this parameter isn't provided for a fair-share job queue, no vCPU capacity is reserved.
-
compute_resources(Optional[ComputeResourceUpdate], default:None) –Details of the compute resources managed by the compute environment. Required for a managed compute environment. For more information, see Compute Environments in the Batch User Guide.
-
service_role(Optional[String], default:None) –The full Amazon Resource Name (ARN) of the IAM role that allows Batch to make calls to other Amazon Web Services services on your behalf. For more information, see Batch service IAM role in the Batch User Guide.
If the compute environment has a service-linked role, it can't be changed to use a regular IAM role. Likewise, if the compute environment has a regular IAM role, it can't be changed to use a service-linked role. To update the parameters for the compute environment that require an infrastructure update to change, the AWSServiceRoleForBatch service-linked role must be used. For more information, see Updating compute environments in the Batch User Guide.
If your specified role has a path other than
/, then you must either specify the full role ARN (recommended) or prefix the role name with the path.Depending on how you created your Batch service role, its ARN might contain the
service-rolepath prefix. When you only specify the name of the service role, Batch assumes that your ARN doesn't use theservice-rolepath prefix. Because of this, we recommend that you specify the full ARN of your service role when you create compute environments. -
update_policy(Optional[UpdatePolicy], default:None) –Specifies the updated infrastructure update policy for the compute environment. For more information about infrastructure updates, see Updating compute environments in the Batch User Guide.
-
context(Optional[String], default:None) –Reserved.
-
ecs_settings(Optional[EcsSettings], default:None) –The Amazon ECS settings for the compute environment. These settings control CloudWatch Container Insights collection for the compute environment.
-
eks_configuration(Optional[EksConfigurationUpdate], default:None) –Updates the Amazon EKS configuration for the compute environment. Only specify this parameter if the compute environment's
containerOrchestrationTypeisEKS. Currently, theaccessEntrysetting is the only Amazon EKS configuration that you can change after the compute environment is created. For more information, see Amazon EKS access entry authentication in the Batch User Guide.
Raises:
-
ClientException–These errors are usually caused by a client action. One example cause is using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Another cause is specifying an identifier that's not valid.
-
ServerException–These errors are usually caused by a server issue.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To update a compute environment This example disables the P2OnDemand compute environment so it can be deleted.
Source code in docs_src/capo_batch/_services/async_batch.py
3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 | |