Skip to content

Commit

Permalink
Merge pull request #30 from DNXLabs/feature/client-connection-options
Browse files Browse the repository at this point in the history
Added options for managing connection authorization for new client connections
  • Loading branch information
alexandrealvao authored Mar 6, 2024
2 parents ab1ab16 + 7d995f5 commit c67482f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ The following resources will be created:
| authentication\_saml\_provider\_arn | (Optional) The ARN of the IAM SAML identity provider if type is federated-authentication. | `any` | `null` | no |
| authentication\_type | The type of client authentication to be used. Specify certificate-authentication to use certificate-based authentication, directory-service-authentication to use Active Directory authentication, or federated-authentication to use Federated Authentication via SAML 2.0. | `string` | `"certificate-authentication"` | no |
| cidr | Network CIDR to use for clients | `any` | n/a | yes |
| client\_connect\_options | Indicates whether client connect options are enabled | `bool` | `false` | no |
| connection\_authorization\_lambda\_function\_arn | The Amazon Resource Name (ARN) of the Lambda function used for connection authorization. | `any` | `null` | no |
| dns\_servers | List of DNS Servers | `list(string)` | `[]` | no |
| enable\_self\_service\_portal | Specify whether to enable the self-service portal for the Client VPN endpoint | `bool` | `false` | no |
| logs\_retention | Retention in days for CloudWatch Log Group | `number` | `365` | no |
Expand Down
11 changes: 11 additions & 0 deletions _variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,14 @@ variable "enable_self_service_portal" {
default = false
description = "Specify whether to enable the self-service portal for the Client VPN endpoint"
}

variable "client_connect_options" {
type = bool
default = false
description = "Indicates whether client connect options are enabled"
}

variable "connection_authorization_lambda_function_arn" {
default = null
description = "The Amazon Resource Name (ARN) of the Lambda function used for connection authorization."
}
5 changes: 5 additions & 0 deletions vpn-endpoint.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ resource "aws_ec2_client_vpn_endpoint" "default" {
cloudwatch_log_stream = aws_cloudwatch_log_stream.vpn.name
}

client_connect_options {
enabled = var.client_connect_options
lambda_function_arn = var.client_connect_options != true ? null : var.connection_authorization_lambda_function_arn
}

tags = merge(
var.tags,
tomap({
Expand Down

0 comments on commit c67482f

Please sign in to comment.