forked from hashicorp/learn-terraform-init
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
45 lines (33 loc) · 773 Bytes
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
provider "aws" {
region = var.region
}
provider "random" {}
data "aws_ami" "ubuntu" {
most_recent = true
filter {
name = "name"
values = ["ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-*"]
}
filter {
name = "virtualization-type"
values = ["hvm"]
}
owners = ["099720109477"] # Canonical
}
resource "random_pet" "instance" {
length = 2
}
module "ec2-instance" {
source = "./modules/aws-ec2-instance"
ami_id = data.aws_ami.ubuntu.id
instance_name = random_pet.instance.id
}
module "hello" {
source = "joatmon08/hello/random"
version = "4.0.0"
hello = "World"
second_hello = random_pet.instance.id
secret_key = "secret"
}