You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When using SQS VPC endpoints there is a feature that means that the SQS client has to be initialised with the correct endpoint as described at boto/boto3#1900, boto/boto3#2172 and others as otherwise it attempts to connect to endpoint URL 'https:<region>.queue.amazonaws.com' which fails rather than the VPC endpoint at https://sqs.\<region>.amazonaws.com
To Reproduce
Create an AWS VPC
Create a private subnet in VPC
Create a SQS endpoint in VPC
Create a SQS queue
Run redoer in an EC2 within private subnet and watch it fail connecting to SQS queue
Additional context
The solution is that the correct endpoint domain is already in the SQS queue URL and works whether VPC endpoints are being used or not. So:
self.sqs = boto3.client("sqs")
becomes
import re
...
PATTERN = "^([^/^:]+)/"
...
pat = re.compile(PATTERN)
m = pat.match(URL)
if m is None:
ERROR
self.client = boto3.client(
'sqs',
endpoint = m.group(1)
)
The text was updated successfully, but these errors were encountered:
@dev-eng1 You pull request has been merged in and I've also massaged your code a little. If you are satisfied with the change, go ahead and close this issue. If there's something we've missed, please let us know.
Describe the bug
When using SQS VPC endpoints there is a feature that means that the SQS client has to be initialised with the correct endpoint as described at boto/boto3#1900, boto/boto3#2172 and others as otherwise it attempts to connect to endpoint URL 'https:<region>.queue.amazonaws.com' which fails rather than the VPC endpoint at https://sqs.\<region>.amazonaws.com
To Reproduce
Create an AWS VPC
Create a private subnet in VPC
Create a SQS endpoint in VPC
Create a SQS queue
Run redoer in an EC2 within private subnet and watch it fail connecting to SQS queue
Additional context
The solution is that the correct endpoint domain is already in the SQS queue URL and works whether VPC endpoints are being used or not. So:
self.sqs = boto3.client("sqs")
becomes
import re
...
PATTERN = "^([^/^:]+)/"
...
pat = re.compile(PATTERN)
m = pat.match(URL)
if m is None:
ERROR
self.client = boto3.client(
'sqs',
endpoint = m.group(1)
)
The text was updated successfully, but these errors were encountered: