|
6 | 6 | | alias | The display name of the alias. The name must start with the word `alias` followed by a forward slash. | `string` | `"alias/ec2-test"` | no | |
7 | 7 | | allowed\_ip | List of allowed ip. | `list(any)` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no | |
8 | 8 | | allowed\_ports | List of allowed ingress ports | `list(any)` | <pre>[<br> 80,<br> 443<br>]</pre> | no | |
9 | | -| ami | The AMI to use for the instance. | `string` | `""` | no | |
10 | 9 | | assign\_eip\_address | Assign an Elastic IP address to the instance. | `bool` | `true` | no | |
11 | | -| associate\_public\_ip\_address | Associate a public IP address with the instance. | `bool` | `true` | no | |
12 | | -| availability\_zone | AZ to start the instance in | `string` | `null` | no | |
13 | 10 | | capacity\_reservation\_specification | Describes an instance's Capacity Reservation targeting option | `any` | `{}` | no | |
14 | | -| cpu\_core\_count | Sets the number of CPU cores for an instance. | `string` | `null` | no | |
15 | 11 | | cpu\_credits | The credit option for CPU usage. Can be `standard` or `unlimited`. T3 instances are launched as unlimited by default. T2 instances are launched as standard by default. | `string` | `"standard"` | no | |
16 | 12 | | cpu\_options | Defines CPU options to apply to the instance at launch time. | `any` | `{}` | no | |
17 | | -| cpu\_threads\_per\_core | Sets the number of CPU threads per core for an instance (has no effect unless cpu\_core\_count is also set) | `number` | `null` | no | |
18 | 13 | | customer\_master\_key\_spec | Specifies whether the key contains a symmetric key or an asymmetric key pair and the encryption algorithms or signing algorithms that the key supports. Valid values: SYMMETRIC\_DEFAULT, RSA\_2048, RSA\_3072, RSA\_4096, ECC\_NIST\_P256, ECC\_NIST\_P384, ECC\_NIST\_P521, or ECC\_SECG\_P256K1. Defaults to SYMMETRIC\_DEFAULT. | `string` | `"SYMMETRIC_DEFAULT"` | no | |
19 | 14 | | default\_instance\_enabled | Flag to control the instance creation. | `bool` | `true` | no | |
20 | 15 | | deletion\_window\_in\_days | Duration in days after which the key is deleted after destruction of the resource. | `number` | `7` | no | |
21 | 16 | | delimiter | Delimiter to be used between `organization`, `environment`, `name` and `attributes`. | `string` | `"-"` | no | |
22 | | -| disable\_api\_termination | If true, enables EC2 Instance Termination Protection. | `bool` | `false` | no | |
23 | 17 | | dns\_enabled | Flag to control the dns\_enable. | `bool` | `false` | no | |
24 | 18 | | dns\_zone\_id | The Zone ID of Route53. | `string` | `"Z1XJD7SSBKXLC1"` | no | |
25 | 19 | | ebs\_block\_device | Additional EBS block devices to attach to the instance | `list(any)` | `[]` | no | |
26 | 20 | | ebs\_device\_name | Name of the EBS device to mount. | `list(string)` | <pre>[<br> "/dev/xvdb",<br> "/dev/xvdc",<br> "/dev/xvdd",<br> "/dev/xvde",<br> "/dev/xvdf",<br> "/dev/xvdg",<br> "/dev/xvdh",<br> "/dev/xvdi",<br> "/dev/xvdj",<br> "/dev/xvdk",<br> "/dev/xvdl",<br> "/dev/xvdm",<br> "/dev/xvdn",<br> "/dev/xvdo",<br> "/dev/xvdp",<br> "/dev/xvdq",<br> "/dev/xvdr",<br> "/dev/xvds",<br> "/dev/xvdt",<br> "/dev/xvdu",<br> "/dev/xvdv",<br> "/dev/xvdw",<br> "/dev/xvdx",<br> "/dev/xvdy",<br> "/dev/xvdz"<br>]</pre> | no | |
27 | 21 | | ebs\_iops | Amount of provisioned IOPS. This must be set with a volume\_type of io1. | `number` | `0` | no | |
28 | | -| ebs\_optimized | If true, the launched EC2 instance will be EBS-optimized. | `bool` | `false` | no | |
29 | 22 | | ebs\_volume\_enabled | Flag to control the ebs creation. | `bool` | `false` | no | |
30 | 23 | | ebs\_volume\_size | Size of the EBS volume in gigabytes. | `number` | `30` | no | |
31 | 24 | | ebs\_volume\_type | The type of EBS volume. Can be standard, gp3 or io1. | `string` | `"gp3"` | no | |
|
44 | 37 | | enable\_security\_group | Enable default Security Group with only Egress traffic allowed. | `bool` | `true` | no | |
45 | 38 | | enclave\_options\_enabled | Whether Nitro Enclaves will be enabled on the instance. Defaults to `false` | `bool` | `null` | no | |
46 | 39 | | environment | Environment (e.g. `prod`, `dev`, `staging`). | `string` | `""` | no | |
47 | | -| ephemeral\_block\_device | Customize Ephemeral (also known as Instance Store) volumes on the instance. | `list(any)` | `[]` | no | |
48 | | -| get\_password\_data | If true, wait for password data to become available and retrieve it | `bool` | `null` | no | |
49 | | -| hibernation | hibernate an instance, Amazon EC2 signals the operating system to perform hibernation. | `bool` | `false` | no | |
50 | | -| host\_id | The Id of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host. | `string` | `null` | no | |
51 | 40 | | hostname | DNS records to create. | `string` | `"ec2"` | no | |
52 | 41 | | iam\_instance\_profile | The IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. | `string` | `null` | no | |
| 42 | +| instance\_configuration | Configuration options for the EC2 instance | <pre>object({<br> ami = optional(string, "")<br> ebs_optimized = optional(bool, false)<br> instance_type = string<br> monitoring = optional(bool, false)<br> associate_public_ip_address = optional(bool, true)<br> disable_api_termination = optional(bool, false)<br> instance_initiated_shutdown_behavior = optional(string, "stop")<br> placement_group = optional(string, "")<br> tenancy = optional(string, "default")<br> host_id = optional(string, null)<br> cpu_core_count = optional(number, null)<br> cpu_threads_per_core = optional(number, null)<br> user_data = optional(string, "")<br> user_data_base64 = optional(string, null)<br> user_data_replace_on_change = optional(bool, null)<br> availability_zone = optional(string, null)<br> get_password_data = optional(bool, null)<br> private_ip = optional(string, null)<br> secondary_private_ips = optional(list(string), null)<br> source_dest_check = optional(bool, true)<br> ipv6_address_count = optional(number, null)<br> ipv6_addresses = optional(list(string), null)<br> hibernation = optional(bool, false)<br> root_block_device = optional(list(any), [])<br> ephemeral_block_device = optional(list(any), [])<br> })</pre> | <pre>{<br> "instance_type": "t4g.small"<br>}</pre> | no | |
53 | 43 | | instance\_count | Number of instances to launch. | `number` | `0` | no | |
54 | | -| instance\_initiated\_shutdown\_behavior | (Optional) Shutdown behavior for the instance. Amazon defaults this to `stop` for EBS-backed instances and `terminate` for instance-store instances. Cannot be set on instance-store instances. See Shutdown Behavior for more information. | `string` | `"stop"` | no | |
55 | 44 | | instance\_metadata\_tags\_enabled | Whether the metadata tag is available. Valid values include enabled or disabled. Defaults to enabled. | `string` | `"disabled"` | no | |
56 | 45 | | instance\_profile\_enabled | Flag to control the instance profile creation. | `bool` | `true` | no | |
57 | 46 | | instance\_tags | Instance tags. | `map(any)` | `{}` | no | |
58 | | -| instance\_type | The type of instance to start. Updates to this field will trigger a stop/start of the EC2 instance. | `string` | n/a | yes | |
59 | | -| ipv6\_address\_count | Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. | `number` | `null` | no | |
60 | | -| ipv6\_addresses | List of IPv6 addresses from the range of the subnet to associate with the primary network interface. | `list(any)` | `null` | no | |
61 | 47 | | is\_enabled | Specifies whether the key is enabled. | `bool` | `true` | no | |
62 | 48 | | is\_external | enable to udated existing security Group | `bool` | `false` | no | |
63 | 49 | | key\_name | Key name of the Key Pair to use for the instance; which can be managed using the aws\_key\_pair resource. | `string` | `""` | no | |
|
72 | 58 | | metadata\_http\_endpoint\_enabled | Whether the metadata service is available. Valid values include enabled or disabled. Defaults to enabled. | `string` | `"enabled"` | no | |
73 | 59 | | metadata\_http\_put\_response\_hop\_limit | The desired HTTP PUT response hop limit (between 1 and 64) for instance metadata requests. | `number` | `2` | no | |
74 | 60 | | metadata\_http\_tokens\_required | Whether or not the metadata service requires session tokens, also referred to as Instance Metadata Service Version 2 (IMDSv2). Valid values include optional or required. Defaults to optional. | `string` | `"optional"` | no | |
75 | | -| monitoring | If true, the launched EC2 instance will have detailed monitoring enabled. (Available since v0.6.0). | `bool` | `false` | no | |
76 | 61 | | multi\_attach\_enabled | Specifies whether to enable Amazon EBS Multi-Attach. Multi-Attach is supported on io1 and io2 volumes. | `bool` | `false` | no | |
77 | 62 | | name | Name (e.g. `app` or `cluster`). | `string` | `""` | no | |
78 | 63 | | network\_interface | Customize network interfaces to be attached at instance boot time | `list(map(string))` | `[]` | no | |
79 | | -| placement\_group | The Placement Group to start the instance in. | `string` | `""` | no | |
80 | | -| private\_ip | Private IP address to associate with the instance in a VPC | `string` | `null` | no | |
81 | 64 | | protocol | The protocol. If not icmp, tcp, udp, or all use the. | `string` | `"tcp"` | no | |
82 | 65 | | public\_key | Name (e.g. `ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQ`). | `string` | `""` | no | |
83 | 66 | | repository | Terraform current module repo | `string` | `"https://github.com/clouddrove/terraform-aws-ec2"` | no | |
84 | | -| root\_block\_device | Customize details about the root block device of the instance. See Block Devices below for details. | `list(any)` | `[]` | no | |
85 | 67 | | rsa\_bits | When algorithm is RSA, the size of the generated RSA key, in bits (default: 2048). | `number` | `4096` | no | |
86 | | -| secondary\_private\_ips | A list of secondary private IPv4 addresses to assign to the instance's primary network interface (eth0) in a VPC. Can only be assigned to the primary network interface (eth0) attached at instance creation, not a pre-existing network interface i.e. referenced in a `network_interface block` | `list(string)` | `null` | no | |
87 | 68 | | sg\_description | The security group description. | `string` | `"Instance default security group (only egress access is allowed)."` | no | |
88 | 69 | | sg\_egress\_description | Description of the egress and ingress rule | `string` | `"Description of the rule."` | no | |
89 | 70 | | sg\_egress\_ipv6\_description | Description of the egress\_ipv6 rule | `string` | `"Description of the rule."` | no | |
90 | 71 | | sg\_ids | of the security group id. | `list(any)` | `[]` | no | |
91 | 72 | | sg\_ingress\_description | Description of the ingress rule | `string` | `"Description of the ingress rule use elasticache."` | no | |
92 | | -| source\_dest\_check | Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs. | `bool` | `true` | no | |
93 | | -| spot\_block\_duration\_minutes | The required duration for the Spot instances, in minutes. This value must be a multiple of 60 (60, 120, 180, 240, 300, or 360) | `number` | `null` | no | |
| 73 | +| spot\_configuration | Configuration options for the EC2 spot instance | <pre>object({<br> spot_price = optional(string, null)<br> wait_for_fulfillment = optional(bool, false)<br> spot_type = optional(string, null)<br> launch_group = optional(string, null)<br> block_duration_minutes = optional(number, null)<br> instance_interruption_behavior = optional(string, null)<br> valid_until = optional(string, null)<br> valid_from = optional(string, null)<br> })</pre> | `{}` | no | |
94 | 74 | | spot\_instance\_count | Number of instances to launch. | `number` | `0` | no | |
95 | 75 | | spot\_instance\_enabled | Flag to control the instance creation. | `bool` | `true` | no | |
96 | | -| spot\_instance\_interruption\_behavior | Indicates Spot instance behavior when it is interrupted. Valid values are `terminate`, `stop`, or `hibernate` | `string` | `null` | no | |
97 | 76 | | spot\_instance\_tags | Instance tags. | `map(any)` | `{}` | no | |
98 | | -| spot\_launch\_group | A launch group is a group of spot instances that launch together and terminate together. If left empty instances are launched and terminated individually | `string` | `null` | no | |
99 | | -| spot\_price | The maximum price to request on the spot market. Defaults to on-demand price | `string` | `null` | no | |
100 | | -| spot\_type | If set to one-time, after the instance is terminated, the spot request will be closed. Default `persistent` | `string` | `null` | no | |
101 | | -| spot\_valid\_from | The start date and time of the request, in UTC RFC3339 format(for example, YYYY-MM-DDTHH:MM:SSZ) | `string` | `null` | no | |
102 | | -| spot\_valid\_until | The end date and time of the request, in UTC RFC3339 format(for example, YYYY-MM-DDTHH:MM:SSZ) | `string` | `null` | no | |
103 | | -| spot\_wait\_for\_fulfillment | If set, Terraform will wait for the Spot Request to be fulfilled, and will throw an error if the timeout of 10m is reached | `bool` | `false` | no | |
104 | 77 | | ssh\_allowed\_ip | List of allowed ip. | `list(any)` | `[]` | no | |
105 | 78 | | ssh\_allowed\_ports | List of allowed ingress ports | `list(any)` | `[]` | no | |
106 | 79 | | ssh\_protocol | The protocol. If not icmp, tcp, udp, or all use the. | `string` | `"tcp"` | no | |
107 | 80 | | ssh\_sg\_ingress\_description | Description of the ingress rule | `string` | `"Description of the ingress rule use elasticache."` | no | |
108 | 81 | | subnet\_ids | A list of VPC Subnet IDs to launch in. | `list(string)` | `[]` | no | |
109 | 82 | | tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`). | `map(any)` | `{}` | no | |
110 | | -| tenancy | 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. The host tenancy is not supported for the import-instance command. | `string` | `"default"` | no | |
111 | 83 | | timeouts | Define maximum timeout for creating, updating, and deleting EC2 instance resources | `map(string)` | `{}` | no | |
112 | 84 | | ttl | The TTL of the record to add to the DNS zone to complete certificate validation. | `string` | `"300"` | no | |
113 | 85 | | type | Type of DNS records to create. | `string` | `"CNAME"` | no | |
114 | | -| user\_data | (Optional) A string of the desired User Data for the ec2. | `string` | `""` | no | |
115 | | -| user\_data\_base64 | Can be used instead of user\_data to pass base64-encoded binary data directly. Use this instead of user\_data whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption | `string` | `null` | no | |
116 | | -| user\_data\_replace\_on\_change | When used in combination with user\_data or user\_data\_base64 will trigger a destroy and recreate when set to true. Defaults to false if not set | `bool` | `null` | no | |
117 | 86 | | vpc\_id | The ID of the VPC that the instance security group belongs to. | `string` | `""` | no | |
118 | 87 |
|
119 | 88 | ## Outputs |
|
0 commit comments