Validate that workspace name aligns with var.assessment_account_name
value
#243
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🗣 Description
This PR adds an additional check to validate that the value in
var.assessment_account_name
aligns with the currently-selected workspace name (6ad9330).Additionally, this PR updates the
terraform_apply.sh
script so that all of the validation checks of user-supplied data inassessment_validation.tf
are performed before any other changes are applied (43126de).Also note that part of 1b6f8b5 includes a documentation verbiage change (from
terraform-docs
) that was overlooked during #240.💭 Motivation and context
We are constantly striving to find ways to reduce human error in our processes. This change should prevent errors where a COOL environment administrator accidentally uses a Terraform variables (tfvars) file meant for a different workspace.
Resolves #241.
🧪 Testing
I tested
terraform plan
,terraform apply
, andterraform_apply.sh
by supplying a tfvars file meant for a different COOL workspace. In each case, I got an error message like this:I also verified that when I used the correct tfvars file for my workspace, the error above was not displayed.
All automated tests pass.
✅ Pre-approval checklist
to reflect the changes in this PR.
✅ Post-merge checklist