cloudposse/terraform-aws-ec2-client-vpn

Endpoint does not exist

Closed this issue · 5 comments

Describe the Bug

After running the module there is an output which states the endpoint does not exists even though it does.
I have tried version 13 and 14 and seem to get the same result. Is this a known issue? It seems like a down steam issue.

Expected Behavior

For the endpoint to be found.

Steps to Reproduce

Steps to reproduce the behavior:
Run the module
Wait for it to finish (kind of)

│ Error: InvalidClientVpnEndpointId.NotFound: Endpoint cvpn-endpoint-1231123123 does not exist │ status code: 400, request id: 123123-123123-1231-123 │ │ with module.client_vpn.data.awsutils_ec2_client_vpn_export_client_config.default[0], │ on .terraform/modules/client_vpn/main.tf line 263, in data "awsutils_ec2_client_vpn_export_client_config" "default": │ 263: data "awsutils_ec2_client_vpn_export_client_config" "default" { │

Hey @joshuabalduff, did you find a solution to this? I am facing the same problem.

Hey @guga-kudos I use Terragrunt so it might be different for you, but I had to add the awutil provider with the correct region. For some reason it kept pulling from us-east-1 and not us-east-2 in my case.

provider "awsutils" {
  source  = "cloudposse/awsutils"
  version = ">= 0.8.0"
  region  = "us-east-2"
}

This worked! Thanks 🧡

In Raw Terraform code if anyone needs in the future.

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.61.0"
    }
    awsutils = {
      source  = "cloudposse/awsutils"
      version = ">= 0.8.0"
    }
  }
}

provider "aws" {
  region = local.aws.region
}

provider "awsutils" {
  region  = local.aws.region
}

Same behaviour is observed when profile is missing from the awsutils provider.

Same behavior and resolved by setting the credentials:

provider "awsutils" {
  region = var.region
  access_key = var.access_key
  secret_key = var.secret_key
}