You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-7Lines changed: 11 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -87,8 +87,7 @@ data "aws_ami" "ubuntu-xenial" {
87
87
88
88
## Notes
89
89
90
-
*`network_interface` can't be specified together with `associate_public_ip_address`, which makes `network_interface`
91
-
not configurable using this module at the moment
90
+
*`network_interface` can't be specified together with `vpc_security_group_ids`, `associate_public_ip_address`, `subnet_id`. See [basic example](https://github.com/terraform-aws-modules/terraform-aws-ec2-instance/tree/master/examples/basic) for details.
92
91
* Changes in `ebs_block_device` argument will be ignored. Use [aws_volume_attachment](https://www.terraform.io/docs/providers/aws/r/volume_attachment.html) resource to attach and detach volumes from AWS EC2 instances. See [this example](https://github.com/terraform-aws-modules/terraform-aws-ec2-instance/tree/master/examples/volume-attachment).
93
92
* One of `subnet_id` or `subnet_ids` is required. If both are provided, the value of `subnet_id` is prepended to the value of `subnet_ids`.
94
93
@@ -98,7 +97,7 @@ data "aws_ami" "ubuntu-xenial" {
98
97
| Name | Description | Type | Default | Required |
99
98
|------|-------------|:----:|:-----:|:-----:|
100
99
| ami | ID of AMI to use for the instance | string | n/a | yes |
101
-
| associate\_public\_ip\_address | If true, the EC2 instance will have associated public IP address | bool |`"false"`| no |
100
+
| associate\_public\_ip\_address | If true, the EC2 instance will have associated public IP address | bool |`"null"`| no |
102
101
| cpu\_credits | The credit option for CPU usage (unlimited or standard) | string |`"standard"`| no |
103
102
| disable\_api\_termination | If true, enables EC2 Instance Termination Protection | bool |`"false"`| no |
104
103
| ebs\_block\_device | Additional EBS block devices to attach to the instance | list(map(string)) |`[]`| no |
@@ -109,14 +108,14 @@ data "aws_ami" "ubuntu-xenial" {
109
108
| instance\_count | Number of instances to launch | number |`"1"`| no |
110
109
| instance\_initiated\_shutdown\_behavior | Shutdown behavior for the instance | string |`""`| no |
111
110
| instance\_type | The type of instance to start | string | n/a | yes |
112
-
| ipv6\_address\_count | A number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. | number |`"0"`| no |
113
-
| ipv6\_addresses | Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface | list(string) |`[]`| no |
111
+
| ipv6\_address\_count | A 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 |
112
+
| ipv6\_addresses | Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface | list(string) |`"null"`| no |
114
113
| key\_name | The key name to use for the instance | string |`""`| no |
115
114
| monitoring | If true, the launched EC2 instance will have detailed monitoring enabled | bool |`"false"`| no |
116
115
| name | Name to be used on all resources as prefix | string | n/a | yes |
117
116
| network\_interface | Customize network interfaces to be attached at instance boot time | list(map(string)) |`[]`| no |
118
117
| placement\_group | The Placement Group to start the instance in | string |`""`| no |
119
-
| private\_ip | Private IP address to associate with the instance in a VPC | string |`""`| no |
118
+
| private\_ip | Private IP address to associate with the instance in a VPC | string |`"null"`| no |
120
119
| private\_ips | A list of private IP address to associate with the instance in a VPC. Should match the number of instances. | list(string) |`[]`| no |
121
120
| root\_block\_device | Customize details about the root block device of the instance. See Block Devices below for details | list(map(string)) |`[]`| no |
122
121
| 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 |
@@ -127,15 +126,19 @@ data "aws_ami" "ubuntu-xenial" {
127
126
| use\_num\_suffix | Always append numerical suffix to instance name, even if instance_count is 1 | bool |`"false"`| no |
128
127
| user\_data | The user data to provide when launching the instance | string |`""`| no |
129
128
| volume\_tags | A mapping of tags to assign to the devices created by the instance at launch time | map(string) |`{}`| no |
130
-
| vpc\_security\_group\_ids | A list of security group IDs to associate with | list(string) |n/a|yes|
129
+
| vpc\_security\_group\_ids | A list of security group IDs to associate with | list(string) |`"null"`|no|
131
130
132
131
## Outputs
133
132
134
133
| Name | Description |
135
134
|------|-------------|
135
+
| arn | List of ARNs of instances |
136
136
| availability\_zone | List of availability zones of instances |
137
137
| credit\_specification | List of credit specification of instances |
138
+
| ebs\_block\_device\_volume\_ids | List of volume IDs of EBS block devices of instances |
138
139
| id | List of IDs of instances |
140
+
| instance\_state | List of instance states of instances |
141
+
| ipv6\_addresses | List of assigned IPv6 addresses of instances |
139
142
| key\_name | List of key names of instances |
140
143
| password\_data | List of Base-64 encoded encrypted password data for the instance |
141
144
| placement\_group | List of placement groups of instances |
@@ -144,6 +147,7 @@ data "aws_ami" "ubuntu-xenial" {
144
147
| private\_ip | List of private IP addresses assigned to the instances |
145
148
| public\_dns | List of public DNS names assigned to the instances. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC |
146
149
| public\_ip | List of public IP addresses assigned to the instances, if applicable |
150
+
| root\_block\_device\_volume\_ids | List of volume IDs of root block devices of instances |
147
151
| security\_groups | List of associated security groups of instances |
148
152
| subnet\_id | List of IDs of VPC subnets of instances |
Copy file name to clipboardExpand all lines: examples/basic/README.md
+3-5Lines changed: 3 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,6 @@
1
1
# Basic EC2 instance
2
2
3
-
Configuration in this directory creates EC2 instances with minimum set of arguments. It will also assign Elastic IP (EIP) to an instance.
4
-
5
-
Unspecified arguments for security group id and subnet are inherited from the default VPC.
6
-
7
-
This example outputs instance id and public DNS name as a single value and as a list.
3
+
Configuration in this directory creates EC2 instances with different sets of arguments (with Elastic IP, with network interface attached, with credit specifications).
8
4
9
5
## Usage
10
6
@@ -25,12 +21,14 @@ Note that this example may create resources which can cost money. Run `terraform
25
21
|------|-------------|
26
22
| credit\_specification | Credit specification of EC2 instance (empty list for not t2 instance types) |
27
23
| credit\_specification\_t2\_unlimited | Credit specification of t2-type EC2 instance |
24
+
| ebs\_block\_device\_volume\_ids | List of volume IDs of EBS block devices of instances |
28
25
| ids | List of IDs of instances |
29
26
| ids\_t2 | List of IDs of t2-type instances |
30
27
| instance\_id | EC2 instance ID |
31
28
| instance\_public\_dns | Public DNS name assigned to the EC2 instance |
32
29
| placement\_group | List of placement group |
33
30
| public\_dns | List of public DNS names assigned to the instances |
31
+
| root\_block\_device\_volume\_ids | List of volume IDs of root block devices of instances |
34
32
| t2\_instance\_id | EC2 instance ID |
35
33
| tags | List of tags |
36
34
| vpc\_security\_group\_ids | List of VPC security group ids assigned to the instances |
description="A number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet."
125
126
type=number
126
-
default=0
127
+
default=null
127
128
}
128
129
129
130
variable"ipv6_addresses" {
130
131
description="Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface"
0 commit comments