Skip to content

Commit

Permalink
add region for AWS encryption
Browse files Browse the repository at this point in the history
  • Loading branch information
norman-zon committed Dec 12, 2024
1 parent a3025e4 commit f0c0e4e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions remote/remote_encryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ type RemoteEncryptionKeyProviderAWSKMS struct {
RemoteEncryptionKeyProviderBase `mapstructure:",squash"`
KmsKeyID string `mapstructure:"kms_key_id"`
KeySpec string `mapstructure:"key_spec"`
Region string `mapstructure:"region"`
}

type RemoteEncryptionKeyProviderGCPKMS struct {
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/tofu-state-encryption/aws-kms/terragrunt.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ remote_state {

encryption = {
key_provider = "aws_kms"
region = "__FILL_IN_AWS_REGION__"
kms_key_id = "__FILL_IN_KMS_KEY_ID__"
key_spec = "AES_256"
}
Expand Down
2 changes: 1 addition & 1 deletion test/integration_tofu_state_encryption_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ func TestTofuStateEncryptionAWSKMS(t *testing.T) {

helpers.CopyAndFillMapPlaceholders(t, configPath, configPath, map[string]string{
"__FILL_IN_KMS_KEY_ID__": awsKMSKeyID,
"__FILL_IN_AWS_REGION__": awsKMSKeyRegion,
})

os.Setenv("AWS_REGION", awsKMSKeyRegion)
helpers.RunTerragrunt(t, fmt.Sprintf("terragrunt apply -auto-approve --terragrunt-non-interactive --terragrunt-working-dir %s", workDir))
assert.True(t, helpers.FileIsInFolder(t, stateFile, workDir))
validateStateIsEncrypted(t, stateFile, workDir)
Expand Down

0 comments on commit f0c0e4e

Please sign in to comment.