Skip to content

Commit 8ec572d

Browse files
committed
split variables and output into separate files for aws
1 parent b0ecac3 commit 8ec572d

File tree

3 files changed

+17
-19
lines changed

3 files changed

+17
-19
lines changed

infrastructure-as-code/aws-ec2-instance/main.tf

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,6 @@ terraform {
22
required_version = ">= 0.11.0"
33
}
44

5-
variable "aws_region" {
6-
description = "AWS region"
7-
default = "us-west-1"
8-
}
9-
10-
variable "ami_id" {
11-
description = "ID of the AMI to provision. Default is Ubuntu 14.04 Base Image"
12-
default = "ami-2e1ef954"
13-
}
14-
15-
variable "instance_type" {
16-
description = "type of EC2 instance to provision."
17-
default = "t2.micro"
18-
}
19-
205
provider "aws" {
216
region = "${var.aws_region}"
227
}
@@ -30,7 +15,3 @@ resource "aws_instance" "ubuntu" {
3015
Name = "Provisioned-by-Terraform"
3116
}
3217
}
33-
34-
output "public_dns" {
35-
value = "${aws_instance.ubuntu.public_dns}"
36-
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
output "public_dns" {
2+
value = "${aws_instance.ubuntu.public_dns}"
3+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
variable "aws_region" {
2+
description = "AWS region"
3+
default = "us-west-1"
4+
}
5+
6+
variable "ami_id" {
7+
description = "ID of the AMI to provision. Default is Ubuntu 14.04 Base Image"
8+
default = "ami-2e1ef954"
9+
}
10+
11+
variable "instance_type" {
12+
description = "type of EC2 instance to provision."
13+
default = "t2.micro"
14+
}

0 commit comments

Comments
 (0)