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

TERRA-95 ⁃ Terraform astra_private_link and astra_private_link_endpoint failing #197

Open
atrilok opened this issue Jan 4, 2023 · 3 comments

Comments

@atrilok
Copy link

atrilok commented Jan 4, 2023

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

@sync-by-unito sync-by-unito bot changed the title Terraform astra_private_link and astra_private_link_endpoint failing TERRA-95 ⁃ Terraform astra_private_link and astra_private_link_endpoint failing Jan 4, 2023
@oscar-b
Copy link

oscar-b commented Jan 5, 2023

I'm seeing similar issues with GCP:

resource "astra_private_link" "main" {
  allowed_principals = [var.project_id]
  database_id        = astra_database.main.id
  datacenter_id      = local.datacenter_id
}
Error: json: cannot unmarshal string into Go value of type astra.Errors
│
│   with module.infrastructure.module.astra-db.astra_private_link.main,
│   on ../../../../modules/astra-db/network.tf line 1, in resource "astra_private_link" "main":
│    1: resource "astra_private_link" "main" {

@phact
Copy link
Contributor

phact commented Jan 6, 2023

@oscar-b although they are both related to private link these look like different issues to me, may be worth opening your own issue and providing more details there.

@oscar-b
Copy link

oscar-b commented Jan 6, 2023

@phact #198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants