Skip to content

Commit

Permalink
Redeploy ECS task when the connection token changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwgillespie committed Aug 15, 2022
1 parent d29fa18 commit 8554439
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ resource "aws_ecs_task_definition" "cloud-agent" {
{ name = "CLOUD_AGENT_AWS_SUBNET_ID", value = aws_subnet.public[0].id },
{ name = "CLOUD_AGENT_CONNECTION_ID", value = var.connection-id },
{ name = "CLOUD_AGENT_TF_MODULE_VERSION", value = local.version },

# This environment variable is unused, but causes ECS to redeploy if the connection token changes
{ name = "_CLOUD_AGENT_CONNECTION_TOKEN_HASH", value = sha256(var.connection-token) },
]
secrets = [
{ name = "CLOUD_AGENT_CONNECTION_TOKEN", valueFrom = aws_ssm_parameter.connection-token[0].arn },
Expand Down

0 comments on commit 8554439

Please sign in to comment.