Skip to content

This POC is intended to deploy resources to AWS and Render using Terraform

Notifications You must be signed in to change notification settings

skyworkz/terraform-aws-render-sample-app

Repository files navigation

Sample App using Terraform + Render + AWS

This sample application is designed to be deployed on AWS and Render using Terraform

S3 Backend configuration

Terraform works better with a remote backend and S3 is a common option. https://developer.hashicorp.com/terraform/language/settings/backends/s3

The Cloudformation template file terraform-s3-backend-cf-template.yaml has all the resources needed to deploy a basic functional S3 backend.

Default region => Ireland (choose as you wish)

export AWS_DEFAULT_REGION=eu-west-1

The template can be deployed with the following command

STACK_ID=$( \
  aws cloudformation create-stack --stack-name poc-render --template-body file://terraform-s3-backend-cf-template.yaml --capabilities CAPABILITY_NAMED_IAM \
  --query 'StackId' --output text \
)

TF_USERNAME=$( \
  aws cloudformation describe-stacks --stack-name $STACK_ID \
  --query 'Stacks[0].Outputs[?OutputKey==`TerraformUserOutput`].OutputValue | [0]' --output text \
)
  
TF_CREDENTIALS=$( \
  aws iam create-access-key --user-name $TF_USERNAME \
  --query 'AccessKey'
)

Don't forget to store your credentials

echo $TF_CREDENTIALS

Usage

Required variables

export AWS_DEFAULT_REGION=eu-west-1
export AWS_ACCESS_KEY_ID=*****
export AWS_SECRET_ACCESS_KEY=*****
export RENDER_API_KEY=*****
export RENDER_EMAIL=*****

Terraform

terraform init
terraform plan
terraform apply

About

This POC is intended to deploy resources to AWS and Render using Terraform

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages