Skip to content

Commit

Permalink
Template infra deploy #10707425604
Browse files Browse the repository at this point in the history
  • Loading branch information
nava-platform-bot committed Sep 4, 2024
1 parent b1bb470 commit a3d5ff0
Show file tree
Hide file tree
Showing 21 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .template-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
eed666cd15654f84ad1794e3d752e30431e0a41a
3e2231977f06c0b2dda77cbac3eb6d8bbbb20285
2 changes: 1 addition & 1 deletion docs/infra/cloud-access-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ GitHub Actions needs permissions to create, modify, and destroy resources in the

## Adding/removing permissions from GitHub Actions

To add or remove permissions from the CI/CD role, update the list of AWS services that GitHub Actions has access to, defined in the project-config module in [project-config/aws-services.tf](/infra/project-config/aws-services.tf)
To add or remove permissions from the CI/CD role, update the list of AWS services that GitHub Actions has access to, defined in the project-config module in [project-config/aws_services.tf](/infra/project-config/aws_services.tf)
8 changes: 4 additions & 4 deletions docs/infra/environment-variables-and-secrets.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ Applications may need application specific configuration as environment variable

> ⚠️ Note: Do not put sensitive information such as credentials as regular environment variables. The method described in this section will embed the environment variables and their values in the ECS task definition's container definitions, so anyone with access to view the task definition will be able to see the values of the environment variables. For configuring secrets, see the section below on [Secrets](#secrets)
Environment variables are defined in the `app-config` module in the [environment-variables.tf file](/infra/app/app-config/env-config/environment-variables.tf). Modify the `default_extra_environment_variables` map to define extra environment variables specific to the application. Map keys define the environment variable name, and values define the default value for the variable across application environments. For example:
Environment variables are defined in the `app-config` module in the [environment_variables.tf file](/infra/app/app-config/env-config/environment_variables.tf). Modify the `default_extra_environment_variables` map to define extra environment variables specific to the application. Map keys define the environment variable name, and values define the default value for the variable across application environments. For example:

```terraform
# environment-variables.tf
# environment_variables.tf
locals {
default_extra_environment_variables = {
Expand Down Expand Up @@ -40,10 +40,10 @@ module "dev_config" {

Secrets are a specific category of environment variables that need to be handled sensitively. Examples of secrets are authentication credentials such as API keys for external services. Secrets first need to be stored in AWS SSM Parameter Store as a `SecureString`. This section then describes how to make those secrets accessible to the ECS task as environment variables through the `secrets` configuration in the container definition (see AWS documentation on [retrieving Secrets Manager secrets through environment variables](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/secrets-envvar-secrets-manager.html)).

Secrets are defined in the same file that non-sensitive environment variables are defined, in the `app-config` module in the [environment-variables.tf file](/infra/app/app-config/env-config/environment-variables.tf). Modify the `secrets` map to define the secrets that the application will have access to. For each secret, the map key defines the environment variable name. The `manage_method` property, which can be set to `"generated"` or `"manual"`, defines whether or not to generate a random secret or to reference an existing secret that was manually created and stored into AWS SSM. The `secret_store_name` property defines the SSM parameter name that stores the secret value. If `manage_method = "generated"`, then `secret_store_name` is where terraform will store the secret. If `manage_method = "manual"`, then `secret_store_name` is where terraform will look for the existing secret. For example:
Secrets are defined in the same file that non-sensitive environment variables are defined, in the `app-config` module in the [environment_variables.tf file](/infra/app/app-config/env-config/environment_variables.tf). Modify the `secrets` map to define the secrets that the application will have access to. For each secret, the map key defines the environment variable name. The `manage_method` property, which can be set to `"generated"` or `"manual"`, defines whether or not to generate a random secret or to reference an existing secret that was manually created and stored into AWS SSM. The `secret_store_name` property defines the SSM parameter name that stores the secret value. If `manage_method = "generated"`, then `secret_store_name` is where terraform will store the secret. If `manage_method = "manual"`, then `secret_store_name` is where terraform will look for the existing secret. For example:

```terraform
# environment-variables.tf
# environment_variables.tf
locals {
secrets = {
Expand Down
1 change: 1 addition & 0 deletions docs/infra/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Here are some exceptions (and additions) to Hashicorp's Terraform style guide.
- Use module names based on the logical function of the module rather than the underlying proprietary service used for implementing the module. For example, use "database" instead of "rds", or "storage" instead of "s3".
- Organize resources according to the infrastructure layers described in [module architecture](/docs/infra/module-architecture.md).
- [Use shared configuration](/docs/infra/module-dependencies.md) instead of the [tfe_outputs data source](https://registry.terraform.io/providers/hashicorp/tfe/latest/docs/data-sources/outputs) to share state between two state files.
- Use underscores instead of dashes in file names and module names.

#### Variables

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

1 comment on commit a3d5ff0

@github-actions
Copy link

Choose a reason for hiding this comment

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

Coverage report for app

St.
Category Percentage Covered / Total
🟢 Statements 93.1% 81/87
🟢 Branches 82.35% 14/17
🟢 Functions 93.33% 14/15
🟢 Lines 93.59% 73/78

Test suite run success

16 tests passing in 5 suites.

Report generated by 🧪jest coverage report action from a3d5ff0

Please sign in to comment.