Skip to content

Commit

Permalink
Updating test & example
Browse files Browse the repository at this point in the history
! Note that this needs the terratest PR (gruntwork-io/terratest#767) to be merged in to work & be tested.
  • Loading branch information
ina-stoyanova committed Jan 22, 2021
1 parent edce56c commit 6bc2b03
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ remote_state {
dynamodb_table = "__FILL_IN_LOCK_TABLE_NAME__"
enable_lock_table_ssencryption = true
accesslogging_bucket_name = "__FILL_IN_LOGS_BUCKET_NAME__"
accesslogging_target_prefix = "TFStatelogs/"
}
}
4 changes: 4 additions & 0 deletions test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,9 @@ func TestTerragruntSetsAccessLoggingForTfSTateS3BuckeToADifferentBucket(t *testi

s3BucketName := fmt.Sprintf("terragrunt-test-bucket-%s", strings.ToLower(uniqueId()))
s3BucketLogsName := fmt.Sprintf("%s-tf-state-logs", s3BucketName)
// Do not change this value - it's expected from the terragrunt config for this test too.
// If there's no value provided in the config, the TargetPrefix will be set to empty string.
s3BucketLogsTargetPrefix := "TFStatelogs/"
lockTableName := fmt.Sprintf("terragrunt-test-locks-%s", strings.ToLower(uniqueId()))

defer deleteS3Bucket(t, TERRAFORM_REMOTE_STATE_S3_REGION, s3BucketName)
Expand All @@ -632,6 +635,7 @@ func TestTerragruntSetsAccessLoggingForTfSTateS3BuckeToADifferentBucket(t *testi
targetLoggingBucket := terraws.GetS3BucketLoggingTarget(t, TERRAFORM_REMOTE_STATE_S3_REGION, s3BucketName)

assert.Equal(t, s3BucketLogsName, targetLoggingBucket)
assert.Equal(t, s3BucketLogsTargetPrefix, targetLoggingBucket)
}

func TestTerragruntWorksWithGCSBackend(t *testing.T) {
Expand Down

0 comments on commit 6bc2b03

Please sign in to comment.