-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample-main.tf.txt
44 lines (36 loc) · 993 Bytes
/
example-main.tf.txt
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
#CONFIG
variable "locations" {
description = "A map of workspace name to object, where the object contains the VPC and Subnet ids to create the instance in."
type = map(object({
vpc_id = string
subnet_id = string
}))
}
# BACKEND AND PROVIDERS
terraform {
required_version = "~>1.0.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.0"
}
}
}
# MAIN TF
module "diagnostic-instance" {
source = "cuotos/diagnostic-instance/aws"
version = "~>0.2.0"
vpc_id = var.locations[terraform.workspace].vpc_id
subnet_id = var.locations[terraform.workspace].subnet_id
additional_role_policies = [
"arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess",
"arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly",
"arn:aws:iam::aws:policy/SecretsManagerReadWrite",
]
}
output "instance_id" {
value = module.diagnostic-instance.instance_id
}
output "ami_id" {
value = module.diagnostic-instance.ami.image_id
}