Resource Type definition for AWS::EC2::Instance
additional_info
(String) This property is reserved for internal use. If you use it, the stack fails with this error: Bad property set: [Testing this property] (Service: AmazonEC2; Status Code: 400; Error Code: InvalidParameterCombination; Request ID: 0XXXXXX-49c7-4b40-8bcc-76885dcXXXXX).affinity
(String) Indicates whether the instance is associated with a dedicated host. If you want the instance to always restart on the same host on which it was launched, specify host. If you want the instance to restart on any available host, but try to launch onto the last host it ran on (on a best-effort basis), specify default.availability_zone
(String) The Availability Zone of the instance.block_device_mappings
(Attributes List) The block device mapping entries that defines the block devices to attach to the instance at launch. (see below for nested schema)cpu_options
(Attributes) The CPU options for the instance. (see below for nested schema)credit_specification
(Attributes) The credit option for CPU usage of the burstable performance instance. Valid values are standard and unlimited. (see below for nested schema)disable_api_termination
(Boolean) If you set this parameter to true, you can't terminate the instance using the Amazon EC2 console, CLI, or API; otherwise, you can.ebs_optimized
(Boolean) Indicates whether the instance is optimized for Amazon EBS I/O.elastic_gpu_specifications
(Attributes List) An elastic GPU to associate with the instance. (see below for nested schema)elastic_inference_accelerators
(Attributes List) An elastic inference accelerator to associate with the instance. (see below for nested schema)enclave_options
(Attributes) Indicates whether the instance is enabled for AWS Nitro Enclaves. (see below for nested schema)hibernation_options
(Attributes) Indicates whether an instance is enabled for hibernation. (see below for nested schema)host_id
(String) If you specify host for the Affinity property, the ID of a dedicated host that the instance is associated with. If you don't specify an ID, Amazon EC2 launches the instance onto any available, compatible dedicated host in your account.host_resource_group_arn
(String) The ARN of the host resource group in which to launch the instances. If you specify a host resource group ARN, omit the Tenancy parameter or set it to host.iam_instance_profile
(String) The IAM instance profile.image_id
(String) The ID of the AMI. An AMI ID is required to launch an instance and must be specified here or in a launch template.instance_initiated_shutdown_behavior
(String) Indicates whether an instance stops or terminates when you initiate shutdown from the instance (using the operating system command for system shutdown).instance_type
(String) The instance type.ipv_6_address_count
(Number) [EC2-VPC] The number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet.ipv_6_addresses
(Attributes List) [EC2-VPC] The IPv6 addresses from the range of the subnet to associate with the primary network interface. (see below for nested schema)kernel_id
(String) The ID of the kernel.key_name
(String) The name of the key pair.launch_template
(Attributes) The launch template to use to launch the instances. (see below for nested schema)license_specifications
(Attributes List) The license configurations. (see below for nested schema)monitoring
(Boolean) Specifies whether detailed monitoring is enabled for the instance.network_interfaces
(Attributes List) The network interfaces to associate with the instance. (see below for nested schema)placement_group_name
(String) The name of an existing placement group that you want to launch the instance into (cluster | partition | spread).private_dns_name_options
(Attributes) The options for the instance hostname. (see below for nested schema)private_ip_address
(String) [EC2-VPC] The primary IPv4 address. You must specify a value from the IPv4 address range of the subnet.propagate_tags_to_volume_on_creation
(Boolean) Indicates whether to assign the tags from the instance to all of the volumes attached to the instance at launch. If you specify true and you assign tags to the instance, those tags are automatically assigned to all of the volumes that you attach to the instance at launch. If you specify false, those tags are not assigned to the attached volumes.ramdisk_id
(String) The ID of the RAM disk to select.security_group_ids
(List of String) The IDs of the security groups.security_groups
(List of String) the names of the security groups. For a nondefault VPC, you must use security group IDs instead.source_dest_check
(Boolean) Specifies whether to enable an instance launched in a VPC to perform NAT.ssm_associations
(Attributes List) The SSM document and parameter values in AWS Systems Manager to associate with this instance. (see below for nested schema)subnet_id
(String) [EC2-VPC] The ID of the subnet to launch the instance into.tags
(Attributes List) The tags to add to the instance. (see below for nested schema)tenancy
(String) The tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware.user_data
(String) The user data to make available to the instance.volumes
(Attributes List) The volumes to attach to the instance. (see below for nested schema)id
(String) Uniquely identifies the resource.instance_id
(String) The EC2 Instance ID.private_dns_name
(String) The private DNS name of the specified instance. For example: ip-10-24-34-0.ec2.internal.private_ip
(String) The private IP address of the specified instance. For example: 10.24.34.0.public_dns_name
(String) The public DNS name of the specified instance. For example: ec2-107-20-50-45.compute-1.amazonaws.com.public_ip
(String) The public IP address of the specified instance. For example: 192.0.2.0.state
(Attributes) The current state of the instance. (see below for nested schema)vpc_id
(String) The ID of the VPC that the instance is running in.block_device_mappings
Required:
device_name
(String) The device name (for example, /dev/sdh or xvdh).Optional:
ebs
(Attributes) Parameters used to automatically set up EBS volumes when the instance is launched. (see below for nested schema)no_device
(String)virtual_name
(String)block_device_mappings.ebs
Optional:
delete_on_termination
(Boolean) Indicates whether the EBS volume is deleted on instance termination.encrypted
(Boolean) Indicates whether the volume should be encrypted.iops
(Number) The number of I/O operations per second (IOPS). For gp3, io1, and io2 volumes, this represents the number of IOPS that are provisioned for the volume. For gp2 volumes, this represents the baseline performance of the volume and the rate at which the volume accumulates I/O credits for bursting.kms_key_id
(String) The identifier of the AWS Key Management Service (AWS KMS) customer managed CMK to use for Amazon EBS encryption. If KmsKeyId is specified, the encrypted state must be true. If the encrypted state is true but you do not specify KmsKeyId, your AWS managed CMK for EBS is used.snapshot_id
(String) The ID of the snapshot.volume_size
(Number) The size of the volume, in GiBs. You must specify either a snapshot ID or a volume size. If you specify a snapshot, the default is the snapshot size. You can specify a volume size that is equal to or larger than the snapshot size.volume_type
(String) The volume type.cpu_options
Optional:
core_count
(Number)threads_per_core
(Number)credit_specification
Optional:
cpu_credits
(String)elastic_gpu_specifications
Required:
type
(String) The type of Elastic Graphics accelerator.elastic_inference_accelerators
Required:
type
(String) The type of elastic inference accelerator.Optional:
count
(Number) The number of elastic inference accelerators to attach to the instance.enclave_options
Optional:
enabled
(Boolean) If this parameter is set to true, the instance is enabled for AWS Nitro Enclaves; otherwise, it is not enabled for AWS Nitro Enclaves.hibernation_options
Optional:
configured
(Boolean) If you set this parameter to true, your instance is enabled for hibernation.ipv_6_addresses
Required:
ipv_6_address
(String) The IPv6 address.launch_template
Optional:
launch_template_id
(String) The ID of the launch template. You must specify the LaunchTemplateName or the LaunchTemplateId, but not both.launch_template_name
(String) The name of the launch template. You must specify the LaunchTemplateName or the LaunchTemplateId, but not both.version
(String) The version number of the launch template.license_specifications
Required:
license_configuration_arn
(String) The Amazon Resource Name (ARN) of the license configuration.network_interfaces
Required:
device_index
(String) The position of the network interface in the attachment order. A primary network interface has a device index of 0.Optional:
associate_carrier_ip_address
(Boolean) Not currently supported by AWS CloudFormation.associate_public_ip_address
(Boolean) Indicates whether to assign a public IPv4 address to an instance you launch in a VPC.delete_on_termination
(Boolean) If set to true, the interface is deleted when the instance is terminated.description
(String) The description of the network interface.group_set
(List of String) The IDs of the security groups for the network interface.ipv_6_address_count
(Number) A number of IPv6 addresses to assign to the network interface.ipv_6_addresses
(Attributes List) The IPv6 addresses associated with the network interface. (see below for nested schema)network_interface_id
(String) The ID of the network interface.private_ip_address
(String) The private IPv4 address of the network interface.private_ip_addresses
(Attributes List) One or more private IPv4 addresses to assign to the network interface. (see below for nested schema)secondary_private_ip_address_count
(Number) The number of secondary private IPv4 addresses.subnet_id
(String) The ID of the subnet.network_interfaces.ipv_6_addresses
Required:
ipv_6_address
(String) The IPv6 address.network_interfaces.private_ip_addresses
Required:
primary
(Boolean) Indicates whether the private IPv4 address is the primary private IPv4 address. Only one IPv4 address can be designated as primary.private_ip_address
(String) The private IPv4 addresses.private_dns_name_options
Optional:
enable_resource_name_dns_a_record
(Boolean) Indicates whether to respond to DNS queries for instance hostnames with DNS A records. For more information, see Amazon EC2 instance hostname types in the Amazon Elastic Compute Cloud User Guide.enable_resource_name_dns_aaaa_record
(Boolean) Indicates whether to respond to DNS queries for instance hostnames with DNS AAAA records. For more information, see Amazon EC2 instance hostname types in the Amazon Elastic Compute Cloud User Guide.hostname_type
(String) The type of hostnames to assign to instances in the subnet at launch. For IPv4 only subnets, an instance DNS name must be based on the instance IPv4 address. For IPv6 only subnets, an instance DNS name must be based on the instance ID. For dual-stack subnets, you can specify whether DNS names use the instance IPv4 address or the instance ID. For more information, see Amazon EC2 instance hostname types in the Amazon Elastic Compute Cloud User Guide.ssm_associations
Required:
document_name
(String) The name of an SSM document to associate with the instance.Optional:
association_parameters
(Attributes List) The input parameter values to use with the associated SSM document. (see below for nested schema)ssm_associations.association_parameters
Required:
key
(String) The name of an input parameter that is in the associated SSM document.value
(List of String) The value of an input parameter.tags
Required:
key
(String)value
(String)volumes
Required:
device
(String) The device name (for example, /dev/sdh or xvdh).volume_id
(String) The ID of the EBS volume. The volume and instance must be within the same Availability Zone.state
Read-Only:
code
(String) The state of the instance as a 16-bit unsigned integer.name
(String) The current state of the instance.Import is supported using the following syntax:
$ terraform import awscc_ec2_instance.example <resource ID>