Skip to content

Commit f9ce6dc

Browse files
authored
Merge pull request #15 from thaunghtike-share/main
create descriptions for variables.tf
2 parents 7a61f74 + dfc4e75 commit f9ce6dc

File tree

3 files changed

+66
-35
lines changed

3 files changed

+66
-35
lines changed

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,27 +41,26 @@ terraform destroy -auto-approve
4141

4242
| Name | Version |
4343
|------|---------|
44-
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
45-
| <a name="provider_cloudinit"></a> [cloudinit](#provider\_cloudinit) | n/a |
44+
| <a name="provider_aws"></a> [aws](#provider\_aws) | 4.15.1 |
45+
| <a name="provider_cloudinit"></a> [cloudinit](#provider\_cloudinit) | 2.2.0 |
4646
## Inputs
4747

4848
| Name | Description | Type | Default | Required |
4949
|------|-------------|------|---------|:--------:|
50-
| <a name="input_ami_id"></a> [ami\_id](#input\_ami\_id) | n/a | `any` | `null` | no |
51-
| <a name="input_bastion_name"></a> [bastion\_name](#input\_bastion\_name) | n/a | `any` | n/a | yes |
52-
| <a name="input_ec2_connect_enabled"></a> [ec2\_connect\_enabled](#input\_ec2\_connect\_enabled) | n/a | `bool` | `true` | no |
53-
| <a name="input_ingress_cidrs"></a> [ingress\_cidrs](#input\_ingress\_cidrs) | n/a | `any` | n/a | yes |
54-
| <a name="input_instance_type"></a> [instance\_type](#input\_instance\_type) | n/a | `string` | `"t3.micro"` | no |
55-
| <a name="input_security_group_ids"></a> [security\_group\_ids](#input\_security\_group\_ids) | n/a | `list` | `[]` | no |
56-
| <a name="input_ssh_keys"></a> [ssh\_keys](#input\_ssh\_keys) | SSH public keys to add to the image | `list` | `[]` | no |
57-
| <a name="input_subnet_id"></a> [subnet\_id](#input\_subnet\_id) | n/a | `any` | n/a | yes |
58-
| <a name="input_tags"></a> [tags](#input\_tags) | n/a | `map` | `{}` | no |
59-
| <a name="input_ubuntu_version"></a> [ubuntu\_version](#input\_ubuntu\_version) | n/a | `string` | `"20.04"` | no |
60-
| <a name="input_user_data"></a> [user\_data](#input\_user\_data) | n/a | `string` | `""` | no |
61-
| <a name="input_user_data_replace_on_change"></a> [user\_data\_replace\_on\_change](#input\_user\_data\_replace\_on\_change) | n/a | `bool` | `false` | no |
62-
| <a name="input_userdata"></a> [userdata](#input\_userdata) | n/a | `string` | `""` | no |
63-
| <a name="input_volume_size"></a> [volume\_size](#input\_volume\_size) | n/a | `number` | `20` | no |
64-
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | n/a | `any` | n/a | yes |
50+
| <a name="input_ami_id"></a> [ami\_id](#input\_ami\_id) | The AMI ID of the bastion host | `string` | `null` | no |
51+
| <a name="input_bastion_name"></a> [bastion\_name](#input\_bastion\_name) | The name of the bastion host | `string` | n/a | yes |
52+
| <a name="input_ingress_cidrs"></a> [ingress\_cidrs](#input\_ingress\_cidrs) | Configuration block for ingress rules | `any` | n/a | yes |
53+
| <a name="input_instance_type"></a> [instance\_type](#input\_instance\_type) | EC2 Instance Type of the bastion host | `string` | `"t3.micro"` | no |
54+
| <a name="input_security_group_ids"></a> [security\_group\_ids](#input\_security\_group\_ids) | A list of security group names to associate with. | `list(any)` | `[]` | no |
55+
| <a name="input_ssh_keys"></a> [ssh\_keys](#input\_ssh\_keys) | SSH public keys to add to the image | `list(any)` | `[]` | no |
56+
| <a name="input_subnet_id"></a> [subnet\_id](#input\_subnet\_id) | The VPC subnet ID to launch in EC2 bastion host | `string` | n/a | yes |
57+
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to assign to the resource | `map(any)` | `{}` | no |
58+
| <a name="input_ubuntu_version"></a> [ubuntu\_version](#input\_ubuntu\_version) | Ubuntu Server Version | `string` | `"20.04"` | no |
59+
| <a name="input_user_data"></a> [user\_data](#input\_user\_data) | User data to provide when launching the instance | `string` | `""` | no |
60+
| <a name="input_user_data_replace_on_change"></a> [user\_data\_replace\_on\_change](#input\_user\_data\_replace\_on\_change) | To recreate the instance when user\_data is changed | `bool` | `false` | no |
61+
| <a name="input_userdata"></a> [userdata](#input\_userdata) | User data to provide when launching the instance | `string` | `""` | no |
62+
| <a name="input_volume_size"></a> [volume\_size](#input\_volume\_size) | Size of the volume in gibibytes (GiB) | `number` | `20` | no |
63+
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | The VPC ID to create security group for bastion host | `string` | n/a | yes |
6564
## Resources
6665

6766
| Name | Type |
@@ -78,4 +77,4 @@ terraform destroy -auto-approve
7877
| Name | Description |
7978
|------|-------------|
8079
| <a name="output_public_ip"></a> [public\_ip](#output\_public\_ip) | n/a |
81-
<!-- END_TF_DOCS -->
80+
<!-- END_TF_DOCS -->

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ resource "aws_instance" "this" {
4444

4545
monitoring = true
4646

47-
tags = merge(var.tags, {
47+
tags = merge(var.tags, {
4848
Name = var.bastion_name
4949
})
5050
user_data_replace_on_change = var.user_data_replace_on_change

variables.tf

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,79 @@
11
variable "ami_id" {
2-
default = null
2+
default = null
3+
type = string
4+
description = "The AMI ID of the bastion host"
5+
}
6+
7+
variable "bastion_name" {
8+
description = "The name of the bastion host"
9+
type = string
310
}
411

5-
variable "bastion_name" {}
612
variable "ssh_keys" {
713
description = "SSH public keys to add to the image"
814
default = []
15+
type = list(any)
916
}
17+
1018
variable "tags" {
11-
default = {}
19+
default = {}
20+
description = "A map of tags to assign to the resource"
21+
type = map(any)
22+
}
23+
24+
variable "vpc_id" {
25+
description = "The VPC ID to create security group for bastion host"
26+
type = string
27+
}
28+
29+
variable "subnet_id" {
30+
description = "The VPC subnet ID to launch in EC2 bastion host"
31+
type = string
1232
}
1333

14-
variable "vpc_id" {}
15-
variable "subnet_id" {}
1634
variable "security_group_ids" {
17-
default = []
35+
default = []
36+
description = "A list of security group names to associate with."
37+
type = list(any)
1838
}
39+
1940
variable "ubuntu_version" {
20-
default = "20.04"
41+
default = "20.04"
42+
description = "Ubuntu Server Version"
43+
type = string
2144
}
2245

2346
variable "userdata" {
24-
default = ""
47+
default = ""
48+
description = "User data to provide when launching the instance"
49+
type = string
2550
}
2651

2752
variable "volume_size" {
28-
default = 20
53+
default = 20
54+
description = "Size of the volume in gibibytes (GiB)"
55+
type = number
56+
2957
}
3058

3159
variable "instance_type" {
32-
default = "t3.micro"
60+
default = "t3.micro"
61+
description = "EC2 Instance Type of the bastion host"
62+
type = string
3363
}
3464

35-
variable "ingress_cidrs" {}
36-
37-
variable "ec2_connect_enabled" {
38-
default = true
65+
variable "ingress_cidrs" {
66+
description = "Configuration block for ingress rules"
3967
}
4068

4169
variable "user_data" {
42-
default = ""
70+
default = ""
71+
description = "User data to provide when launching the instance"
72+
type = string
4373
}
4474

4575
variable "user_data_replace_on_change" {
46-
default = false
76+
default = false
77+
description = "To recreate the instance when user_data is changed"
78+
type = bool
4779
}

0 commit comments

Comments
 (0)