Skip to content

Commit

Permalink
Use underscores in Terraform file names instead of dashes (#828)
Browse files Browse the repository at this point in the history
## Ticket

Resolves #739 

## Changes

- Swapped dashes for underscores in the 2 remaining files that were
inconsistent
- Added info to style guide

## Testing

`find . -type f -name '*.tf' | awk -F/ '{print $NF}' | grep -- '-'`

[Platform Test PR](navapbc/platform-test#152)

<!-- app - begin PR environment info -->
## Preview environment for app
- Service endpoint:
http://p-152-app-dev-936383488.us-east-1.elb.amazonaws.com
- Deployed commit: dd08a9353c1d11202e5222d52c3c44e8042de11e
<!-- app - end PR environment info -->
  • Loading branch information
daphnegold authored Jan 9, 2025
1 parent 33c4a61 commit 9d9c07d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/send-system-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
channel:
description: "Name of channel to use. Must be defined in /infra/project-config/system-notifications.tf"
description: "Name of channel to use. Must be defined in /infra/project-config/system_notifications.tf"
required: true
type: string
message:
Expand Down
6 changes: 6 additions & 0 deletions docs/infra/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Terraform code style](#terraform-code-style)
- [Exceptions and additions to Hashicorp's Terraform style guide](#exceptions-and-additions-to-hashicorps-terraform-style-guide)
- [Modules](#modules)
- [File Names](#file-names)
- [Variables](#variables)
- [.gitignore](#gitignore)
- [Integration and unit testing](#integration-and-unit-testing)
Expand All @@ -28,6 +29,11 @@ Here are some exceptions (and additions) to Hashicorp's Terraform style guide.
- [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.

#### File Names

- Separate words in filenames with underscores (\_) instead of dashes (-), e.g., main.tf, output_variables.tf.
- Use lowercase letters to avoid case sensitivity issues.

#### Variables

- Include additional type information in string variable names to clarify the value being stored. For example, use `access_policy_arn` instead of `access_policy`. Common examples of suffixes include: `_id`, `_arn`, and `_name`.
Expand Down
2 changes: 1 addition & 1 deletion docs/infra/system-notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ The project sends notifications as part of CI/CD workflows to notify the team ab

## System notifications configuration

The configuration for system notifications is defined in the application's [project-config module](/infra/project-config/). The [system-notifications.tf](/infra/project-config/system-notifications.tf) file defines one or more notification channels that CI/CD workflows can send notifications to. Each channel can use a different notification type. Currently, Slack is the only supported notification type.
The configuration for system notifications is defined in the application's [project-config module](/infra/project-config/). The [system_notifications.tf](/infra/project-config/system_notifications.tf) file defines one or more notification channels that CI/CD workflows can send notifications to. Each channel can use a different notification type. Currently, Slack is the only supported notification type.

0 comments on commit 9d9c07d

Please sign in to comment.