@@ -38,59 +38,123 @@ usage: |-
38
38
### Basic Example
39
39
```hcl
40
40
module "ec2" {
41
- source = "clouddrove/ec2/aws"
42
- version = "0.15.0"
43
- environment = "test"
44
- label_order = ["name", "environment"]
45
- instance_count = 2
46
- ami = "ami-08d658f84a6d84a80"
47
- instance_type = "t2.nano"
48
- monitoring = false
49
- tenancy = "default"
50
- vpc_security_group_ids_list = [module.ssh.security_group_ids, module.http-https.security_group_ids]
51
- subnet_ids = tolist(module.public_subnets.public_subnet_id)
52
- assign_eip_address = true
53
- associate_public_ip_address = true
54
- instance_profile_enabled = true
55
- iam_instance_profile = module.iam-role.name
56
- disk_size = 8
57
- ebs_optimized = false
58
- ebs_volume_enabled = true
59
- ebs_volume_type = "gp2"
60
- ebs_volume_size = 30
61
- instance_tags = { "snapshot" = true }
62
- dns_zone_id = "Z1XJD7SSBKXLC1"
63
- hostname = "ec2"
41
+ source = "clouddrove/ec2/aws"
42
+
43
+ name = "ec2"
44
+ environment = "test"
45
+ label_order = ["name", "environment"]
46
+
47
+ #instance
48
+ instance_enabled = true
49
+ instance_count = 2
50
+ ami = "ami-08d658f84a6d84a80"
51
+ instance_type = "t2.nano"
52
+ monitoring = false
53
+ tenancy = "default"
54
+
55
+ #Networking
56
+ vpc_security_group_ids_list = [module.ssh.security_group_ids, module.http-https.security_group_ids]
57
+ subnet_ids = tolist(module.public_subnets.public_subnet_id)
58
+ assign_eip_address = true
59
+ associate_public_ip_address = true
60
+
61
+ #Keypair
62
+ key_name = module.keypair.name
63
+
64
+ #IAM
65
+ instance_profile_enabled = true
66
+ iam_instance_profile = module.iam-role.name
67
+
68
+ #Root Volume
69
+ root_block_device = [
70
+ {
71
+ volume_type = "gp2"
72
+ volume_size = 15
73
+ delete_on_termination = true
74
+ kms_key_id = module.kms_key.key_arn
75
+ }
76
+ ]
77
+
78
+ #EBS Volume
79
+ ebs_optimized = false
80
+ ebs_volume_enabled = false
81
+ ebs_volume_type = "gp2"
82
+ ebs_volume_size = 30
83
+
84
+ #DNS
85
+ dns_enabled = false
86
+ dns_zone_id = "Z1XJD7SSBKXLC1"
87
+ hostname = "ec2"
88
+
89
+ #Tags
90
+ instance_tags = { "snapshot" = true }
91
+
92
+ # Metadata
93
+ metadata_http_tokens_required = "optional"
94
+ metadata_http_endpoint_enabled = "enabled"
95
+ metadata_http_put_response_hop_limit = 2
64
96
}
65
97
```
66
98
67
- ### Secure Example
99
+ ### ebs_mount
68
100
```hcl
69
101
module "ec2" {
70
- source = "clouddrove/ec2/aws"
71
- version = "0.15.0"
72
- environment = "test"
73
- label_order = ["name", "environment"]
74
- instance_count = 2
75
- ami = "ami-08d658f84a6d84a80"
76
- instance_type = "t2.nano"
77
- monitoring = false
78
- tenancy = "default"
79
- vpc_security_group_ids_list = [module.ssh.security_group_ids, module.http-https.security_group_ids]
80
- subnet_ids = tolist(module.public_subnets.public_subnet_id)
81
- assign_eip_address = true
82
- associate_public_ip_address = true
83
- instance_profile_enabled = true
84
- iam_instance_profile = module.iam-role.name
85
- disk_size = 8
86
- ebs_optimized = false
87
- ebs_volume_enabled = true
88
- ebs_volume_type = "gp2"
89
- ebs_volume_size = 30
90
- encrypted = true
91
- kms_key_id = module.kms_key.key_arn
92
- instance_tags = { "snapshot" = true }
93
- dns_zone_id = "Z1XJD7SSBKXLC1"
94
- hostname = "ec2"
95
- }
102
+ source = "clouddrove/ec2/aws"
103
+ name = "ec2"
104
+ environment = "test"
105
+ label_order = ["name", "environment"]
106
+
107
+ #Instance
108
+ instance_enabled = true
109
+ instance_count = 2
110
+ ami = "ami-08d658f84a6d84a80"
111
+ instance_type = "t2.nano"
112
+ monitoring = false
113
+ tenancy = "default"
114
+
115
+ #Keypair
116
+ key_name = module.keypair.name
117
+
118
+ #Networking
119
+ vpc_security_group_ids_list = [module.ssh.security_group_ids, module.http-https.security_group_ids]
120
+ subnet_ids = tolist(module.public_subnets.public_subnet_id)
121
+ assign_eip_address = true
122
+ associate_public_ip_address = true
123
+
124
+ #IAM
125
+ instance_profile_enabled = true
126
+ iam_instance_profile = module.iam-role.name
127
+
128
+ #Root Volume
129
+ root_block_device = [
130
+ {
131
+ volume_type = "gp2"
132
+ volume_size = 15
133
+ delete_on_termination = true
134
+ kms_key_id = module.kms_key.key_arn
135
+ }
136
+ ]
137
+
138
+ #EBS Volume
139
+ ebs_optimized = false
140
+ ebs_volume_enabled = true
141
+ ebs_volume_type = "gp2"
142
+ ebs_volume_size = 30
143
+
144
+ #DNS
145
+ dns_enabled = false
146
+ dns_zone_id = "Z1XJD7SSBKXLC1"
147
+ hostname = "ec2"
148
+
149
+ #Tags
150
+ instance_tags = { "snapshot" = true }
151
+
152
+ # Metadata
153
+ metadata_http_tokens_required = "optional"
154
+ metadata_http_endpoint_enabled = "enabled"
155
+ metadata_http_put_response_hop_limit = 2
156
+
157
+ #Mount EBS With User Data
158
+ user_data = file("user-data.sh")
159
+ }
96
160
```
0 commit comments