-
Notifications
You must be signed in to change notification settings - Fork 1
/
public-demo.tf
27 lines (22 loc) · 992 Bytes
/
public-demo.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
module "public-vpc" {
count = var.public_enable == true ? 1 : 0
source = "./public-vpc"
keyname = aws_key_pair.key_pair.key_name
amazon2_ami = data.aws_ami.amazon_linux_2.id
windows_ami = data.aws_ami.windows.id
tags = {
"Environment" = "Public"
}
}
output "public_noNAT_instance" {
value = var.private_enable == true ? module.public-vpc[0].public_noNAT_instance : "NotActive"
}
output "public_NAT_instance" {
value = var.private_enable == true ? module.public-vpc[0].public_NAT_instance : "NotActive"
}
output "public_windows_instance" {
value = var.private_enable == true ? module.public-vpc[0].public_windows_instance : "NotActive"
}
output "public_windows_ssm_command_winSyntax" {
value = var.private_enable == true ? "aws ssm start-session --target ${module.public-vpc[0].public_windows_instance} --document-name AWS-StartPortForwardingSession --parameters 'portNumber'=['3389'],'localPortNumber'=['3389'] --region eu-west-1" : "NotActive"
}