-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.tf
106 lines (91 loc) · 3.6 KB
/
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
provider "aws" {
region = "${var.aws_region}"
}
provider "archive" {
version = "~> 1.0"
}
terraform {
backend "s3" {}
}
resource "null_resource" "set_path" {
triggers = {
path_module = "${path.module}"
}
}
data "terraform_remote_state" "reference_arch" {
backend = "s3"
config {
bucket = "${var.ref_arch_bucket}"
key = "${var.ref_arch_path}"
region = "${var.aws_region}"
}
}
data "aws_ami" "jmeterami" {
most_recent = true
owners = ["850526132661"]
filter {
name = "tag:Name"
values = ["JMeterAMI"]
}
}
module "jmeter" {
source = "terraform"
ami = "${data.aws_ami.jmeterami.image_id}"
instance_type = "${var.instance_type}"
vpcid = "${data.terraform_remote_state.reference_arch.vpc_id}"
subnetlistprivate = ["${data.terraform_remote_state.reference_arch.priv-subnets}"]
common_tags = "${local.common_tags}"
mdsp_are = "${var.mdsp_are}"
mdsp_environmet = "${var.mdsp_environmet}"
mdsp_region_datacenter = "${var.mdsp_region_datacenter}"
mdsp_platform_services = "${var.mdsp_platform_services}"
mdsp_team = "${var.mdsp_team}"
tag_pipelineurl = "${var.tag_pipelineurl}"
ssh_key_name = "${var.ssh_key_name}"
root_ebs_size = "${var.root_ebs_size}"
vpc_cidr = "${var.vpc_cidr}"
vpcsecuritygroupid = "${var.vpcsecuritygroupid}"
environment = "${var.environment}"
aws_region = "${var.aws_region}"
project = "${var.project}"
bucket = "${var.bucket}"
module_path = "${null_resource.set_path.triggers.path_module}"
lambda_arn = "${module.lambda.lambda-arn}"
}
module "lambda" {
source = "terraform/lambda"
sns_topic_arn = "${module.jmeter.aws-sns-topic-arn}"
common_tags = "${local.common_tags}"
mdsp_are = "${var.mdsp_are}"
mdsp_environmet = "${var.mdsp_environmet}"
mdsp_region_datacenter = "${var.mdsp_region_datacenter}"
mdsp_platform_services = "${var.mdsp_platform_services}"
mdsp_team = "${var.mdsp_team}"
tag_pipelineurl = "${var.tag_pipelineurl}"
vpc_cidr = "${var.vpc_cidr}"
module_path = "${null_resource.set_path.triggers.path_module}"
environment = "${var.environment}"
vpcid = "${data.terraform_remote_state.reference_arch.vpc_id}"
subnetlistprivate = ["${data.terraform_remote_state.reference_arch.priv-subnets}"]
}
output "bucket_name" {
value = "${module.jmeter.bucket_name_list}"
}
output "ssm_doc_name" {
value = "${module.jmeter.ssm_doc_name}"
}
output "s3_key_prefix" {
value = "${module.jmeter.s3_key_prefix}"
}
output "instance_tag" {
value = "${module.jmeter.instance_tag}"
}
output "service_role_arn" {
value = "${module.jmeter.service-role-arn}"
}
output "aws_sns_topic_arn" {
value = "${module.jmeter.aws-sns-topic-arn}"
}
output "lambda_arn" {
value = "${module.lambda.lambda-arn}"
}