Skip to content

Commit 5c4abec

Browse files
committed
test: validate lifecycle policy rule with newer_noncurrent_versions
1 parent 50965af commit 5c4abec

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

internal/provider/bucket_lifecycle_configuration.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
99
"github.com/aws/aws-sdk-go-v2/service/s3"
1010
s3_types "github.com/aws/aws-sdk-go-v2/service/s3/types"
11-
"github.com/hashicorp/terraform-plugin-framework-validators/int32validator"
1211
"github.com/hashicorp/terraform-plugin-framework-validators/int64validator"
1312
"github.com/hashicorp/terraform-plugin-framework-validators/listvalidator"
1413
"github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator"
@@ -266,11 +265,6 @@ func (r *BucketLifecycleConfigurationResource) Schema(ctx context.Context, req r
266265
"newer_noncurrent_versions": schema.Int32Attribute{
267266
Optional: true,
268267
MarkdownDescription: "The number of newer noncurrent versions.",
269-
Validators: []validator.Int32{
270-
int32validator.ConflictsWith(
271-
path.MatchRelative().AtParent().AtName("noncurrent_days"),
272-
),
273-
},
274268
},
275269
"noncurrent_days": schema.Int32Attribute{
276270
Optional: true,

internal/provider/testdata/bucket_lifecycle.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,19 @@ resource "objsto_bucket" "this" {
1010
resource "objsto_bucket_lifecycle_configuration" "this" {
1111
bucket = objsto_bucket.this.bucket
1212

13+
rule {
14+
id = "Expire non-current versions after 3 newer versions"
15+
16+
filter {
17+
prefix = "test/"
18+
}
19+
20+
noncurrent_version_expiration {
21+
noncurrent_days = 1
22+
newer_noncurrent_versions = 3
23+
}
24+
}
25+
1326
rule {
1427
id = "Expire non-current versions after 7 days"
1528

0 commit comments

Comments
 (0)