Skip to content

Custom endpoint for SQS (VPC Endpoint) does not work. #2114

@harihara-n

Description

@harihara-n

Issue description

In my account, I have a VPC Interface Endpoint for SQS and a lambda function in the same VPC. The lambda job (Ruby 2.5 runtime) tries to send an SQS message to an SQS queue that the lambda execution role has permissions to, by using the VPC Endpoint. For this, I do something like the following

sqs_client = Aws::SQS::Client.new(credentials: ####, endpoint: 'https://vpce-<id>.sqs.us-west-2.amazonaws.com')
sqs_client.send_message(queue_url: 'https://sqs.us-west-2.amazonaws.com/<account_id>/test-queue', message_body: 'test')

I notice that the lambda always times out at the send_message call.

I notice that I am able to make other calls like STS (for assume_role) and SNS (for publish), from the lambda using their respective VPC Endpoints for STS and SNS. The VPC Endpoints are all configured the same (security groups, etc.) using terraform code.

I also noticed that I am able to make the send_message call from an AWS SDK CLI, in an EC2 instance in the same VPC. So, the following does work.

aws sqs send-message --queue-url 'https://sqs.us-west-2.amazonaws.com/<account_id>/test-queue ' --endpoint-url 'https://vpce-<id>.sqs.us-west-2.vpce.amazonaws.com ' --message-body "this works"

This makes me believe that setting the custom endpoint for SQS is what is not working here.

Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version

aws-sdk-sqs 1.11.0

Version of Ruby, OS environment

Ruby 2.5 lambda runtime.
Amazon Linux (https://docs.aws.amazon.com/lambda/latest/dg/lambda-ruby.html)

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