Skip to content

Commit

Permalink
Updating security group attachment location due to deprecation (#53)
Browse files Browse the repository at this point in the history
* Updating security group attachment location due to deprecation

* Auto Format

* Adding vpc_id as it's required for the security_group_ids argument

Co-authored-by: Ben Gray <[email protected]>
Co-authored-by: cloudpossebot <[email protected]>
  • Loading branch information
3 people authored Sep 22, 2022
1 parent 08b3b59 commit b48fc7a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply

[![README Footer][readme_footer_img]][readme_footer_link]
[![Beacon][beacon]][website]

<!-- markdownlint-disable -->
[logo]: https://cloudposse.com/logo-300x69.svg
[docs]: https://cpco.io/docs?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-client-vpn&utm_content=docs
[website]: https://cpco.io/homepage?utm_source=github&utm_medium=readme&utm_campaign=cloudposse/terraform-aws-ec2-client-vpn&utm_content=website
Expand Down Expand Up @@ -491,3 +491,4 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
[share_googleplus]: https://plus.google.com/share?url=https://github.com/cloudposse/terraform-aws-ec2-client-vpn
[share_email]: mailto:?subject=terraform-aws-ec2-client-vpn&body=https://github.com/cloudposse/terraform-aws-ec2-client-vpn
[beacon]: https://ga-beacon.cloudposse.com/UA-76589703-4/cloudposse/terraform-aws-ec2-client-vpn?pixel&cs=github&cm=readme&an=terraform-aws-ec2-client-vpn
<!-- markdownlint-restore -->
11 changes: 6 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@ resource "aws_ec2_client_vpn_endpoint" "default" {
module.self_signed_cert_server,
module.self_signed_cert_root,
]

security_group_ids = compact(concat(
[module.vpn_security_group.id],
local.associated_security_group_ids
))
vpc_id = var.vpc_id
}

module "vpn_security_group" {
Expand Down Expand Up @@ -224,11 +230,6 @@ resource "aws_ec2_client_vpn_network_association" "default" {

client_vpn_endpoint_id = join("", aws_ec2_client_vpn_endpoint.default.*.id)
subnet_id = var.associated_subnets[count.index]

security_groups = compact(concat(
[module.vpn_security_group.id],
local.associated_security_group_ids
))
}

resource "aws_ec2_client_vpn_authorization_rule" "default" {
Expand Down

0 comments on commit b48fc7a

Please sign in to comment.