Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client VPN Endpoint - Add Federated Authentication #13401

Closed
connor-tyndall opened this issue May 19, 2020 · 17 comments · Fixed by #14171
Closed

Client VPN Endpoint - Add Federated Authentication #13401

connor-tyndall opened this issue May 19, 2020 · 17 comments · Fixed by #14171
Assignees
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service.
Milestone

Comments

@connor-tyndall
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

This request asks for the ability to add federated authentication (authN) as an authentication option for a Client VPN (CVPN) endpoint.

Based on the release by AWS today (5/19/20), federated authN is now supported by AWS CVPN. Until now, CVPN only supported AD and Mutual authN.

New or Affected Resource(s)

  • aws_ec2_client_vpn_endpoint:

      - authentication_options
    

Potential Terraform Configuration

resource "aws_ec2_client_vpn_endpoint" "example" {
  description            = "terraform-clientvpn-example"
  server_certificate_arn = "${aws_acm_certificate.cert.arn}"
  client_cidr_block      = "10.0.0.0/16"

  authentication_options {
    type                       = "federated-authentication"
    saml_provider_arn          = "${aws_iam_saml_provider.okta.arn}"
  }

  connection_log_options {
    enabled               = true
    cloudwatch_log_group  = "${aws_cloudwatch_log_group.lg.name}"
    cloudwatch_log_stream = "${aws_cloudwatch_log_stream.ls.name}"
  }
}

References

@connor-tyndall connor-tyndall added the enhancement Requests to existing resources that expand the functionality or scope. label May 19, 2020
@ghost ghost added the service/ec2 Issues and PRs that pertain to the ec2 service. label May 19, 2020
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label May 19, 2020
@ewbankkit
Copy link
Contributor

@bflad bflad removed the needs-triage Waiting for first response or review from a maintainer. label May 21, 2020
@muhammaddadu
Copy link

I'm getting the issue

An argument named "saml_provider_arn" is not expected here.

@lanejlanej
Copy link

Hi,
Do you have any idea of when this enhancement is likely to make it to a release? Adding clientvpn with federated auth is a requirement for a project I am working on.

@steverukuts
Copy link

steverukuts commented Jun 29, 2020

@lanejlanej It seems to be in CloudFormation, specifically the AWS::EC2::ClientVpnEndpoint ClientAuthenticationRequest
structure, so you could possibly use an aws_cloudformation_stack to create the resource.

If that works then when this is implemented you can import the resources into your state without affecting anything.

Note I've never done the above but I hope that's helpful to get you started on a workaround.

@lanejlanej
Copy link

Hi Steve,
Thanks for the quick response. That sounds like a good workaround, and I'll give it a go.

@divyaraghavann
Copy link

Hi any idea on the ETA for this? Need it for a project I'm working on right now.

@jgeurts
Copy link
Contributor

jgeurts commented Aug 6, 2020

Terraform has unfortunately been MIA regarding the pull requests... I addressed comments for the original PR over 3 weeks ago and not a peep from terraform.

@divyaraghavann
Copy link

Terraform has unfortunately been MIA regarding the pull requests... I addressed comments for the original PR over 3 weeks ago and not a peep from terraform.

That's a bummer. I assumed Terraform was super responsive wrt adding support for new functionality. :(

@jgeurts
Copy link
Contributor

jgeurts commented Aug 19, 2020

@maryelizbeth @bflad @gdavison @anGie44 @breathingdust @ksatirli can someone please tell me what needs to be done to get #14171 merged? That PR appears to address the concerns of related to this issue. That PR has been open for over a month without seemingly even a glance from any maintainers of this project... I would love to hear something, anything from Hashicorp for how to get attention to community provided PRs.

@bflad
Copy link
Contributor

bflad commented Aug 19, 2020

Hi @jgeurts 👋 Information about our review process can be found in the FAQ. While the pull request is lacking the 👍 reactions to bubble to the top of that priority list, this issue does, so I have added this to our community priorities and it will likely get attention in the next two weeks or so.

@jgeurts
Copy link
Contributor

jgeurts commented Aug 19, 2020

That's great, thank you!

@connor-tyndall
Copy link
Contributor Author

In the meantime, I've been able to use local values to define the aws_cloudformation_stack template_body. If need be, you can pass in multiple resource definitions into local.stack and use the merge function to create a single CloudFormation stack.

################
# Locals
################
locals {
 stack = {
    Resources = merge(local.endpoint)
    Outputs = {
      "clientVpnId" = {
        Description = "Client VPN ID",
        Value = {
          Ref = "endpoint${replace(var.vpc_id, "-", "")}"
        }
      }
    }
  }

  endpoint = {
    "endpoint${replace(var.vpc_id, "-", "")}" = {
      Type = "AWS::EC2::ClientVpnEndpoint"
      Properties = {
        AuthenticationOptions = [
          {
            Type = "federated-authentication"
            FederatedAuthentication = {
              SAMLProviderArn = var.saml_provider_arn
            }
          }
        ]
        ClientCidrBlock = var.clientCidr
        ConnectionLogOptions = {
          Enabled            = var.endpoint_logging
          CloudwatchLogGroup = aws_cloudwatch_log_group.client_vpn.name
        }
        Description          = "Client VPN Endpoint via Federated AuthN"
        ServerCertificateArn = aws_acm_certificate.server.arn
        TransportProtocol    = var.transport_protocol
        SplitTunnel          = var.split_tunnel
        SecurityGroupIds = [
          aws_security_group.cvpn_sg.id
        ]
        VpcId = var.vpc_id
      }
    }
  }

################
# CloudFormation
################
resource "aws_cloudformation_stack" "client_vpn" {
  name          = "client-vpn"
  template_body = jsonencode(local.stack)
}
     

@nikolay
Copy link

nikolay commented Aug 21, 2020

It's kind of funny that we need to use CloudFormation for this - it used to be when Terraform implemented features first, now it's CloudFormation and Terraforms lags behind and features are sorted out by 👍s.

@musha68k
Copy link

musha68k commented Aug 26, 2020

As per @bflad's comment above could everyone in here please upvote @jgeurts's MR #14171 so we really make sure it bubbles up in the priority merge list? Thank you.

@bflad bflad self-assigned this Aug 28, 2020
@bflad bflad added this to the v3.5.0 milestone Sep 1, 2020
@bflad
Copy link
Contributor

bflad commented Sep 1, 2020

Support for this functionality has been merged and will release with version 3.5.0 of the Terraform AWS Provider, likely on Thursday. Thanks to @jrayhawk and @jgeurts for the implementation. 👍

@ghost
Copy link

ghost commented Sep 3, 2020

This has been released in version 3.5.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Oct 1, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Oct 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants