Enabling "Allow" in instance metadata

0

I have been trying to enable "Allow" option in Instance metadata tag using boto3 and referred to the below format from link shared below

response = client.modify_instance_metadata_options( InstanceId='string', HttpTokens='optional'|'required', HttpPutResponseHopLimit=123, HttpEndpoint='disabled'|'enabled', DryRun=True|False, HttpProtocolIpv6='disabled'|'enabled', InstanceMetadataTags='disabled'|'enabled' )

ref link : https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html?highlight=vpcendpoint#EC2.Client.modify_instance_metadata_options https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html

With the above reference , please find the usage in my case as below

****USAGE : ****

client = self.get_service(service_type, region) client.modify_instance_metadata_options(InstanceId=resource_id,InstanceMetadataTags="enabled")

While executing the above scenarios, am facing Unknown parameter in input

E botocore.exceptions.ParamValidationError: Parameter validation failed:

E Unknown parameter in input: "InstanceMetadataTags", must be one of: InstanceId, HttpTokens, HttpPutResponseHopLimit, HttpEndpoint, DryRun

It'll be really helpful if anyone could help me in correct usage or in resolving this TIA

1回答
0

Have you checked the version of boto3 and botocore that you're running to make sure that it is the latest? The error message indicates that it doesn't recognise InstanceMetadataTags so my guess here is that the version you're running is earlier than is required to support that parameter.

profile pictureAWS
エキスパート
回答済み 2年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ