Skip to content

Commit

Permalink
fix configs
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Sep 19, 2022
1 parent 7c241a9 commit 9739c79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vpn-transit-gateway/vpn-config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ locals {

resource "null_resource" "directory_setup" {
triggers = {
name = "vpn-config"
name = "vpn-configs"
}
provisioner "local-exec" {
working_dir = path.root
Expand All @@ -59,7 +59,7 @@ resource "null_resource" "generate_configs" {
directory_setup = null_resource.directory_setup.id
}
provisioner "local-exec" {
working_dir = "${path.root}/vpn-configs"
working_dir = format("%v/%v", path.root, null_resource.directory_setup.triggers.name)
command = "aws ec2 get-vpn-connection-device-sample-configuration --vpn-connection-id ${each.value.vpn_connection_id} --vpn-connection-device-type-id 48548f98 --internet-key-exchange-version ikev1 --output text > ${each.value.label}.${each.value.vpn_connection_id}.txt"
environment = {
AWS_PROFILE = var.profile
Expand All @@ -72,14 +72,14 @@ resource "local_sensitive_file" "vpn_details_json" {
for_each = local.vpn_tunnel_outputs
# content = templatefile("${path.module}/templates/vpn_details.tpl"), {
content = jsonencode(merge({ version = local._module_version, name = each.key }, each.value, local.vpn_tunnel_secrets[each.key]))
filename = format("${path.root}/%v/%v.%v.%v.json", null_resource.directory_setup.triggers.name, local.account_id, local.region, each.key)
filename = format("%v/%v/%v.%v.%v.json", path.root, null_resource.directory_setup.triggers.name, local.account_id, local.region, each.key)
file_permission = "0644"
}

resource "local_sensitive_file" "vpn_details_yaml" {
for_each = local.vpn_tunnel_outputs
# content = templatefile("${path.module}/templates/vpn_details.tpl"), {
content = yamlencode(merge({ version = local._module_version, name = each.key }, each.value, local.vpn_tunnel_secrets[each.key]))
filename = format("${path.root}/%v/%v.%v.%v.yml", null_resource.directory_setup.triggers.name, local.account_id, local.region, each.key)
filename = format("%v/%v/%v.%v.%v.yml", path.root, null_resource.directory_setup.triggers.name, local.account_id, local.region, each.key)
file_permission = "0644"
}

0 comments on commit 9739c79

Please sign in to comment.