File tree 3 files changed +32
-1
lines changed
3 files changed +32
-1
lines changed Original file line number Diff line number Diff line change
1
+ # aws-instance-first-script
2
+
3
+ A Terraform module for creating AWS EC2 instance with userdata for creating EBS.
4
+
5
+ ## Usage
6
+
7
+ ``` hcl
8
+ module "ec2_instance" {
9
+ source = "git::https://github.com/easyawslearn/Terraform-Tutorial.git/ebc-with-userdata"
10
+
11
+ region = "us-west-2"
12
+ key-name = "ec2-demo"
13
+ instance_type = "t2.micro"
14
+ ebs_size = "20"
15
+ }
16
+ ```
17
+
18
+ ## Inputs
19
+
20
+ | Name | Description | Type | Default | Required |
21
+ | ------| -------------| :----:| :-----:| :-----:|
22
+ | region | AWS region | string | us-east-1 | yes |
23
+ | key-name | ec2 access key name | string | ec2-demo | yes |
24
+ | instance_type | ec2 instance_type | string | t2.micro | yes |
25
+ | ebs_size | EBS volume size | string | 20 | yes |
Original file line number Diff line number Diff line change 1
1
resource "aws_ebs_volume" "ebs_volume" {
2
2
availability_zone = " us-east-1a"
3
- size = 20
3
+ size = var . ebs_size
4
4
type = " gp2"
5
5
6
6
tags = {
Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ variable "device_name" {
19
19
type = " string"
20
20
default = " /dev/xvdh"
21
21
}
22
+
23
+ variable "ebs_size" {
24
+ type = " string"
25
+ default = " 20"
26
+ }
27
+
22
28
variable "key_name" {
23
29
type = " string"
24
30
default = " ec2-demo"
You can’t perform that action at this time.
0 commit comments