Class: Aws::EC2::Types::CreateImageRequest

Inherits:
Struct
  • Object
show all
Defined in:
gems/aws-sdk-ec2/lib/aws-sdk-ec2/types.rb

Overview

Note:

When making an API call, you may pass CreateImageRequest data as a hash:

{
  block_device_mappings: [
    {
      device_name: "String",
      virtual_name: "String",
      ebs: {
        delete_on_termination: false,
        iops: 1,
        snapshot_id: "SnapshotId",
        volume_size: 1,
        volume_type: "standard", # accepts standard, io1, io2, gp2, sc1, st1, gp3
        kms_key_id: "String",
        throughput: 1,
        outpost_arn: "String",
        encrypted: false,
      },
      no_device: "String",
    },
  ],
  description: "String",
  dry_run: false,
  instance_id: "InstanceId", # required
  name: "String", # required
  no_reboot: false,
  tag_specifications: [
    {
      resource_type: "capacity-reservation", # accepts capacity-reservation, client-vpn-endpoint, customer-gateway, carrier-gateway, dedicated-host, dhcp-options, egress-only-internet-gateway, elastic-ip, elastic-gpu, export-image-task, export-instance-task, fleet, fpga-image, host-reservation, image, import-image-task, import-snapshot-task, instance, instance-event-window, internet-gateway, ipv4pool-ec2, ipv6pool-ec2, key-pair, launch-template, local-gateway, local-gateway-route-table, local-gateway-virtual-interface, local-gateway-virtual-interface-group, local-gateway-route-table-vpc-association, local-gateway-route-table-virtual-interface-group-association, natgateway, network-acl, network-interface, network-insights-analysis, network-insights-path, placement-group, prefix-list, replace-root-volume-task, reserved-instances, route-table, security-group, security-group-rule, snapshot, spot-fleet-request, spot-instances-request, subnet, traffic-mirror-filter, traffic-mirror-session, traffic-mirror-target, transit-gateway, transit-gateway-attachment, transit-gateway-connect-peer, transit-gateway-multicast-domain, transit-gateway-route-table, volume, vpc, vpc-endpoint, vpc-endpoint-service, vpc-peering-connection, vpn-connection, vpn-gateway, vpc-flow-log
      tags: [
        {
          key: "String",
          value: "String",
        },
      ],
    },
  ],
}

Constant Summary collapse

SENSITIVE =
[]

Instance Attribute Summary collapse

Instance Attribute Details

#block_device_mappingsArray<Types::BlockDeviceMapping>

The block device mappings. This parameter cannot be used to modify the encryption status of existing volumes or snapshots. To create an AMI with encrypted snapshots, use the CopyImage action.

Returns:



7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/types.rb', line 7221

class CreateImageRequest < Struct.new(
  :block_device_mappings,
  :description,
  :dry_run,
  :instance_id,
  :name,
  :no_reboot,
  :tag_specifications)
  SENSITIVE = []
  include Aws::Structure
end

#descriptionString

A description for the new image.

Returns:

  • (String)


7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/types.rb', line 7221

class CreateImageRequest < Struct.new(
  :block_device_mappings,
  :description,
  :dry_run,
  :instance_id,
  :name,
  :no_reboot,
  :tag_specifications)
  SENSITIVE = []
  include Aws::Structure
end

#dry_runBoolean

Checks whether you have the required permissions for the action, 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.

Returns:

  • (Boolean)


7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/types.rb', line 7221

class CreateImageRequest < Struct.new(
  :block_device_mappings,
  :description,
  :dry_run,
  :instance_id,
  :name,
  :no_reboot,
  :tag_specifications)
  SENSITIVE = []
  include Aws::Structure
end

#instance_idString

The ID of the instance.

Returns:

  • (String)


7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/types.rb', line 7221

class CreateImageRequest < Struct.new(
  :block_device_mappings,
  :description,
  :dry_run,
  :instance_id,
  :name,
  :no_reboot,
  :tag_specifications)
  SENSITIVE = []
  include Aws::Structure
end

#nameString

A name for the new image.

Constraints: 3-128 alphanumeric characters, parentheses (()), square brackets ([]), spaces ( ), periods (.), slashes (/), dashes (-), single quotes ('), at-signs (@), or underscores(_)

Returns:

  • (String)


7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/types.rb', line 7221

class CreateImageRequest < Struct.new(
  :block_device_mappings,
  :description,
  :dry_run,
  :instance_id,
  :name,
  :no_reboot,
  :tag_specifications)
  SENSITIVE = []
  include Aws::Structure
end

#no_rebootBoolean

By default, Amazon EC2 attempts to shut down and reboot the instance before creating the image. If the No Reboot option is set, Amazon EC2 doesn't shut down the instance before creating the image. Without a reboot, the AMI will be crash consistent (all the volumes are snapshotted at the same time), but not application consistent (all the operating system buffers are not flushed to disk before the snapshots are created).

Returns:

  • (Boolean)


7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/types.rb', line 7221

class CreateImageRequest < Struct.new(
  :block_device_mappings,
  :description,
  :dry_run,
  :instance_id,
  :name,
  :no_reboot,
  :tag_specifications)
  SENSITIVE = []
  include Aws::Structure
end

#tag_specificationsArray<Types::TagSpecification>

The tags to apply to the AMI and snapshots on creation. You can tag the AMI, the snapshots, or both.

  • To tag the AMI, the value for ResourceType must be image.

  • To tag the snapshots that are created of the root volume and of other Amazon EBS volumes that are attached to the instance, the value for ResourceType must be snapshot. The same tag is applied to all of the snapshots that are created.

If you specify other values for ResourceType, the request fails.

To tag an AMI or snapshot after it has been created, see CreateTags.

Returns:



7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
# File 'gems/aws-sdk-ec2/lib/aws-sdk-ec2/types.rb', line 7221

class CreateImageRequest < Struct.new(
  :block_device_mappings,
  :description,
  :dry_run,
  :instance_id,
  :name,
  :no_reboot,
  :tag_specifications)
  SENSITIVE = []
  include Aws::Structure
end