aws_instances.md

April 1, 2019 ยท View on GitHub

Document: "ec2"

Path: "https://github.com/aws/aws-sdk-go-v2/tree/master/models/apis/ec2/2016-11-15/api-2.json")

Instances

aws_instances {
  additional_info => "additional_info (optional)",
  block_device_mappings => "BlockDeviceMappings (optional)",
  capacity_reservation_specification => $aws_capacity_reservation_specification
  client_token => "client_token (optional)",
  cpu_options => $aws_cpu_options_request
  credit_specification => $aws_credit_specification_request
  disable_api_termination => "DisableApiTermination (optional)",
  dry_run => "DryRun (optional)",
  ebs_optimized => "EbsOptimized (optional)",
  elastic_gpu_specification => "ElasticGpuSpecification (optional)",
  elastic_inference_accelerators => "ElasticInferenceAccelerators (optional)",
  filters => "Filters (optional)",
  hibernation_options => $aws_hibernation_options_request
  iam_instance_profile => $aws_iam_instance_profile_specification
  kernel_id => "kernel_id (optional)",
  image_id => "image_id (optional)",
  instance_ids => "InstanceIds (optional)",
  instance_initiated_shutdown_behavior => $aws_shutdown_behavior
  instance_market_options => $aws_instance_market_options_request
  instance_type => $aws_instance_type
  ipv6_address_count => "1234 (optional)",
  ipv6_addresses => "Ipv6Addresses (optional)",
  kernel_id => "kernel_id (optional)",
  key_name => "key_name (optional)",
  launch_template => $aws_launch_template_specification
  license_specifications => $aws_license_specification_list_request
  max_count => "1234 (optional)",
  max_results => "1234 (optional)",
  min_count => "1234 (optional)",
  monitoring => $aws_run_instances_monitoring_enabled
  network_interfaces => "NetworkInterfaces (optional)",
  next_token => "next_token (optional)",
  placement => $aws_placement
  private_ip_address => "private_ip_address (optional)",
  ramdisk_id => "ramdisk_id (optional)",
  security_group_ids => "SecurityGroupIds (optional)",
  security_groups => "SecurityGroups (optional)",
  subnet_id => "subnet_id (optional)",
  tag_specifications => "TagSpecifications (optional)",
  user_data => "user_data (optional)",
}
NameTypeRequired
additional_infoStringfalse
block_device_mappingsBlockDeviceMappingRequestListfalse
capacity_reservation_specificationCapacityReservationSpecificationfalse
client_tokenStringfalse
cpu_optionsCpuOptionsRequestfalse
credit_specificationCreditSpecificationRequestfalse
disable_api_terminationBooleanfalse
dry_runBooleanfalse
ebs_optimizedBooleanfalse
elastic_gpu_specificationElasticGpuSpecificationsfalse
elastic_inference_acceleratorsElasticInferenceAcceleratorsfalse
filtersFilterListfalse
hibernation_optionsHibernationOptionsRequestfalse
iam_instance_profileIamInstanceProfileSpecificationfalse
kernel_idStringfalse
image_idStringfalse
instance_idsInstanceIdStringListfalse
instance_initiated_shutdown_behaviorShutdownBehaviorfalse
instance_market_optionsInstanceMarketOptionsRequestfalse
instance_typeInstanceTypefalse
ipv6_address_countIntegerfalse
ipv6_addressesInstanceIpv6AddressListfalse
kernel_idStringfalse
key_nameStringfalse
launch_templateLaunchTemplateSpecificationfalse
license_specificationsLicenseSpecificationListRequestfalse
max_countIntegerfalse
max_resultsIntegerfalse
min_countIntegerfalse
monitoringRunInstancesMonitoringEnabledfalse
network_interfacesInstanceNetworkInterfaceSpecificationListfalse
next_tokenStringfalse
placementPlacementfalse
private_ip_addressStringfalse
ramdisk_idStringfalse
security_group_idsSecurityGroupIdStringListfalse
security_groupsSecurityGroupStringListfalse
subnet_idStringfalse
tag_specificationsTagSpecificationListfalse
user_dataStringfalse

CRUD operations

Here is a list of endpoints that we use to create, read, update and delete the Instances

OperationPathVerbDescriptionOperationID
Create/POST

Launches the specified number of instances using an AMI for which you have permissions.

You can specify a number of options, or leave the default options. The following rules apply:

  • [EC2-VPC] If you don't specify a subnet ID, we choose a default subnet from your default VPC for you. If you don't have a default VPC, you must specify a subnet ID in the request.

  • [EC2-Classic] If don't specify an Availability Zone, we choose one for you.

  • Some instance types must be launched into a VPC. If you do not have a default VPC, or if you do not specify a subnet ID, the request fails. For more information, see Instance Types Available Only in a VPC.

  • [EC2-VPC] All instances have a network interface with a primary private IPv4 address. If you don't specify this address, we choose one from the IPv4 range of your subnet.

  • Not all instance types support IPv6 addresses. For more information, see Instance Types.

  • If you don't specify a security group ID, we use the default security group. For more information, see Security Groups.

  • If any of the AMIs have a product code attached for which the user has not subscribed, the request fails.

You can create a launch template, which is a resource that contains the parameters to launch an instance. When you launch an instance using RunInstances, you can specify the launch template instead of specifying the launch parameters.

To ensure faster instance launches, break up large requests into smaller batches. For example, create five separate launch requests for 100 instances each instead of one launch request for 500 instances.

An instance is ready for you to use when it's in the running state. You can check the state of your instance using DescribeInstances. You can tag instances and EBS volumes during launch, after launch, or both. For more information, see CreateTags and Tagging Your Amazon EC2 Resources.

Linux instances have access to the public key of the key pair at boot. You can use this key to provide secure access to the instance. Amazon EC2 public images use this feature to provide secure access without passwords. For more information, see Key Pairs in the Amazon Elastic Compute Cloud User Guide.

For troubleshooting, see What To Do If An Instance Immediately Terminates, and Troubleshooting Connecting to Your Instance in the Amazon Elastic Compute Cloud User Guide.

RunInstances
List - list all/POST

Describes one or more of your instances.

If you specify one or more instance IDs, Amazon EC2 returns information for those instances. If you do not specify instance IDs, Amazon EC2 returns information for all relevant instances. If you specify an instance ID that is not valid, an error is returned. If you specify an instance that you do not own, it is not included in the returned results.

Recently terminated instances might appear in the returned results. This interval is usually less than one hour.

If you describe instances in the rare case where an Availability Zone is experiencing a service disruption and you specify instance IDs that are in the affected zone, or do not specify any instance IDs at all, the call fails. If you describe instances and specify only instance IDs that are in an unaffected zone, the call works normally.

DescribeInstances
List - get one``
List - get list using params``
Update``
Delete/POST

Shuts down one or more instances. This operation is idempotent; if you terminate an instance more than once, each call succeeds.

If you specify multiple instances and the request fails (for example, because of a single incorrect instance ID), none of the instances are terminated.

Terminated instances remain visible after termination (for approximately one hour).

By default, Amazon EC2 deletes all EBS volumes that were attached when the instance launched. Volumes attached after instance launch continue running.

You can stop, start, and terminate EBS-backed instances. You can only terminate instance store-backed instances. What happens to an instance differs if you stop it or terminate it. For example, when you stop an instance, the root device and any other devices attached to the instance persist. When you terminate an instance, any attached EBS volumes with the DeleteOnTermination block device mapping parameter set to true are automatically deleted. For more information about the differences between stopping and terminating instances, see Instance Lifecycle in the Amazon Elastic Compute Cloud User Guide.

For more information about troubleshooting, see Troubleshooting Terminating Your Instance in the Amazon Elastic Compute Cloud User Guide.

TerminateInstances