Skip to content

Commit

Permalink
add yaml file too
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Sep 19, 2022
1 parent 26bc1f7 commit 19b8696
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion vpn-transit-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ No modules.
| [aws_ec2_transit_gateway_route_table_association.route_table](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_transit_gateway_route_table_association) | resource |
| [aws_ec2_transit_gateway_route_table_propagation.propagate](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_transit_gateway_route_table_propagation) | resource |
| [aws_vpn_connection.vpn](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/vpn_connection) | resource |
| [local_sensitive_file.vpn_details](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/sensitive_file) | resource |
| [local_sensitive_file.vpn_details_json](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/sensitive_file) | resource |
| [local_sensitive_file.vpn_details_yaml](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/sensitive_file) | resource |
| [null_resource.directory_setup](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
| [null_resource.generate_configs](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
| [random_string.tunnel_preshared_key](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/string) | resource |
Expand Down
10 changes: 9 additions & 1 deletion vpn-transit-gateway/vpn-config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,18 @@ resource "null_resource" "generate_configs" {
}
}

resource "local_sensitive_file" "vpn_details" {
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))
filename = format("${path.root}/%v/%v.vpn_details.json", null_resource.directory_setup.triggers.name, 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))
filename = format("${path.root}/%v/%v.vpn_details.yml", null_resource.directory_setup.triggers.name, each.key)
file_permission = "0644"
}

0 comments on commit 19b8696

Please sign in to comment.