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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南