{"id":13628265,"url":"https://github.com/turnerlabs/fargate-create","last_synced_at":"2025-04-06T00:10:44.616Z","repository":{"id":33526736,"uuid":"142599311","full_name":"turnerlabs/fargate-create","owner":"turnerlabs","description":"A CLI tool for scaffolding out new AWS ECS/Fargate applications based on Terraform templates and Fargate CLI","archived":false,"fork":false,"pushed_at":"2025-02-12T20:38:03.000Z","size":129,"stargazers_count":108,"open_issues_count":3,"forks_count":11,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-29T23:11:48.026Z","etag":null,"topics":["aws","cli","containers","fargate","terraform","tooling"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/turnerlabs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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}},"created_at":"2018-07-27T16:18:56.000Z","updated_at":"2025-02-12T20:35:42.000Z","dependencies_parsed_at":"2024-01-12T18:39:24.296Z","dependency_job_id":"a8f8b23e-27f2-4c21-b89c-349468e1017e","html_url":"https://github.com/turnerlabs/fargate-create","commit_stats":null,"previous_names":[],"tags_count":64,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turnerlabs%2Ffargate-create","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turnerlabs%2Ffargate-create/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turnerlabs%2Ffargate-create/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/turnerlabs%2Ffargate-create/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/turnerlabs","download_url":"https://codeload.github.com/turnerlabs/fargate-create/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415973,"owners_count":20935387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aws","cli","containers","fargate","terraform","tooling"],"created_at":"2024-08-01T22:00:49.320Z","updated_at":"2025-04-06T00:10:44.595Z","avatar_url":"https://github.com/turnerlabs.png","language":"Go","funding_links":[],"categories":["Uncategorized","AWS Fargate"],"sub_categories":["Uncategorized","Setting up Fargate"],"readme":"fargate-create\n==============\n\nA CLI tool for scaffolding out new [AWS ECS/Fargate](https://aws.amazon.com/fargate/) applications based on [terraform-ecs-fargate](https://github.com/turnerlabs/terraform-ecs-fargate) and [Fargate CLI](https://github.com/turnerlabs/fargate).\n\n\n### Why?\n\nThe main design goal of this project is to create an easy and maintainable Fargate experience by separating `infrastructure` related concerns and `application` related concerns using tools that are optimized for each.\n\n### Installation\n\nYou can install the CLI with a curl utility script (macos/linux) or by downloading the binary from the releases page. Once installed you'll get the `fargate-create` command.\n\n```\ncurl -s get-fargate-create.turnerlabs.io | sh\n````\n\n### Usage\n\nAssuming you have a project with a [Dockerfile]()...\n\nSpecify your template's input parameters in [terraform.tfvars](https://www.terraform.io/docs/configuration/variables.html) (or terraform.json).  The [default web application template's](https://github.com/turnerlabs/terraform-ecs-fargate) input looks something like this. Note: [any Terraform template can be used](#extensibility)\n\n```hcl\n# app/env to scaffold\napp = \"my-app\"\nenvironment = \"dev\"\n\ninternal = \"true\"\ncontainer_port = \"8080\"\nreplicas = \"1\"\nhealth_check = \"/health\"\nregion = \"us-east-1\"\naws_profile = \"default\"\nvpc = \"vpc-123\"\nprivate_subnets = \"subnet-123,subnet-456\"\npublic_subnets = \"subnet-789,subnet-012\"\ntags = {\n  application = \"my-app\"\n  environment = \"dev\"\n}\n```\n\n```shell\n$ fargate-create\nscaffolding my-app dev\nLooking up AWS Account ID using profile: default\ndownloading terraform template git@github.com:turnerlabs/terraform-ecs-fargate\ninstalling terraform template\n\ndone\n```\n\nNow you have all the files you need to spin up something in Fargate. Note that the Terraform files can be edited or customized. You can also use your own Terraform template using the `--template` flag.\n\nInfrastructure:  provision using Terraform\n```shell\ncd iac/base\nterraform init \u0026\u0026 terraform apply\ncd ../env/dev\nterraform init \u0026\u0026 terraform apply\n```\n\nApplication:  build/push using Docker and deploy using Fargate CLI\n```shell\ndocker-compose build\nlogin=$(aws ecr get-login --no-include-email) \u0026\u0026 eval \"$login\"\ndocker-compose push\nfargate service deploy -f docker-compose.yml\n```\n\nTo scaffold out additional environnments, simply change the `environment` input parameter in `terraform.tfvars` and re-run\n```shell\n$ fargate-create\nscaffolding my-app prod\nLooking up AWS Account ID using profile: default\ndownloading terraform template git@github.com:turnerlabs/terraform-ecs-fargate\ninstalling terraform template\niac/base already exists, ignoring\n\ndone\n```\n\nAnd then bring up the new environment (no need to apply base again since it's shared):\n```shell\ncd ../prod\nterraform init \u0026\u0026 terraform apply\n```\n\nYou'll end up with a directory structure that looks something like this:\n```\n.\n|____iac\n| |____base\n| |____env\n| | |____dev\n| | |____prod\n```\n\nAs changes are made to the various upstream templates over time, the `upgrade` command can be used to keep installed versions up to date.\n\n```bash\nfargate-create upgrade\n```\n\n\n### Stacks\n\nThe following stacks are popular configurations that can be used with `fargate-create`\n\n- [Web Application (ALB - HTTP or HTTPS)](https://github.com/turnerlabs/terraform-ecs-fargate#fargate-create)\n- [Web Application (ALB - HTTPS/DNS)](https://github.com/turnerlabs/terraform-ecs-fargate-dns-https#fargate-create)\n- [Web API Gateway](https://github.com/turnerlabs/terraform-ecs-fargate-apigateway#fargate-create)\n- [Scheduled Task](https://github.com/turnerlabs/terraform-ecs-fargate-scheduled-task#fargate-create)\n- [Background Worker (service)](https://github.com/turnerlabs/terraform-ecs-fargate-background-worker#fargate-create)\n- [Network Application (NLB)](https://github.com/turnerlabs/terraform-ecs-fargate-nlb#fargate-create)\n- [Airflow](https://github.com/turnerlabs/terraform-ecs-fargate-airflow#fargate-create)\n \n\n### Help\n\n```\nScaffold out new AWS ECS/Fargate applications based on Terraform templates and Fargate CLI\n\nUsage:\n  fargate-create [flags]\n  fargate-create [command]\n\nExamples:\n\n# Scaffold an environment using the latest default template\nfargate-create\n\n# Do not prompt for options\nfargate-create -y\n\n# Use a template stored in github\nfargate-create -t git@github.com:turnerlabs/terraform-ecs-fargate?ref=v0.4.3\n\n# Scaffold out files for various build systems\nfargate-create build circleciv2\n\n# keep your template up to date\nfargate-create upgrade\n\n# Use a template stored in s3\nAWS_ACCESS_KEY=xyz AWS_SECRET_KEY=xyz AWS_REGION=us-east-1 \\\n  fargate-create -t s3::https://s3.amazonaws.com/my-bucket/my-template\n\n# Use a template stored in your file system\nfargate-create -t ~/my-template\n\n# Use a specific input file\nfargate-create -f app.tfvars\n\n# Use a JSON input file\nfargate-create -f app.json\n\n\nAvailable Commands:\n  build       Scaffold out artifacts for various build systems\n  help        Help about any command\n  upgrade     Keep a terraform template up to date\n\nFlags:\n  -f, --file string         file specifying Terraform input variables, in either HCL or JSON format (default \"terraform.tfvars\")\n  -h, --help                help for fargate-create\n  -d, --target-dir string   target directory where code is outputted (default \"iac\")\n  -t, --template string     URL of a compatible Terraform template (default \"git@github.com:turnerlabs/terraform-ecs-fargate\")\n  -v, --verbose             Verbose output\n      --version             version for fargate-create\n  -y, --yes                 don't ask questions and use defaults\n```\n\n\n### CI/CD\n\nUsing this technique, it's easy to codegen CI/CD pipelines for many popular build tools.  The `build` command supports this.  \n\n```shell\n$ fargate-create build \u003cprovider\u003e\n```\n\nThe following providers are supported:\n\n- [circleciv2](https://circleci.com/)\n- [githubactions](https://github.com/features/actions)\n- [awscodebuild](https://aws.amazon.com/codebuild/)\n\n\n### Extensibility\n\n`fargate-create` can scaffold out any Terraform template (specified by `--template`) that meets the following requirements:\n\n- `base` and `env/dev` directory structure \n- a `env/dev/main.tf` with an s3 remote state backend\n- `app` and `environment` input variables\n\nYour template can be downloaded from a variety of locations using a variety of protocols.  The following are supported:\n\n- Local files (`~/my-template`)\n- Git (`git@github.com:my-org/my-template`)\n- Amazon S3 (`s3::https://s3.amazonaws.com/my-bucket/my-template`)\n- HTTP (`http://server/my-template/`)\n\nOptionally:\n\n- add a `fargate-create.yml` ([example here](examples/fargate-create.yml)) to your template to drive custom configuration, prompting for defaults, etc. \n\nAn [example](https://github.com/turnerlabs/terraform-ecs-fargate-scheduled-task/) of an extended template:\n```shell\n$ fargate-create -f my-scheduledtask.tfvars -t git@github.com:turnerlabs/terraform-ecs-fargate-scheduled-task\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturnerlabs%2Ffargate-create","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fturnerlabs%2Ffargate-create","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fturnerlabs%2Ffargate-create/lists"}