modify_instance_metadata_defaults
¶
modify_instance_metadata_defaults(
*,
config_overrides: Optional[EC2ClientConfig] = 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/ec2.py
50656 50657 50658 50659 50660 50661 50662 50663 50664 50665 50666 50667 50668 50669 50670 50671 50672 50673 50674 50675 50676 50677 50678 50679 50680 50681 50682 50683 50684 50685 50686 50687 50688 50689 50690 50691 50692 50693 50694 50695 50696 50697 50698 50699 50700 50701 50702 50703 50704 50705 50706 50707 50708 50709 50710 50711 50712 50713 50714 50715 50716 50717 50718 50719 50720 50721 50722 50723 50724 50725 50726 50727 50728 | |