AppGambitStudio / terraform-apprunner

AppRunner Terraform Demo to use different container images
MIT License
0 stars 4 forks source link

AWS App Runner Terraform

AWS App Runner is a fully managed service that makes it easy for developers to quickly deploy containerized web applications and APIs, at scale and with no prior infrastructure experience required. Start with your source code or a container image. App Runner automatically builds and deploys the web application and load balances traffic with encryption. App Runner also scales up or down automatically to meet your traffic needs. With App Runner, rather than thinking about servers or scaling, you have more time to focus on your applications.

This repository contains the terraform configuration based script to deploy your application on AWS App Runner.

AWS Resources covered in this setup

Setup Terraform

Script Feature

We have 3 ways to deploy your application on App Runner

We have to change terraform.tfvar according to deployment type.

Deploy Application with Github repository

isECR                = false
build_command        = "Application build command(If required)"
runtime              = "Application runtime environment like PYTHON_3 | NODEJS_12"
start_command        = "Application start command(If required)"
configuration_source = "REPOSITORY | API"
repository_url       = "Github repository url"
repository_branch    = "branch name"
port                 = "Port"

Note: For now you have to configure github connection manually because terraform not allow to approve created github connection automatically. https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/apprunner_connection When you create github connection you have to allow aws to access you github repository so for that you have to allow that permission manually.

Deploy Application with ECR Private repository

isECR                 = true
image_repository_type = "ECR"
image_identifier      = "ECR repository image uri
port                  = "Port"

Deploy Application with ECR public repository

isECR                 = true
image_repository_type = "ECR_PUBLIC"
image_identifier      = "Public image uri"
port                  = "Port"

Setup Terraform user profile