forked from cvamsikrishna11/devops-fully-automated-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
35 lines (30 loc) · 898 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
# module to create IAM role and policy for the CloudWatch access
module "iam" {
source = "./iam"
name = local.common_tags.company
tags = local.common_tags
}
# module code to create the ec2 instance with user data
module "ec2_dev" {
source = "./ec2"
name = "dev"
tags = local.common_tags
iam_role_name = module.iam.ec2_iam_role_name
key_pair_name = "keypair01"
}
# module code to create the ec2 instance with user data.
module "ec2_stage" {
source = "./ec2"
name = "stage"
tags = local.common_tags
iam_role_name = module.iam.ec2_iam_role_name
key_pair_name = "keypair01"
}
# module code to create the ec2 instance with user data
module "ec2_prod" {
source = "./ec2"
name = "prod"
tags = local.common_tags
iam_role_name = module.iam.ec2_iam_role_name
key_pair_name = "keypair01"
}