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

Localstack using CDKlocal sends requests to wrong url for DynamoDB #10803

Open
1 task done
Prakhar-FF13 opened this issue May 12, 2024 · 2 comments
Open
1 task done
Labels
area: integration/cdk Issues related to AWS Cloud Development Kit aws:apigateway Amazon API Gateway aws:dynamodb Amazon DynamoDB aws:lambda AWS Lambda status: backlog Triaged but not yet being worked on type: bug Bug report

Comments

@Prakhar-FF13
Copy link

Prakhar-FF13 commented May 12, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have a cdk app with api gateway, lambda and dynamodb. This is from the the course - https://frontendmasters.com/courses/go-aws/

Link to code repo - https://github.com/Melkeydev/FrontEndMasters/tree/chapter_3/cdkExample

I am using local stack and followed every instruction.

After deploying when I send the request to gateway/register I get below error for some reason cdklocak is sending request amazon's dynamoDB

{"errorMessage":"RequestError: send request failed\ncaused by: Post "https://dynamodb.ap-south-1.amazonaws.com/\": tls: failed to verify certificate: x509: certificate is valid for *.amplifyapp.localhost.localstack.cloud, *.cloudfront.localhost.localstack.cloud, *.dkr.ecr.eu-central-1.localhost.localstack.cloud, *.dkr.ecr.eu-west-1.localhost.localstack.cloud, *.dkr.ecr.us-east-1.localhost.localstack.cloud, *.dkr.ecr.us-east-2.localhost.localstack.cloud, *.dkr.ecr.us-west-1.localhost.localstack.cloud, *.dkr.ecr.us-west-2.localhost.localstack.cloud, *.elb.localhost.localstack.cloud, *.eu-central-1.opensearch.localhost.localstack.cloud, *.eu-west-1.opensearch.localhost.localstack.cloud, *.execute-api.localhost.localstack.cloud, *.lambda-url.eu-central-1.localhost.localstack.cloud, *.lambda-url.eu-west-1.localhost.localstack.cloud, *.lambda-url.us-east-1.localhost.localstack.cloud, *.lambda-url.us-east-2.localhost.localstack.cloud, *.lambda-url.us-west-1.localhost.localstack.cloud, *.lambda-url.us-west-2.localhost.localstack.cloud, *.localhost.localstack.cloud, *.opensearch.localhost.localstack.cloud, *.s3-website.localhost.localstack.cloud, *.s3.localhost.localstack.cloud, *.scm.localhost.localstack.cloud, *.snowflake.localhost.localstack.cloud, *.us-east-1.opensearch.localhost.localstack.cloud, *.us-east-2.opensearch.localhost.localstack.cloud, *.us-west-1.opensearch.localhost.localstack.cloud, *.us-west-2.opensearch.localhost.localstack.cloud, localhost.localstack.cloud, sqs.eu-central-1.localhost.localstack.cloud, sqs.eu-west-1.localhost.localstack.cloud, sqs.us-east-1.localhost.localstack.cloud, sqs.us-east-2.localhost.localstack.cloud, sqs.us-west-1.localhost.localstack.cloud, sqs.us-west-2.localhost.localstack.cloud, not dynamodb.ap-south-1.amazonaws.com","errorType":"baseError"}

Expected Behavior

Data should be inserted in DynamoDB

Steps To Reproduce

How are you starting localstack

localstack start

Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

  1. pull the repo https://github.com/Melkeydev/FrontEndMasters/tree/chapter_3/cdkExample
  2. cdklocal deploy
  3. send request to endpoint provided and /register

Environment

- OS: Latest Mac Version
- LocalStack: 3.4.0

Anything else?

No response

@Prakhar-FF13 Prakhar-FF13 added status: triage needed Requires evaluation by maintainers type: bug Bug report labels May 12, 2024
@localstack-bot
Copy link
Collaborator

Welcome to LocalStack! Thanks for reporting your first issue and our team will be working towards fixing the issue for you or reach out for more background information. We recommend joining our Slack Community for real-time help and drop a message to LocalStack Pro Support if you are a Pro user! If you are willing to contribute towards fixing this issue, please have a look at our contributing guidelines and our contributing guide.

@Anze1508 Anze1508 added area: integration/cdk Issues related to AWS Cloud Development Kit aws:apigateway Amazon API Gateway aws:lambda AWS Lambda aws:dynamodb Amazon DynamoDB status: backlog Triaged but not yet being worked on and removed status: triage needed Requires evaluation by maintainers labels May 14, 2024
@dfangl
Copy link
Member

dfangl commented May 21, 2024

Hi @Prakhar-FF13 !
Thank you for your report. This issue is already known - the transparent endpoint injection redirects requests to AWS to LocalStack - however the logic to disable certificate validation for those requests does currently not work with go lambdas.

Support for go lambdas is on our roadmap, however I am currently unable to provide an ETA for it.

Until then, please try to manually set your endpoint in your AWS SDK client creation as explained in our documentation regarding the go AWS SDK: https://docs.localstack.cloud/user-guide/integrations/sdks/go/ .

We are always trying to improve user experience and remove the need for special configuration like this, but sadly for now it is necessary when using go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: integration/cdk Issues related to AWS Cloud Development Kit aws:apigateway Amazon API Gateway aws:dynamodb Amazon DynamoDB aws:lambda AWS Lambda status: backlog Triaged but not yet being worked on type: bug Bug report
Projects
None yet
Development

No branches or pull requests

4 participants