@@ -72,61 +72,125 @@ Here is examples of how you can use this module in your inventory structure:
72
72
### Basic Example
73
73
``` hcl
74
74
module "ec2" {
75
- source = "clouddrove/ec2/aws"
76
- version = "0.15.0"
77
- environment = "test"
78
- label_order = ["name", "environment"]
79
- instance_count = 2
80
- ami = "ami-08d658f84a6d84a80"
81
- instance_type = "t2.nano"
82
- monitoring = false
83
- tenancy = "default"
84
- vpc_security_group_ids_list = [module.ssh.security_group_ids, module.http-https.security_group_ids]
85
- subnet_ids = tolist(module.public_subnets.public_subnet_id)
86
- assign_eip_address = true
87
- associate_public_ip_address = true
88
- instance_profile_enabled = true
89
- iam_instance_profile = module.iam-role.name
90
- disk_size = 8
91
- ebs_optimized = false
92
- ebs_volume_enabled = true
93
- ebs_volume_type = "gp2"
94
- ebs_volume_size = 30
95
- instance_tags = { "snapshot" = true }
96
- dns_zone_id = "Z1XJD7SSBKXLC1"
97
- hostname = "ec2"
75
+ source = "clouddrove/ec2/aws"
76
+
77
+ name = "ec2"
78
+ environment = "test"
79
+ label_order = ["name", "environment"]
80
+
81
+ #instance
82
+ instance_enabled = true
83
+ instance_count = 2
84
+ ami = "ami-08d658f84a6d84a80"
85
+ instance_type = "t2.nano"
86
+ monitoring = false
87
+ tenancy = "default"
88
+
89
+ #Networking
90
+ vpc_security_group_ids_list = [module.ssh.security_group_ids, module.http-https.security_group_ids]
91
+ subnet_ids = tolist(module.public_subnets.public_subnet_id)
92
+ assign_eip_address = true
93
+ associate_public_ip_address = true
94
+
95
+ #Keypair
96
+ key_name = module.keypair.name
97
+
98
+ #IAM
99
+ instance_profile_enabled = true
100
+ iam_instance_profile = module.iam-role.name
101
+
102
+ #Root Volume
103
+ root_block_device = [
104
+ {
105
+ volume_type = "gp2"
106
+ volume_size = 15
107
+ delete_on_termination = true
108
+ kms_key_id = module.kms_key.key_arn
109
+ }
110
+ ]
111
+
112
+ #EBS Volume
113
+ ebs_optimized = false
114
+ ebs_volume_enabled = false
115
+ ebs_volume_type = "gp2"
116
+ ebs_volume_size = 30
117
+
118
+ #DNS
119
+ dns_enabled = false
120
+ dns_zone_id = "Z1XJD7SSBKXLC1"
121
+ hostname = "ec2"
122
+
123
+ #Tags
124
+ instance_tags = { "snapshot" = true }
125
+
126
+ # Metadata
127
+ metadata_http_tokens_required = "optional"
128
+ metadata_http_endpoint_enabled = "enabled"
129
+ metadata_http_put_response_hop_limit = 2
98
130
}
99
131
```
100
132
101
- ### Secure Example
133
+ ### ebs_mount
102
134
``` hcl
103
135
module "ec2" {
104
- source = "clouddrove/ec2/aws"
105
- version = "0.15.0"
106
- environment = "test"
107
- label_order = ["name", "environment"]
108
- instance_count = 2
109
- ami = "ami-08d658f84a6d84a80"
110
- instance_type = "t2.nano"
111
- monitoring = false
112
- tenancy = "default"
113
- vpc_security_group_ids_list = [module.ssh.security_group_ids, module.http-https.security_group_ids]
114
- subnet_ids = tolist(module.public_subnets.public_subnet_id)
115
- assign_eip_address = true
116
- associate_public_ip_address = true
117
- instance_profile_enabled = true
118
- iam_instance_profile = module.iam-role.name
119
- disk_size = 8
120
- ebs_optimized = false
121
- ebs_volume_enabled = true
122
- ebs_volume_type = "gp2"
123
- ebs_volume_size = 30
124
- encrypted = true
125
- kms_key_id = module.kms_key.key_arn
126
- instance_tags = { "snapshot" = true }
127
- dns_zone_id = "Z1XJD7SSBKXLC1"
128
- hostname = "ec2"
129
- }
136
+ source = "clouddrove/ec2/aws"
137
+ name = "ec2"
138
+ environment = "test"
139
+ label_order = ["name", "environment"]
140
+
141
+ #Instance
142
+ instance_enabled = true
143
+ instance_count = 2
144
+ ami = "ami-08d658f84a6d84a80"
145
+ instance_type = "t2.nano"
146
+ monitoring = false
147
+ tenancy = "default"
148
+
149
+ #Keypair
150
+ key_name = module.keypair.name
151
+
152
+ #Networking
153
+ vpc_security_group_ids_list = [module.ssh.security_group_ids, module.http-https.security_group_ids]
154
+ subnet_ids = tolist(module.public_subnets.public_subnet_id)
155
+ assign_eip_address = true
156
+ associate_public_ip_address = true
157
+
158
+ #IAM
159
+ instance_profile_enabled = true
160
+ iam_instance_profile = module.iam-role.name
161
+
162
+ #Root Volume
163
+ root_block_device = [
164
+ {
165
+ volume_type = "gp2"
166
+ volume_size = 15
167
+ delete_on_termination = true
168
+ kms_key_id = module.kms_key.key_arn
169
+ }
170
+ ]
171
+
172
+ #EBS Volume
173
+ ebs_optimized = false
174
+ ebs_volume_enabled = true
175
+ ebs_volume_type = "gp2"
176
+ ebs_volume_size = 30
177
+
178
+ #DNS
179
+ dns_enabled = false
180
+ dns_zone_id = "Z1XJD7SSBKXLC1"
181
+ hostname = "ec2"
182
+
183
+ #Tags
184
+ instance_tags = { "snapshot" = true }
185
+
186
+ # Metadata
187
+ metadata_http_tokens_required = "optional"
188
+ metadata_http_endpoint_enabled = "enabled"
189
+ metadata_http_put_response_hop_limit = 2
190
+
191
+ #Mount EBS With User Data
192
+ user_data = file("user-data.sh")
193
+ }
130
194
```
131
195
132
196
0 commit comments