modify_instance_metadata_defaults
async
¶
modify_instance_metadata_defaults(
*,
config_overrides: Optional[AsyncEC2ClientConfig] = None,
http_tokens: Optional[MetadataDefaultHttpTokensState] = None,
http_put_response_hop_limit: Optional[BoxedInteger] = None,
http_endpoint: Optional[DefaultInstanceMetadataEndpointState] = None,
instance_metadata_tags: Optional[DefaultInstanceMetadataTagsState] = None,
dry_run: Optional[Boolean] = None,
http_tokens_enforced: Optional[DefaultHttpTokensEnforcedState] = None,
) -> ModifyInstanceMetadataDefaultsResult
Modifies the default instance metadata service (IMDS) settings at the account level in the specified Amazon Web Services Region.
To remove a parameter's account-level default setting, specify no-preference. If an account-level setting is cleared with no-preference, then the instance launch considers the other instance metadata settings. For more information, see Order of precedence for instance metadata options in the Amazon EC2 User Guide.
Parameters:
-
http_tokens(Optional[MetadataDefaultHttpTokensState], default:None) –Indicates whether IMDSv2 is required.
-
optional– IMDSv2 is optional, which means that you can use either IMDSv2 or IMDSv1. -
required– IMDSv2 is required, which means that IMDSv1 is disabled, and you must use IMDSv2.
-
-
http_put_response_hop_limit(Optional[BoxedInteger], default:None) –The maximum number of hops that the metadata token can travel. To indicate no preference, specify
-1.Possible values: Integers from
1to64, and-1to indicate no preference -
http_endpoint(Optional[DefaultInstanceMetadataEndpointState], default:None) –Enables or disables the IMDS endpoint on an instance. When disabled, the instance metadata can't be accessed.
-
instance_metadata_tags(Optional[DefaultInstanceMetadataTagsState], default:None) –Enables or disables access to an instance's tags from the instance metadata. For more information, see View tags for your EC2 instances using instance metadata in the Amazon EC2 User Guide.
-
dry_run(Optional[Boolean], default:None) –Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is
DryRunOperation. Otherwise, it isUnauthorizedOperation. -
http_tokens_enforced(Optional[DefaultHttpTokensEnforcedState], default:None) –Specifies whether to enforce the requirement of IMDSv2 on an instance at the time of launch. When enforcement is enabled, the instance can't launch unless IMDSv2 (
HttpTokens) is set torequired. For more information, see Enforce IMDSv2 at the account level in the Amazon EC2 User Guide.
Raises:
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_ec2/_services/async_ec2.py
51359 51360 51361 51362 51363 51364 51365 51366 51367 51368 51369 51370 51371 51372 51373 51374 51375 51376 51377 51378 51379 51380 51381 51382 51383 51384 51385 51386 51387 51388 51389 51390 51391 51392 51393 51394 51395 51396 51397 51398 51399 51400 51401 51402 51403 51404 51405 51406 51407 51408 51409 51410 51411 51412 51413 51414 51415 51416 51417 51418 51419 51420 51421 51422 51423 51424 51425 51426 51427 51428 51429 51430 51431 51432 | |