ec2:ModifyInstanceMetadataDefaults

Write

ec2:ModifyInstanceMetadataDefaults is a Write access-level action in the ec2 service. Grants permission to modify the default instance metadata service (IMDS) settings for your account in the specified Region

Resource types

This action does not support resource-level permissions; use "Resource": "*" in your policy.

Condition keys

Keys you can use in the Condition block of a policy that grants ec2:ModifyInstanceMetadataDefaults.

ec2:Attribute/${AttributeName} String

Filters access by an attribute being set on a resource

ec2:Region String

Filters access by the name of the AWS Region

Example IAM policy

A minimal policy that allows ec2:ModifyInstanceMetadataDefaults. Replace "Resource": "*" with a specific ARN to follow least privilege.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AllowEc2ModifyInstanceMetadataDefaults",
      "Effect": "Allow",
      "Action": "ec2:ModifyInstanceMetadataDefaults",
      "Resource": "*"
    }
  ]
}

Related actions in ec2

View all ec2 actions →