Skip to content

TERRA-95 ⁃ Terraform astra_private_link and astra_private_link_endpoint failing #197

Open
@atrilok

Description

@atrilok

Terraform Version

Terraform v1.2.8

Affected Resource(s)

  • astra_private_link
  • astra_private_link_endpoint

Terraform Configuration Files

Link to terraform scripts as a zipped file: 
https://drive.google.com/drive/folders/1VNbs8DCGkP6-3HbzmZw4wOa8rGDtdswF?usp=sharing

Expected Behavior

The resource 'astra_private_link' should create a private link successfully on the console. In addition, the link 'astra_private_link_endpoint' should create the endpoint successfully on Astra.

The corresponding private link endpoint on AWS was created successfully:
Screen Shot 2023-01-04 at 1 42 30 PM

Actual Behavior

The resource 'astra_private_link_endpoint' is throwing the following error:

│ Error: creating EC2 VPC Endpoint (com.amazonaws.vpce.us-east-1.vpce-svc-0228650ceacbd2889): InvalidServiceName: The Vpc Endpoint Service 'com.amazonaws.vpce.us-east-1.vpce-svc-0228650ceacbd2889' does not exist
│ 	status code: 400, request id: 79704ad5-52b8-4b33-bcc6-9879b68b5c6d
│ 
│   with aws_vpc_endpoint.online_shopping_vpc_endpoint,
│   on main.tf line 63, in resource "aws_vpc_endpoint" "online_shopping_vpc_endpoint":
│   63: resource "aws_vpc_endpoint" "online_shopping_vpc_endpoint" {

Steps to Reproduce

  1. Create a VPC in AWS using UI
  2. Create an endpoint in AWS using UI
  3. Run the terraform resources related to 'astra_private_link' and 'astra_private_link_endpoint'
  4. Notice the error described above on the tf side despite having a VPC and an endpoint in AWS

Important Factoids

This is the code I am running for your reference:

#Creation of a private link on Astra DB
resource "astra_private_link" "online_shopping_privatelink" {
  allowed_principals = ["arn:aws:iam::111708290731:role/aditya.trilok"]
  database_id        = "016114a8-431f-47db-95e1-14c0e2180c52"
  datacenter_id      = "016114a8-431f-47db-95e1-14c0e2180c52-1"
}

#Create a VPC endpoint on AWS
resource "aws_vpc_endpoint" "online_shopping_vpc_endpoint" {
  vpc_id             = "vpc-0ed0543943cdaa4a4"
  service_name       = astra_private_link.online_shopping_privatelink.service_name
  vpc_endpoint_type  = "Interface"
  subnet_ids         = ["subnet-0538fcea9f74c9bc9","subnet-0cd081c0072226c9b"]
  security_group_ids = ["sg-09e3a526e286ce753"]
}

┆Issue is synchronized with this Jira Task by Unito
┆Issue Number: TERRA-95
┆Priority: Major

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions