Modifications to improve the terraform experience for bringing up a windmill cluster. Due to the default RDS settings for the version in the terraform, we do not want to disable ssl in connecting. Additionally, change the TF to automatically pull the latest 2023 AMI. Given this is meant to be a quick start example, this seems better than hard-coding since eventually the hard-coded ami doesn't exist.
37 lines
927 B
HCL
37 lines
927 B
HCL
terraform {
|
|
required_providers {
|
|
aws = {
|
|
source = "hashicorp/aws"
|
|
version = "~> 4.16"
|
|
}
|
|
}
|
|
|
|
required_version = ">= 1.2.0"
|
|
}
|
|
|
|
provider "aws" {
|
|
region = "us-east-2"
|
|
profile = "terraform"
|
|
}
|
|
|
|
data "aws_region" "current" {}
|
|
|
|
data "aws_iam_role" "ecs_task_execution_role" {
|
|
# this needs to be creates in AWS with the attaching the AWS managed policy: 'AmazonECSTaskExecutionRolePolicy'
|
|
name = "ecsTaskExecutionRole"
|
|
}
|
|
|
|
variable "database_password" {
|
|
type = string
|
|
sensitive = true
|
|
description = "RDS Database password"
|
|
}
|
|
|
|
locals {
|
|
db_url = "postgres://${aws_db_instance.windmill_cluster_rds.username}:${aws_db_instance.windmill_cluster_rds.password}@${aws_db_instance.windmill_cluster_rds.endpoint}/${aws_db_instance.windmill_cluster_rds.db_name}"
|
|
}
|
|
|
|
data "aws_ssm_parameter" "amazon_linux_2023" {
|
|
name = "/aws/service/ecs/optimized-ami/amazon-linux-2023/recommended/image_id"
|
|
}
|