{"id":48540115,"url":"https://github.com/localstack-samples/replicator-infrastructure","last_synced_at":"2026-04-08T04:01:43.229Z","repository":{"id":345113044,"uuid":"889213259","full_name":"localstack-samples/replicator-infrastructure","owner":"localstack-samples","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-17T18:04:59.000Z","size":107,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":11,"default_branch":"main","last_synced_at":"2026-03-18T07:40:37.281Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/localstack-samples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-15T20:41:41.000Z","updated_at":"2025-06-18T12:37:36.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/localstack-samples/replicator-infrastructure","commit_stats":null,"previous_names":["localstack-samples/replicator-infrastructure"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/localstack-samples/replicator-infrastructure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack-samples%2Freplicator-infrastructure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack-samples%2Freplicator-infrastructure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack-samples%2Freplicator-infrastructure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack-samples%2Freplicator-infrastructure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/localstack-samples","download_url":"https://codeload.github.com/localstack-samples/replicator-infrastructure/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/localstack-samples%2Freplicator-infrastructure/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31539229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"online","status_checked_at":"2026-04-08T02:00:06.127Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-08T04:01:41.067Z","updated_at":"2026-04-08T04:01:43.215Z","avatar_url":"https://github.com/localstack-samples.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AWS Replicator Infrastructure Demo\n\n| Key | Value |\n| --- | --- |\n| Environment | LocalStack and AWS |\n| Services | VPC, Subnet, ALB, ECS Fargate, API Gateway, ECR, SQS |\n| Integrations | Terraform and AWS CDK |\n| Categories | AWS Replication | \n| Level | Beginner |\n| GitHub | https://github.com/localstack-samples/replicator-infrastructure |\n\n## Introduction\n\nThis repository demonstrates an infrastructure migration workflow where a platform VPC is created in AWS, then selected resources are replicated into LocalStack so an application stack can be deployed locally with the same VPC/Subnet IDs.\n\nThe sample includes two variants:\n\n- `terraform/`: platform and application stacks with Terraform\n- `cdk/`: platform and application stacks with AWS CDK\n\nThis sample application uses LocalStack's [AWS Replicator](https://docs.localstack.cloud/aws/tooling/aws-replicator/) feature.\n\n## Prerequisites\n\n- A valid [LocalStack for AWS license](https://localstack.cloud/pricing), which provides a [`LOCALSTACK_AUTH_TOKEN`](https://docs.localstack.cloud/getting-started/auth-token/).\n- LocalStack CLI v4.2.0 or higher.\n- `awslocal` (`awscli-local`).\n- Terraform CLI.\n- Docker.\n- Two configured AWS profiles:\n  - one for LocalStack access (default: `localstack` for Terraform and `local` in `cdk/Makefile`)\n  - one for AWS deployment (default: `ls-sandbox`)\n\nTo start LocalStack, run the following:\n\n```bash\nexport LOCALSTACK_AUTH_TOKEN=\u003cyour-auth-token\u003e\nmake start\n```\n\n## Terraform Workflow\n\nRun commands from `terraform/`.\n\n1. Deploy the platform infrastructure to AWS:\n\n```bash\nmake deploy-platform-aws\n```\n\n2. Attempt to deploy the application to LocalStack:\n\n```bash\nmake deploy-application\n```\n\n3. The first deploy is expected to fail with output like:\n\n```text\n│ Error: creating ELBv2 application Load Balancer (ecs-application): operation error Elastic Load Balancing v2: CreateLoadBalancer, https response error StatusCode: 400, RequestID: aa6de73e-90a4-4a8a-84f4-3714a21a2fdb, api error InvalidSubnetID.NotFound: The subnet ID '\u003csubnet-id\u003e' does not exist\n│\n│   with module.alb.aws_lb.this[0],\n│   on .terraform/modules/alb/main.tf line 12, in resource \"aws_lb\" \"this\":\n│   12: resource \"aws_lb\" \"this\" {\n│\n╵\n╷\n│ Error: creating ELBv2 Target Group (tf-20250310185220542800000003): operation error Elastic Load Balancing v2: CreateTargetGroup, https response error StatusCode: 400, RequestID: 7d545ebb-b230-4530-8d85-be79fcc7b1c2, api error ValidationError: The VPC ID '\u003cvpc-id\u003e' is not found\n│\n│   with module.alb.aws_lb_target_group.this[\"ex_ecs\"],\n│   on .terraform/modules/alb/main.tf line 487, in resource \"aws_lb_target_group\" \"this\":\n│  487: resource \"aws_lb_target_group\" \"this\" {\n```\n\n4. Replicate the missing VPC and subnet IDs reported in the error:\n\n```bash\nAWS_PROFILE=ls-sandbox localstack replicator start --resource-identifier \u003cvpc-id\u003e --resource-type AWS::EC2::VPC\nAWS_PROFILE=ls-sandbox localstack replicator start --resource-identifier \u003csubnet-id\u003e --resource-type AWS::EC2::Subnet\n```\n\n5. Re-run the application deployment:\n\n```bash\nmake deploy-application\n```\n\n## CDK Workflow\n\nRun commands from `cdk/`.\n\n1. Deploy platform resources to AWS:\n\n```bash\nmake deploy-platform\n```\n\n2. Bootstrap CDK in LocalStack:\n\n```bash\nmake bootstrap\n```\n\n3. Replicate VPC and subnet resources from the platform stack:\n\n```bash\nmake replicate\n```\n\n4. Deploy the application stack to LocalStack:\n\n```bash\nmake deploy-application\n```\n\nThe `replicate_cdk.sh` script reads `PlatformStack` outputs, starts replicator jobs, and waits until replication is completed.\n\n## Cleanup\n\n### Terraform\n\n```bash\ncd terraform\nmake destroy-application\nmake destroy-platform-aws\n```\n\n### CDK\n\n```bash\ncd cdk\nmake destroy-application\nmake destroy-platform\n```\n\n## License\n\nLicensed under Apache License 2.0. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalstack-samples%2Freplicator-infrastructure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocalstack-samples%2Freplicator-infrastructure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocalstack-samples%2Freplicator-infrastructure/lists"}