Skip to content

Commit

Permalink
add example and integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
cyuanli committed Sep 2, 2024
1 parent a3a8c8c commit b4fcbbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions examples/multiple_buckets/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ module "cloud_storage" {
]
}

retention_policy = {
"two" = {
is_locked = false
retention_period = 3600
}
}

default_event_based_hold = {
"one" = true
}
Expand Down
1 change: 1 addition & 0 deletions test/integration/multiple_buckets/multiple_buckets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ func TestMultipleBuckets(t *testing.T) {
gcloud.Run(t, fmt.Sprintf("alpha storage ls --buckets gs://%s/prod/", fullBucketName), gcloudArgs)
bucket_lifecycles := op.Get("metadata.lifecycle.rule").Array()
assert.Equal(1, len(bucket_lifecycles), "Bucket 'two' has 1 lifecycle rule")
assert.Equal("3600", op.Get("metadata.retentionPolicy.retentionPeriod").String(), "bucket retention policy retention period is 3600")
default:
// fail test if unknown suffix
t.Fatalf("Only expected two buckets with suffixes one and two. Found: %s", fullBucketName)
Expand Down

0 comments on commit b4fcbbe

Please sign in to comment.