Skip to content

Commit

Permalink
Support .yml extension for the config file (#162)
Browse files Browse the repository at this point in the history
## Overview/Summary

The intent seems to be that both `.yaml` and `.yml` would be valid
configuration file extensions. However, in the current code, a `.yml`
file extension would attempted to be parsed as JSON.

## This PR fixes/adds/changes/removes

1. Azure/ALZ-PowerShell-Module#153 

### Breaking Changes

N/A

## As part of this Pull Request I have

- [x] Checked for duplicate [Pull
Requests](https://github.com/Azure/alz-terraform-accelerator/pulls)
- [x] Associated it with relevant
[issues](https://github.com/Azure/alz-terraform-accelerator/issues), for
tracking and closure.
- [x] Ensured my code/branch is up-to-date with the latest changes in
the `main`
[branch](https://github.com/Azure/alz-terraform-accelerator/tree/main)
- [x] Performed testing and provided evidence.
- [x] Updated relevant and associated documentation.

---------

Co-authored-by: Jared Holgate <[email protected]>
  • Loading branch information
SvenAelterman and jaredfholgate authored Sep 3, 2024
1 parent ac7f555 commit 4ad4c79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion templates/complete/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ locals {
const_yml = "yml"
}
locals {
config = (local.config_file_extension == local.const_yaml ?
config = (local.config_file_extension == local.const_yaml || local.config_file_extension == local.const_yml ?
yamldecode(templatefile("${path.module}/${local.config_file_name}", local.config_template_file_variables)) :
jsondecode(templatefile("${path.module}/${local.config_file_name}", local.config_template_file_variables))
)
Expand Down
2 changes: 1 addition & 1 deletion templates/complete_vnext/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ locals {
const_yml = "yml"
}
locals {
config = (local.config_file_extension == local.const_yaml ?
config = (local.config_file_extension == local.const_yaml || local.config_file_extension == local.const_yml ?
yamldecode(templatefile("${path.module}/${local.config_file_name}", local.config_template_file_variables)) :
jsondecode(templatefile("${path.module}/${local.config_file_name}", local.config_template_file_variables))
)
Expand Down

0 comments on commit 4ad4c79

Please sign in to comment.