{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-ec2/json-schema/amazon-ec2-modify-instance-attribute-request-schema.json",
  "title": "ModifyInstanceAttributeRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-ec2-instance-attribute-api-openapi.yml#/components/schemas/ModifyInstanceAttributeRequest",
  "type": "object",
  "properties": {
    "SourceDestCheck": {
      "$ref": "#/$defs/AttributeBooleanValue"
    },
    "EnclaveOptions": {
      "$ref": "#/$defs/EnclaveOptionsRequest"
    },
    "DisableApiStop": {
      "$ref": "#/$defs/AttributeBooleanValue"
    },
    "DryRun": {
      "type": "boolean",
      "description": "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 is UnauthorizedOperation."
    },
    "InstanceId": {
      "type": "string",
      "description": "The ID of the instance."
    },
    "Attribute": {
      "type": "string",
      "enum": [
        "instanceType",
        "kernel",
        "ramdisk",
        "userData",
        "disableApiTermination",
        "instanceInitiatedShutdownBehavior",
        "rootDeviceName",
        "blockDeviceMapping",
        "productCodes",
        "sourceDestCheck",
        "groupSet",
        "ebsOptimized",
        "sriovNetSupport",
        "enaSupport",
        "enclaveOptions",
        "disableApiStop"
      ],
      "description": "The name of the attribute to modify. When changing the instance type: If the original instance type is configured for configurable bandwidth, and the desired instance type doesn't support configurable bandwidth, first set the existing bandwidth configuration to default using the ModifyInstanceNetworkPerformanceOptions operation. You can modify the following attributes only: disableApiTermination | instanceType | kernel | ramdisk | instanceInitiatedShutdownBehavior | blockDeviceMapping | userData | sourceDestCheck | groupSet | ebsOptimized | sriovNetSupport | enaSupport | nvmeSupport | disableA"
    },
    "Value": {
      "type": "string",
      "description": "A new value for the attribute. Use only with the kernel, ramdisk, userData, disableApiTermination, or instanceInitiatedShutdownBehavior attribute."
    },
    "BlockDeviceMappings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/InstanceBlockDeviceMappingSpecification"
      },
      "description": "Modifies the DeleteOnTermination attribute for volumes that are currently attached. The volume must be owned by the caller. If no value is specified for DeleteOnTermination, the default is true and the volume is deleted when the instance is terminated. You can't modify the DeleteOnTermination attribute for volumes that are attached to Amazon Web Services-managed resources. To add instance store volumes to an Amazon EBS-backed instance, you must add them when you launch the instance. For more information, see Update the block device mapping when launching an instance in the Amazon EC2 User Guid"
    },
    "DisableApiTermination": {
      "$ref": "#/$defs/AttributeBooleanValue"
    },
    "InstanceType": {
      "$ref": "#/$defs/AttributeValue"
    },
    "Kernel": {
      "$ref": "#/$defs/AttributeValue"
    },
    "Ramdisk": {
      "$ref": "#/$defs/AttributeValue"
    },
    "UserData": {
      "$ref": "#/$defs/SecureBlobAttributeValue"
    },
    "InstanceInitiatedShutdownBehavior": {
      "$ref": "#/$defs/AttributeValue"
    },
    "Groups": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Replaces the security groups of the instance with the specified security groups. You must specify the ID of at least one security group, even if it's just the default security group for the VPC."
    },
    "EbsOptimized": {
      "$ref": "#/$defs/AttributeBooleanValue"
    },
    "SriovNetSupport": {
      "$ref": "#/$defs/AttributeValue"
    },
    "EnaSupport": {
      "$ref": "#/$defs/AttributeBooleanValue"
    }
  },
  "required": [
    "InstanceId"
  ],
  "$defs": {
    "AttributeBooleanValue": {
      "type": "object",
      "properties": {
        "Value": {
          "type": "boolean",
          "description": "The attribute value. The valid values are true or false."
        }
      }
    },
    "AttributeValue": {
      "type": "object",
      "properties": {
        "Value": {
          "type": "string",
          "description": "The attribute value. The value is case-sensitive."
        }
      }
    },
    "EbsInstanceBlockDeviceSpecification": {
      "type": "object",
      "properties": {
        "VolumeId": {
          "type": "string",
          "description": "The ID of the EBS volume."
        },
        "DeleteOnTermination": {
          "type": "boolean",
          "description": "Indicates whether the volume is deleted on instance termination."
        }
      }
    },
    "EnclaveOptionsRequest": {
      "type": "object",
      "properties": {
        "Enabled": {
          "type": "boolean",
          "description": "To enable the instance for Amazon Web Services Nitro Enclaves, set this parameter to true."
        }
      }
    },
    "InstanceBlockDeviceMappingSpecification": {
      "type": "object",
      "properties": {
        "DeviceName": {
          "type": "string",
          "description": "The device name. For available device names, see Device names for volumes."
        },
        "Ebs": {
          "$ref": "#/$defs/EbsInstanceBlockDeviceSpecification"
        },
        "VirtualName": {
          "type": "string",
          "description": "The virtual device name."
        },
        "NoDevice": {
          "type": "string",
          "description": "Suppresses the specified device included in the block device mapping."
        }
      }
    },
    "SecureBlobAttributeValue": {
      "type": "object",
      "properties": {
        "Value": {
          "type": "string",
          "format": "byte",
          "description": "The attribute value."
        }
      }
    }
  }
}