{"id":13880966,"url":"https://github.com/scaffold-sh/aws-serverless-docker","last_synced_at":"2025-07-16T17:31:31.372Z","repository":{"id":143790553,"uuid":"302649295","full_name":"scaffold-sh/aws-serverless-docker","owner":"scaffold-sh","description":"This infrastructure uses AWS Fargate to host a Docker container in a serverless way.","archived":false,"fork":false,"pushed_at":"2020-10-10T23:05:40.000Z","size":217,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-24T10:34:29.694Z","etag":null,"topics":["acm","aws","codebuild","codepipeline","fargate","scaffold"],"latest_commit_sha":null,"homepage":"https://scaffold.sh/docs/infrastructures/aws/serverless-docker","language":"TypeScript","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/scaffold-sh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2020-10-09T13:28:27.000Z","updated_at":"2022-10-04T12:20:20.000Z","dependencies_parsed_at":"2024-01-16T12:02:17.569Z","dependency_job_id":null,"html_url":"https://github.com/scaffold-sh/aws-serverless-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scaffold-sh/aws-serverless-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaffold-sh%2Faws-serverless-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaffold-sh%2Faws-serverless-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaffold-sh%2Faws-serverless-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaffold-sh%2Faws-serverless-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scaffold-sh","download_url":"https://codeload.github.com/scaffold-sh/aws-serverless-docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaffold-sh%2Faws-serverless-docker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265527549,"owners_count":23782480,"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":["acm","aws","codebuild","codepipeline","fargate","scaffold"],"created_at":"2024-08-06T08:03:42.418Z","updated_at":"2025-07-16T17:31:30.738Z","avatar_url":"https://github.com/scaffold-sh.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"/assets/docker.png\" alt=\"Docker\" height=\"200\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eAWS Serverless Docker\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003e\n  \u003ca href=\"https://scaffold.sh/docs/infrastructures/aws/serverless-docker\"\u003eDocumentation\u003c/a\u003e |\n  \u003ca href=\"https://scaffold.sh\"\u003eWebsite\u003c/a\u003e |\n  \u003ca href=\"https://medium.com/scaffold\"\u003eBlog\u003c/a\u003e |\n  \u003ca href=\"https://twitter.com/scaffold_sh\"\u003eTwitter\u003c/a\u003e |\n  \u003ca href=\"https://www.linkedin.com/company/scaffold-sh\"\u003eLinkedIn\u003c/a\u003e\n\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\u003cb\u003e+ $70\u003c/b\u003e / month \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;  \u003cb\u003e~ 4min\u003c/b\u003e / create\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/scaffold-sh/cli/blob/master/package.json\"\u003e\u003cimg src=\"https://img.shields.io/node/v/@scaffold.sh/cli\" alt=\"Node version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://yarnpkg.com/en/docs/install\"\u003e\u003cimg src=\"https://img.shields.io/badge/yarn-%3E%3D1.21-blue\" alt=\"Yarn version\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://aws.amazon.com/cli/?nc1=h_ls\"\u003e\u003cimg src=\"https://img.shields.io/badge/aws-%3E%3D2.0-0b1b2c\" alt=\"AWS version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.terraform.io/downloads.html\"\u003e\u003cimg src=\"https://img.shields.io/badge/terraform-13.0-5c44db\" alt=\"Terraform version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/hashicorp/terraform-cdk\"\u003e\u003cimg src=\"https://img.shields.io/badge/cdktf-%3E%3D0.14-green\" alt=\"CDKTF version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/scaffold-sh/aws-serverless-docker/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/scaffold-sh/aws-serverless-docker\" alt=\"License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n```console\n$ scaffold aws:serverless-docker\n```\n\nThis infrastructure uses **[AWS Fargate](https://aws.amazon.com/fargate)** to host your Docker container in a **serverless way**.\n\nYour **GitHub account** will be connected to **[CodePipeline](https://aws.amazon.com/codepipeline)** and **[CodeBuild](https://aws.amazon.com/codebuild)**, so you will be able to build, test and deploy your application using the usual `git push` command.\n\n[Your pipeline](https://aws.amazon.com/codepipeline) will be configured with 5 stages: Source, Test, Build, Pre-deploy and Deploy. The test, build and pre-deploy stages will run in CodeBuild.\n\nThe test stage may be used to run your unit/integration/e2e tests. **CodeBuild is configured to run in your VPC so you will be able to access all your infrastructure components, including your database.**\n\nThe build stage will build and push your Docker container in **[ECR](https://aws.amazon.com/ecr)**.\n\nThe pre-deploy stage will run [a command](https://scaffold.sh/docs/infrastructures/aws/serverless-docker/environment-variables#pre-deploy-command) in a newly created production container, just before deployment. **You can use this stage to run your database migrations, for example.**\n\nThis infrastructure also uses **[ACM](https://aws.amazon.com/acm)** to add a fully-managed SSL certificate to your application and **[SSM Parameters Store](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html)** to store your environment variables.\n\nThe number of Availability Zones used may be configured for high availability. **This infrastructure is load-balanced, auto-scaled and with zero downtime deployment.**\n\n![](/assets/schema.png)\n\n### Requirements\n\n*   You will need a **GitHub** account to create this infrastructure. **Support for GitLab and BitBucket is coming soon.**\n\n*   If you plan to use an apex domain for your website (i.e. a root domain that does not contain a subdomain), make sure that your domain host support the ANAME, ALIAS or naked CNAME DNS record type.\n\n## Components\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eName\u003c/th\u003e\n            \u003cth\u003eSource\u003c/th\u003e\n            \u003cth\u003ePrice\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cb\u003e\u003ca href=\"https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html\"\u003eVPC\u003c/a\u003e\u003c/b\u003e \u003csup\u003e(one)\u003c/sup\u003e\u003cbr/\u003eAll your infrastructure components will be contained in one VPC.\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://github.com/scaffold-sh/aws-serverless-docker/blob/master/src/lib/constructs/network/vpc.ts\"\u003esrc/lib/constructs/network/vpc.ts\u003c/a\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cb\u003eFree\u003c/b\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cb\u003e\u003ca href=\"https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Scenario2.html\"\u003ePublic subnet(s)\u003c/a\u003e\u003c/b\u003e \u003csup\u003e(one or more)\u003c/sup\u003e\u003cbr /\u003eOne or more public subnet(s) that will contain your application load balancer and your NAT gateway(s).\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://github.com/scaffold-sh/aws-serverless-docker/blob/master/src/lib/constructs/network/subnets.ts\"\u003esrc/lib/constructs/network/subnets.ts\u003c/a\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cb\u003eFree\u003c/b\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cb\u003e\u003ca href=\"https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Scenario2.html\"\u003ePrivate subnet(s)\u003c/a\u003e\u003c/b\u003e \u003csup\u003e(one or more)\u003c/sup\u003e\u003cbr /\u003eOne or more private subnet(s) that will contain your Fargate and CodeBuild instances.\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://github.com/scaffold-sh/aws-serverless-docker/blob/master/src/lib/constructs/network/subnets.ts\"\u003esrc/lib/constructs/network/subnets.ts\u003c/a\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cb\u003eFree\u003c/b\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cb\u003e\u003ca href=\"https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html\"\u003eApplication load balancer\u003c/a\u003e\u003c/b\u003e \u003csup\u003e(one)\u003c/sup\u003e\u003cbr /\u003eOne application load balancer (replicated in public subnet(s)) that will be used to distribute incoming traffic across your Fargate instances.\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://github.com/scaffold-sh/aws-serverless-docker/blob/master/src/lib/constructs/network/applicationLoadBalancer.ts\"\u003esrc/lib/constructs/network/applicationLoadBalancer.ts\u003c/a\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cb\u003e+$18\u003c/b\u003e\u0026nbsp;/\u0026nbsp;month\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cb\u003e\u003ca href=\"https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html\"\u003eNAT gateway(s)\u003c/a\u003e\u003c/b\u003e \u003csup\u003e(one or more)\u003c/sup\u003e\u003cbr /\u003eOne or more NAT gateway(s) that will enable Fargate and CodeBuild instances in private subnet(s) to connect to the internet.\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://github.com/scaffold-sh/aws-serverless-docker/blob/master/src/lib/constructs/network/natGateways.ts\"\u003esrc/lib/constructs/network/natGateways.ts\u003c/a\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cb\u003e+$35\u003c/b\u003e\u0026nbsp;/\u0026nbsp;month\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n          \u003ctd\u003e\u003cb\u003e\u003ca href=\"https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html\"\u003eACM\u003c/a\u003e\u003c/b\u003e \u003csup\u003e(one certificate)\u003c/sup\u003e\u003cbr /\u003eACM will be used to manage the SSL certificate of your application.\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://github.com/scaffold-sh/aws-serverless-docker/blob/master/src/lib/constructs/network/ssl.ts\"\u003esrc/lib/constructs/network/ssl.ts\u003c/a\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cb\u003eFree\u003c/b\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Computing\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eName\u003c/th\u003e\n            \u003cth\u003eSource\u003c/th\u003e\n            \u003cth\u003ePrice\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cb\u003e\u003ca href=\"https://docs.aws.amazon.com/AmazonECS/latest/developerguide/AWS_Fargate.html\"\u003eFargate\u003c/a\u003e\u003c/b\u003e \u003csup\u003e(one cluster)\u003c/sup\u003e\u003cbr/\u003eFargate will be used to run your containers without having to manage servers.\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://github.com/scaffold-sh/aws-serverless-docker/blob/master/src/lib/constructs/computing/cluster.ts\"\u003esrc/lib/constructs/computing/cluster.ts\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/scaffold-sh/aws-serverless-docker/blob/master/src/lib/constructs/computing/service.ts\"\u003esrc/lib/constructs/computing/service.ts\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/scaffold-sh/aws-serverless-docker/blob/master/src/lib/constructs/computing/tasks.ts\"\u003esrc/lib/constructs/computing/tasks.ts\u003c/a\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cb\u003e+$15\u003c/b\u003e\u0026nbsp;/\u0026nbsp;month\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cb\u003e\u003ca href=\"https://docs.aws.amazon.com/AmazonECR/latest/userguide/what-is-ecr.html\"\u003eECR\u003c/a\u003e\u003c/b\u003e \u003csup\u003e(one repository)\u003c/sup\u003e\u003cbr /\u003eECR will be used to store your Docker images.\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://github.com/scaffold-sh/aws-serverless-docker/blob/master/src/lib/constructs/computing/repository.ts\"\u003esrc/lib/constructs/computing/repository.ts\u003c/a\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cb\u003eUsage\u003c/b\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cb\u003e\u003ca href=\"https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-parameter-store.html\"\u003eSSM\u003c/a\u003e\u003c/b\u003e \u003csup\u003e(one parameter store)\u003c/sup\u003e\u003cbr /\u003eSSM Parameter Store will be used to store the environment variables of your application.\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://github.com/scaffold-sh/aws-serverless-docker/blob/master/src/lib/constructs/computing/environmentVariables.ts\"\u003esrc/lib/constructs/computing/environmentVariables.ts\u003c/a\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cb\u003eUsage\u003c/b\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Continuous Deployment\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eName\u003c/th\u003e\n            \u003cth\u003eSource\u003c/th\u003e\n            \u003cth\u003ePrice\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cb\u003e\u003ca href=\"https://docs.aws.amazon.com/codepipeline/latest/userguide/welcome.html\"\u003eCodePipeline\u003c/a\u003e\u003c/b\u003e \u003csup\u003e(one pipeline)\u003c/sup\u003e\u003cbr/\u003eCodePipeline will be used to manage the builds and deployments of your application.\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://github.com/scaffold-sh/aws-serverless-docker/blob/master/src/lib/constructs/continuousDeployment/pipeline.ts\"\u003esrc/lib/constructs/continuousDeployment/pipeline.ts\u003c/a\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cb\u003e+$1\u003c/b\u003e\u0026nbsp;/\u0026nbsp;month\u003c/td\u003e\n        \u003c/tr\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cb\u003e\u003ca href=\"https://docs.aws.amazon.com/codebuild/latest/userguide/welcome.html\"\u003eCodeBuild\u003c/a\u003e\u003c/b\u003e \u003csup\u003e(three build projects)\u003c/sup\u003e\u003cbr /\u003eCodeBuild will be used to run the test, build and pre-deploy stages of your pipeline.\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://github.com/scaffold-sh/aws-serverless-docker/blob/master/src/lib/constructs/continuousDeployment/builds.ts\"\u003esrc/lib/constructs/continuousDeployment/builds.ts\u003c/a\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cb\u003e+$1.5\u003c/b\u003e\u0026nbsp;/\u0026nbsp;month\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n### Dashboard\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eName\u003c/th\u003e\n            \u003cth\u003eSource\u003c/th\u003e\n            \u003cth\u003ePrice\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003e\u003cb\u003e\u003ca href=\"https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Dashboards.html\"\u003eCloudWatch\u003c/a\u003e\u003c/b\u003e \u003csup\u003e(one dashboard)\u003c/sup\u003e\u003cbr/\u003eCloudWatch will be used to display the metrics of your infrastructure components.\u003c/td\u003e\n            \u003ctd\u003e\u003ca href=\"https://github.com/scaffold-sh/aws-serverless-docker/blob/master/src/lib/constructs/dashboard/index.ts\"\u003esrc/lib/constructs/dashboard/index.ts\u003c/a\u003e\u003c/td\u003e\n          \u003ctd\u003e\u003cb\u003eFree\u003c/b\u003e\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n\n## Environment variables\n\nThese environment variables will be **automatically** configured each time you create \u003ca href=\"https://scaffold.sh/docs/environments\"\u003ean environment\u003c/a\u003e (or \u003ca href=\"https://scaffold.sh/docs/sandboxes\"\u003ea sandbox\u003c/a\u003e) for your infrastructure.\n\n\u003ctable class=\"table table-striped table-dark\"\u003e\n\n\u003cthead\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"col\"\u003eName\u003c/th\u003e\n\n\u003cth scope=\"col\"\u003eDescription\u003c/th\u003e\n\n\u003c/tr\u003e\n\n\u003c/thead\u003e\n\n\u003ctbody\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eCONTAINER_LISTEN_PORT\u003c/th\u003e\n\n\u003ctd\u003eThe port that needs to be used to send requests to your Docker container.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eDOMAIN_NAMES\u003c/th\u003e\n\n\u003ctd\u003eThe domain names that need to be covered by your ACM certificate.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eENABLE_AUTO_SCALING\u003c/th\u003e\n\n\u003ctd\u003eDo auto-scaling needs to be enabled?\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eENABLE_HTTPS\u003c/th\u003e\n\n\u003ctd\u003eWe need to wait for the ACM certificate to be \"issued\" to enable HTTPS. See the \"\u003ca href=\"https://scaffold.sh/docs/infrastructures/aws/serverless-docker/after-install\"\u003eafter install\u003c/a\u003e\" section to learn more.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eFARGATE_TASKS_CPU\u003c/th\u003e\n\n\u003ctd\u003eThe CPU that could be used by your Fargate tasks.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eFARGATE_TASKS_MEMORY\u003c/th\u003e\n\n\u003ctd\u003eThe memory that could be used by your Fargate tasks.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eGITHUB_BRANCH\u003c/th\u003e\n\n\u003ctd\u003eThe branch from which you want to deploy.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eGITHUB_OAUTH_TOKEN\u003c/th\u003e\n\n\u003ctd\u003eThe GitHub OAuth token that will be used by CodePipeline to pull your source code from your repository.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eGITHUB_REPO\u003c/th\u003e\n\n\u003ctd\u003eThe GitHub repository that contains your source code.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eGITHUB_REPO_OWNER\u003c/th\u003e\n\n\u003ctd\u003eThe owner of your GitHub repository. Can be a regular user or an organization.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eGITHUB_WEBHOOK_TOKEN\u003c/th\u003e\n\n\u003ctd\u003eA random token that will be used by CodePipeline and GitHub to prevent impersonation.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eNUMBER_OF_AVAILABILITY_ZONES_USED\u003c/th\u003e\n\n\u003ctd\u003eThe number of availability zones used by your infrastructure.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003ePRE_DEPLOY_COMMAND\u003c/th\u003e\n\n\u003ctd\u003eA command that will run in a newly created production container, just before deployment.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003c/tbody\u003e\n\n\u003c/table\u003e\n\n### Inherited\n\n\u003ctable class=\"table table-striped table-dark\"\u003e\n\n\u003cthead\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"col\"\u003eName\u003c/th\u003e\n\n\u003cth scope=\"col\"\u003eDescription\u003c/th\u003e\n\n\u003c/tr\u003e\n\n\u003c/thead\u003e\n\n\u003ctbody\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eSCAFFOLD_AWS_PROFILE\u003c/th\u003e\n\n\u003ctd\u003eThe AWS named profile used to create your infrastructure.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eSCAFFOLD_AWS_REGION\u003c/th\u003e\n\n\u003ctd\u003eThe AWS region where you want to create your infrastructure.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eSCAFFOLD_AWS_S3_BACKEND_BUCKET\u003c/th\u003e\n\n\u003ctd\u003eThe AWS S3 bucket that will contain the Terraform state of your infrastructure.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eSCAFFOLD_AWS_S3_BACKEND_DYNAMODB_TABLE\u003c/th\u003e\n\n\u003ctd\u003eThe AWS DynamoDB table that will be used to store the Terraform state locks.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eSCAFFOLD_AWS_S3_BACKEND_KEY\u003c/th\u003e\n\n\u003ctd\u003eThe S3 bucket key under which your Terraform state will be saved.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\n\u003cth scope=\"row\"\u003eSCAFFOLD_RESOURCE_NAMES_PREFIX\u003c/th\u003e\n\n\u003ctd\u003eAn unique custom prefix used to avoid name colision with existing resources.\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003c/tbody\u003e\n\n\u003c/table\u003e\n\n## After install\n\n**Your load balancer will display a \"503 Service Temporarily Unavailable\" error until the end of the first deployment.**\n\nThis infrastructure exports four Terraform outputs: `application_load_balancer_uri`, `dashboard_url`, `pipeline_execution_details_url` and `ssl_validation_dns_records`.\n\nThe `application_load_balancer_uri` output value contains the URI of your load balancer. You could use it to access your application while your DNS are propagating.\n\nThe `dashboard_url` and `pipeline_execution_details_url` output values contains the URLs of your CloudWatch dashboard and your pipeline executions details.\n\nThe `ssl_validation_dns_records` output value contains the DNS records that you need to set in order to validate your ACM certificate (see below).\n\n### How do I set up my domain name?\n\nThe way you will set up your domain name will vary according to the presence or absence of a subdomain.\n\nIf your domain name doesn't have any subdomains, you will need to add two DNS records:\n\n- **Name:** \u003cempty\u003e or @\n- **Type:** ALIASE, ANAME or CNAME\n- **Value:** `application_load_balancer_uri`\n\n\u003cp\u003e\u003c/p\u003e\n\n- **Name:** www\n- **Type:** CNAME\n- **Value:** `application_load_balancer_uri`\n\nIf your domain name has a subdomain, you will need to add one CNAME record:\n\n- **Name:** subdomain\n- **Type:** CNAME\n- **Value:** `application_load_balancer_uri`\n\n### How do I set up HTTPS?\n\nThe `ssl_validation_dns_records` output value contains the DNS records that you need to set in order to validate your ACM certificate.\n\nOnce set, you will need to [wait for the status](https://console.aws.amazon.com/acm/home?region=us-east-1#/) of your certificate to switch from \"pending\" to \"issued\" to use it with your application load balancer.\n\nYou could then set the `ENABLE_HTTPS` environment variable to \"true\" in your local env file and run the `scaffold apply` command to update your infrastructure.\n\nIf you want to automate this process, you could use AWS Route 53 as your domain host then use the `aws_route53_record` and `aws_acm_certificate_validation` resources to wait for certificate validation. See the [Terraform documentation](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/acm_certificate_validation) to learn more.\n\n### How do I add environment variables to my application?\n\nTo add an environment variable to your application all you have to do is to add an environment variable that starts with `APPLICATION_` to your infrastructure code.\n\nFor example, let's say that you want to add a `TOKEN` variable to your application. You will first add it to your `.env` file:\n\n```env\n# .env\nAPPLICATION_TOKEN=\n```\n\nThen, given that this value is secret you choose to define it in your local env file:\n\n```env\n# .env.{environment}.local\nAPPLICATION_TOKEN=MY_SECRET_TOKEN\n```\n\nThat's it! Run the `scaffold apply` command and re-deploy your application to access your `TOKEN` environment variable.\n\n### How do I customize the test, build and pre-deploy stages of my pipeline?\n\n[CodeBuild uses a YAML file](https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html) to describe all the steps that a stage requires. These files are located in the \u003ckbd\u003etemplates\u003c/kbd\u003e directory at the root of your infrastructure:\n\n```env\n# ./templates                                  \nbuildspec.yml\npredeployspec.yml\ntestspec.yml\n```\n\nYou could update these files directly to customize your pipeline stages.\n\n### How do I access environment variables from my *spec files?\n\nThe process to add an environment variable to your *spec files is identical to the one used for you application except than you need to prefix your environment variables with `BUILD_`:\n\n```env\n# .env.{environment}.local\nBUILD_TOKEN=MY_SECRET_TOKEN\n```\n\nOne done, you could access your environment variables in all your *spec files:\n\n```yaml\n# templates/testspec.yml\n\nversion: 0.2\n\nphases:\n  pre_build:\n    commands:\n      - echo $TOKEN\n```\n\nRemember to run the `scaffold apply` command each time you update your infrastructure code.\n\n### How do I customize my CloudWatch dashboard?\n\nYour CloudWatch dashboard is composed of widgets defined as JSON in the `dashboard/index.ts` file:\n\n```typescript\n// ./src/lib/constructs/dashboard/index.ts\n\nthis.self = new CloudwatchDashboard(this, \"cloudwatch_dashboard\", {\n  dashboardName: props.resourceNamesPrefix,\n  dashboardBody: JSON.stringify({\n    widgets: [\n      {\n        type: \"metric\",\n        width: 12,\n        height: 6,\n        // ...\n      }\n    ]\n  })\n})\n```\n\nYou could safely add, update or delete widgets using the structure defined in the [AWS documentation](https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscaffold-sh%2Faws-serverless-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscaffold-sh%2Faws-serverless-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscaffold-sh%2Faws-serverless-docker/lists"}