Skip to content

Commit

Permalink
Add child module to show hierarchy of processing tfvars
Browse files Browse the repository at this point in the history
  • Loading branch information
kooskoos20 committed May 12, 2022
1 parent 6c74e1b commit 0dd9072
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
24 changes: 24 additions & 0 deletions terraform-tfvars/modules/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//referencing ubuntu AMI
data "aws_ami" "ubuntu" {
most_recent = true
owners = ["099720109477"] #Canonical

filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-focal-20.04-amd64-server-*"]
}

filter {
name = "virtualization-type"
values = ["hvm"]
}
}

//spinning up another billing server
resource "aws_instance" "billing_server" {
ami = data.aws_ami.ubuntu.id
instance_type = var.instance_type
tags = {
"service" = "billing"
}
}
1 change: 1 addition & 0 deletions terraform-tfvars/modules/terraform.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
instance_type = "t2.small"
4 changes: 4 additions & 0 deletions terraform-tfvars/modules/variable.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
variable "instance_type" {
type = string
description = "EC2 instance type"
}

0 comments on commit 0dd9072

Please sign in to comment.