Skip to content

Commit 3015c7e

Browse files
authored
fix: set the missing AWS environment variables (#7)
These are important for the AWS cloud integration to work properly.
1 parent c22e453 commit 3015c7e

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
data "aws_caller_identity" "current" {}
12
data "aws_partition" "current" {}
23

34
resource "random_uuid" "suffix" {}
@@ -30,6 +31,9 @@ module "ecs" {
3031
source = "./modules/ecs"
3132
depends_on = [module.lb] # Prevents race conditions
3233

34+
aws_account_id = data.aws_caller_identity.current.account_id
35+
aws_region = var.region
36+
3337
suffix = local.suffix
3438

3539
subnets = var.ecs_subnets

modules/ecs/task_definitions.tf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@ locals {
22
webhooks_endpoint = "https://${var.server_domain}/webhooks"
33
backend_image = "${var.backend_image}:${var.backend_image_tag}"
44
shared_envs = [
5+
{
6+
name = "AWS_ACCOUNT_ID",
7+
value = var.aws_account_id
8+
},
9+
{
10+
name = "AWS_DEFAULT_REGION",
11+
value = var.aws_region
12+
},
13+
{
14+
name = "AWS_REGION",
15+
value = var.aws_region
16+
},
17+
{
18+
name = "ENVIRONMENT",
19+
value = "prod"
20+
},
521
{
622
name = "SERVER_DOMAIN"
723
value = var.server_domain

modules/ecs/variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
variable "aws_account_id" {
2+
type = string
3+
description = "The AWS account the services are being run in."
4+
}
5+
6+
variable "aws_region" {
7+
type = string
8+
description = "The AWS region the services are being run in."
9+
}
10+
111
variable "suffix" {
212
type = string
313
}

0 commit comments

Comments
 (0)