mongodb / awscdk-resources-mongodbatlas

MongoDB Atlas AWS CDK Resources
Apache License 2.0
35 stars 17 forks source link

CfnPrivateEndpoint - Error creating vcp Endpoint: MissingEndpoint: 'Endpoint' configuration is required for this service" #109

Closed pahud closed 1 year ago

pahud commented 1 year ago

Describe the bug

When I create the private endpoint with CfnPrivateEndpoint, it returns the error

2:18:08 AM | CREATE_FAILED        | MongoDB::Atlas::PrivateEndpoint    | EndpointEEF1FD8F
Resource handler returned message: "Error creating vcp Endpoint: MissingEndpoint: 'Endpoint' configuration is required for this service" (RequestToken: 29ba9868-d806-8dd3-b458-caccedb2e7eb, HandlerErrorCode: G
eneralServiceException)

To Reproduce Steps to reproduce the behavior:

new CfnPrivateEndpoint(demoStack, 'Resource', {
  groupId: serverless.project.projectId,
  region: 'US_EAST_1',
  profile: secretProfile,
  privateEndpoints: [
    {
      vpcId: 'vpc-1f5b7e78',
      subnetIds: [
        'subnet-071c85610846aa9c0',
        'subnet-0ef7ac49e1edb06e4',
        'subnet-0e2177a10a166f87d',
      ],
    },
  ],
});

Expected behavior The private endpoint should be created.

Screenshots If applicable, add screenshots to help explain your problem.

image image

Looks like the Atlas Endpoint Service was created successfully but the cfn handler didn't create the awsvpc endpoint correctly but I am not sure.

--


Please complete the following information:

Additional context Add any other context about the problem here.

github-actions[bot] commented 1 year ago

Thanks for opening this issue. The ticket INTMDB-989 was created for internal tracking.

Adelmar92 commented 1 year ago

hello @pahud can you try with the region us-east-1 instead of US_EAST_1?

pahud commented 1 year ago

@Adelmar92 OK I will try again today and report back here.

pahud commented 1 year ago

@Adelmar92 us-east-1 works!

However, looking at the create cluster API, it's actually using US_EAST_1

image

I think we probably should make it consistent across different resources.

Thoughts?

ref: https://www.mongodb.com/docs/atlas/reference/amazon-aws/

pahud commented 1 year ago

https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Private-Endpoint-Services/operation/createPrivateEndpointService

image

And for create cluster API: https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Clusters/operation/createCluster

image

I think based on this doc, we should be specific whether this is a Atlas Region or AWS Region. Thoughts?

Adelmar92 commented 1 year ago

hi @pahud yes i agree with you! i will convert the regon to match the aws specifications. the problem is on the AWS private endpoint creation.

github-actions[bot] commented 1 year ago

This issue has gone 30 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 30 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!

Adelmar92 commented 1 year ago

@pahud we have already fixed this issue and it has been published, now the region is been internally converted to the value accepted by aws