-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fix: support aws-cdk>=2.177.0 #107
Conversation
// This _must_ use localhost.localstack.cloud as we require valid subdomains of these paths to | ||
// resolve. Unfortunately though `curl` seems to support subdomains of localhost, the CDK does not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So s3.localhost
didn't work for you with cdklocal but s3.localhost.localstack.cloud
did? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup unfortunately. I think it depends on the dns resolver and tool making the dns query, so sometimes it works and sometimes it doesn't depending on the tool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks for adding proper documentation around which aws-cdk version introduced the change that broke compatibility with cdklocal! I'm curious to hear more about your reasoning around using localhost.localstack.cloud
vs. localhost
but I think we can go ahead and release this to unblock cdklocal users 🚀
const configureEnvironment = () => { | ||
// This _must_ use localhost.localstack.cloud as we require valid subdomains of these paths to | ||
// resolve. Unfortunately though `curl` seems to support subdomains of localhost, the CDK does not. | ||
process.env.AWS_ENDPOINT_URL_S3 = process.env.AWS_ENDPOINT_URL_S3 || `${PROTOCOL}://s3.localhost.localstack.cloud:${EDGE_PORT}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to share, but by default, we are also using s3.localhost.localstack.cloud
for tflocal
Motivation
Addresses #106
The CDK team have recently made a change to not export some internal types of the
aws-cdk
package. We rely on these types to override the endpoint url to point to LocalStack. This therefore broke our integration with the CDK.Changes
aws-cdk>=2.177.0
is installed, and instead use theAWS_ENDPOINT_URL
andAWS_ENDPOINT_URL_S3
environment variables to configure the JavaScript SDKs