Skip to content

Commit 5ff27ef

Browse files
authored
[CLOUDGA-32090] Made AWS S3 PathPrefix a mandatory field. (#192)
1 parent 41d8a19 commit 5ff27ef

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/hashicorp/terraform-plugin-framework-validators v0.4.0
1111
github.com/hashicorp/terraform-plugin-log v0.9.0
1212
github.com/sethvargo/go-retry v0.2.3
13-
github.com/yugabyte/yugabytedb-managed-go-client-internal v0.0.0-20260119193723-d17483f32689
13+
github.com/yugabyte/yugabytedb-managed-go-client-internal v0.0.0-20260220082932-5ebca1e49256
1414
)
1515

1616
require github.com/stretchr/testify v1.8.2 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9
169169
github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc=
170170
github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g=
171171
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
172-
github.com/yugabyte/yugabytedb-managed-go-client-internal v0.0.0-20260119193723-d17483f32689 h1:DnXLydzXOu0fzaMjKxWls8gzCVPMEo1ef5eVxxQ7rqM=
173-
github.com/yugabyte/yugabytedb-managed-go-client-internal v0.0.0-20260119193723-d17483f32689/go.mod h1:5vW0xIzIZw+1djkiWKx0qqNmqbRBSf4mjc4qw8lIMik=
172+
github.com/yugabyte/yugabytedb-managed-go-client-internal v0.0.0-20260220082932-5ebca1e49256 h1:XzV6GNOpqnLzG0YUKkZ7KqM2NjBiT/rpT66j60xBhnk=
173+
github.com/yugabyte/yugabytedb-managed-go-client-internal v0.0.0-20260220082932-5ebca1e49256/go.mod h1:5vW0xIzIZw+1djkiWKx0qqNmqbRBSf4mjc4qw8lIMik=
174174
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
175175
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
176176
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=

managed/data_source_integration.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,10 @@ func dataSourceTelemetryProviderRead(accountId string, projectId string, configN
430430
Region: types.String{Value: s3Spec.GetRegion()},
431431
AccessKeyId: types.String{Value: s3Spec.GetAccessKeyId()},
432432
SecretAccessKey: types.String{Value: s3Spec.GetSecretAccessKey()},
433+
PathPrefix: types.String{Value: s3Spec.GetPathPrefix()},
433434
}
434435

435436
// Set optional fields if they exist
436-
if s3Spec.HasPathPrefix() {
437-
tp.AwsS3Spec.PathPrefix = types.String{Value: s3Spec.GetPathPrefix()}
438-
}
439437
if s3Spec.HasFilePrefix() {
440438
tp.AwsS3Spec.FilePrefix = types.String{Value: s3Spec.GetFilePrefix()}
441439
}

managed/resource_integration.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,9 @@ func (r resourceIntegration) Create(ctx context.Context, req tfsdk.CreateResourc
539539
return
540540
}
541541
awsS3SpecPlan := plan.AwsS3Spec
542-
s3TelemetrySpec := *openapiclient.NewS3TelemetryProviderSpec(awsS3SpecPlan.BucketName.Value, awsS3SpecPlan.Region.Value, awsS3SpecPlan.AccessKeyId.Value, awsS3SpecPlan.SecretAccessKey.Value)
542+
s3TelemetrySpec := *openapiclient.NewS3TelemetryProviderSpec(awsS3SpecPlan.BucketName.Value, awsS3SpecPlan.Region.Value, awsS3SpecPlan.AccessKeyId.Value, awsS3SpecPlan.SecretAccessKey.Value, awsS3SpecPlan.PathPrefix.Value)
543543

544544
// Set optional fields if provided
545-
if !awsS3SpecPlan.PathPrefix.Null && !awsS3SpecPlan.PathPrefix.Unknown && awsS3SpecPlan.PathPrefix.Value != "" {
546-
s3TelemetrySpec.SetPathPrefix(awsS3SpecPlan.PathPrefix.Value)
547-
}
548545
if !awsS3SpecPlan.FilePrefix.Null && !awsS3SpecPlan.FilePrefix.Unknown && awsS3SpecPlan.FilePrefix.Value != "" {
549546
s3TelemetrySpec.SetFilePrefix(awsS3SpecPlan.FilePrefix.Value)
550547
}
@@ -744,12 +741,10 @@ func resourceTelemetryProviderRead(accountId string, projectId string, configID
744741
Region: types.String{Value: s3Spec.Region},
745742
AccessKeyId: userProvidedTpDetails.AwsS3Spec.AccessKeyId, // Use user-provided value (API returns masked)
746743
SecretAccessKey: userProvidedTpDetails.AwsS3Spec.SecretAccessKey, // Use user-provided value (API returns masked)
744+
PathPrefix: types.String{Value: s3Spec.GetPathPrefix()},
747745
}
748746

749747
// Set optional fields from API response if they exist
750-
if s3Spec.HasPathPrefix() {
751-
tp.AwsS3Spec.PathPrefix = types.String{Value: s3Spec.GetPathPrefix()}
752-
}
753748
if s3Spec.HasFilePrefix() {
754749
tp.AwsS3Spec.FilePrefix = types.String{Value: s3Spec.GetFilePrefix()}
755750
}

0 commit comments

Comments
 (0)