Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add environment to environment variables #2432

Merged
merged 2 commits into from
Oct 9, 2024
Merged

Add environment to environment variables #2432

merged 2 commits into from
Oct 9, 2024

Conversation

coilysiren
Copy link
Collaborator

Time to review: 0.1 mins

Context for reviewers

https://betagrantsgov.slack.com/archives/C05TSL64VUH/p1728501460077109

Testing

  # module.service.aws_ecs_task_definition.app must be replaced
-/+ resource "aws_ecs_task_definition" "app" {
      ~ arn                      = "arn:aws:ecs:us-east-1:315341936575:task-definition/api-dev:186" -> (known after apply)
      ~ arn_without_revision     = "arn:aws:ecs:us-east-1:315341936575:task-definition/api-dev" -> (known after apply)
      ~ container_definitions    = jsonencode(
          ~ [
              ~ {
                  ~ environment            = [
                        # (5 unchanged elements hidden)
                        {
                            name  = "DB_USER"
                            value = "app"
                        },
                      + {
                          + name  = "ENVIRONMENT_NAME"         # <===========
                          + value = "dev"                      # <===========
                        },
                        {
                            name  = "PORT"
                            value = "8000"
                        },
                        # (1 unchanged element hidden)
                    ]
                  ~ linuxParameters        = {
                      ~ capabilities       = {
                          - add  = []
                            # (1 unchanged attribute hidden)
                        }
                        # (1 unchanged attribute hidden)
                    }
                  - mountPoints            = []
                    name                   = "api-dev"
                  ~ portMappings           = [
                      ~ {
                          - hostPort      = 8000
                          - protocol      = "tcp"
                            # (1 unchanged attribute hidden)
                        },
                    ]
                  - systemControls         = []
                  - volumesFrom            = []
                    # (8 unchanged attributes hidden)
                },
            ] # forces replacement
        )
      ~ id                       = "api-dev" -> (known after apply)
      ~ revision                 = 186 -> (known after apply)
      - tags                     = {} -> null
        # (12 unchanged attributes hidden)
    }

Plan: 1 to add, 3 to change, 1 to destroy.

@coilysiren coilysiren marked this pull request as ready for review October 9, 2024 19:28
@@ -138,7 +138,7 @@ module "service" {
}
} : null

extra_environment_variables = local.service_config.extra_environment_variables
extra_environment_variables = merge(local.service_config.extra_environment_variables, { "ENVIRONMENT_NAME" : var.environment_name })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we call the variable ENVIRONMENT? That's what we're expecting in the API code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chouinar done!

mdragon
mdragon previously approved these changes Oct 9, 2024
Copy link
Collaborator

@mdragon mdragon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Copy link
Collaborator

@chouinar chouinar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@coilysiren coilysiren merged commit db47fec into main Oct 9, 2024
7 checks passed
@coilysiren coilysiren deleted the kai/service-env branch October 9, 2024 21:01
@coilysiren coilysiren changed the title Add service to environment variables Add environment to environment variables Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants