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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠