-
Notifications
You must be signed in to change notification settings - Fork 1
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
Update localstack domain #120
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4d69f16
use static domain that allows microservices to talk to the localstack…
solomon-negusse 9a6e564
update documentation
solomon-negusse 3bd52a4
use localstack image version with fix for requests not being forward …
solomon-negusse 64ae7e4
update deprecated gateway endpoint
solomon-negusse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
# Using localstack | ||
|
||
1 - Run localstack locally | ||
In local development, we use localstack to emulate API Gateway functionality of routing requests across the various microservices (by matching request path pattern). To get localstack running and provision it with the API Gateway resources: | ||
|
||
1 - Run localstack locally. | ||
|
||
```bash | ||
docker run --rm -it -p 4566:4566 -p 4571:4571 localstack/localstack | ||
docker run --rm -it -p 4566:4566 localstack/localstack | ||
``` | ||
|
||
2 - Terraform apply the content of this folder | ||
|
||
3 - Start microservices with the following GATEWAY_URL: | ||
|
||
2 - Terraform apply the content of this folder and confirm the changes in the prompt (use terraform version `v1.3.6`). This will output an `access_url` of the form `http://host.docker.internal:4566/restapis/{gateway_id}/prod/_user_request_`. If you choose to use a different port in Step 1, update the access_url variable in outputs.tf to reflect the chosen port.. | ||
```bash | ||
terraform apply | ||
``` | ||
https://<api gateway id>.execute-api.localhost.localstack.cloud:4566/prod | ||
``` | ||
|
||
3 - In the microservice repo, set `GATEWAY_URL` variable where it's defined (in `docker-compose-develop` or `dev.env` file) to the `access_url` value from above step and you're all set - requests can now be routed across microservices via the Gateway. Note that as the microservice ports are hardcoded (see `../terraform-k8s-infrastructure/modules/k8s_microservice_routing/microservices/dataset`, for example), need to make sure the local dev container ports match those defined in terraform. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 did get this access url. But the logs give me this warning:
Should we use that path instead?
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.
Done. Hit this issue: localstack/localstack#10461 using that endpoint though as the
localstack/localstack
image we use doesn't have the fix so pinning to a later image version (localstack/localstack:4.0.3
) with the fix.