Skip to content

Commit

Permalink
Update for AWS provider v5
Browse files Browse the repository at this point in the history
  • Loading branch information
sdickenson committed Jun 6, 2024
1 parent 6125613 commit bb4b7cb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
6 changes: 2 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ resource "aws_ec2_client_vpn_endpoint" "this" {
description = "Client VPN"
client_cidr_block = var.client_cidr_block
dns_servers = var.dns_servers
security_group_ids = concat([aws_security_group.this.id], var.additional_security_groups)
server_certificate_arn = var.server_certificate_arn
split_tunnel = var.split_tunnel_enabled
vpc_id = var.vpc_id
tags = local.tags

authentication_options {
Expand Down Expand Up @@ -67,10 +69,6 @@ resource "aws_ec2_client_vpn_network_association" "this" {
client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.this.id
subnet_id = each.key

security_groups = concat(
[aws_security_group.this.id],
var.additional_security_groups
)
}

resource "aws_ec2_client_vpn_authorization_rule" "rules" {
Expand Down
7 changes: 1 addition & 6 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,5 @@ output "vpn_dns_name" {

output "vpn_endpoint_security_groups" {
description = "VPN endpoint security groups"

value = distinct(
flatten(
[for association in aws_ec2_client_vpn_network_association.this : association.security_groups]
)
)
value = aws_ec2_client_vpn_endpoint.this.security_group_ids
}
2 changes: 1 addition & 1 deletion versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.5"
version = "~> 5.27"
}
}
}

0 comments on commit bb4b7cb

Please sign in to comment.