Repository navigation
Add CI that replicates the platform network and tests the application - #5
Merged
Merged
Conversation
Run the Terraform workflow without an AWS account: deploy the platform VPC into a second LocalStack account, replicate the VPC and subnets with the Replicator HTTP API, deploy the application and test it. Pin the ECS and API Gateway modules, whose latest versions need AWS provider v6 and broke terraform init. Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
The Replicator HTTP API created the VPC in the source account when target_aws_config was omitted, which failed with InvalidVpc.DuplicateCustomId. Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
With networkMode awsvpc, ECS requires the host and container ports to match, and RegisterTaskDefinition rejected hostPort 80 with containerPort 3000. Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
The template called $input.json() without a path, which is not a valid call and made
the REST API return 500 on LocalStack, and it put unencoded JSON in the form body.
Use $util.urlEncode($input.json('$')).
Claude-Session: https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The repo had no CI, and a fresh
terraform initinterraform/applicationfailed: the ECS and API Gateway v2 modules were unpinned, and their latest versions need AWS provider v6 while the provider is pinned to 5.60.0.The README workflow needs a real AWS account for the platform. CI runs the same steps with a second LocalStack account (
111111111111) standing in for it:make deploy-platform-localdeploys the platform VPC into account111111111111.make deploy-applicationfails, as the README describes, because the VPC and subnets are not in account000000000000. CI checks that it fails on the missing network.make replicate-localreplicates the VPC and the 3 private subnets into account000000000000. It uses the Replicator HTTP API, whosesource_aws_config.endpoint_urlpoints at LocalStack. It setstarget_aws_configexplicitly: without it, the job tried to create the VPC in the source account and failed withInvalidVpc.DuplicateCustomId.make deploy-applicationsucceeds.make testchecks:my-queueSQS queueSample fixes:
terraform-aws-modules/ecs/awsto~> 5.12andapigateway-v2to~> 5.3, and allow AWS provider~> 5.60in the application.networkMode = awsvpc, ECS requires them to match, andRegisterTaskDefinitionrejected it. The host port is now the container port.$input.json()without a path, which made LocalStack return 500, and put unencoded JSON into the form body. It now sendsMessageBody=$util.urlEncode($input.json('$')).make deploy-applicationnow runslstk tf init, selects or creates thelocalworkspace, and deploys withlstk tf. Before, it ranterraform applywith no init and aTF_WORKSPACEthat did not exist yet.make -f cdk/Makefile <target>, not fromcdk/.Not covered: replication from a real AWS account (
localstack replicator startwith AWS credentials) and the CDK variant. CI verifies the Terraform variant only.https://claude.ai/code/session_01DZfDmzUBPqNAu3yFKyfCNM