Skip to content

Commit

Permalink
Add skip_s3_checksum attribute (#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanck authored Nov 10, 2023
1 parent 0e7be2b commit 3d87057
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/schema/backends/backends.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ var (
v1_4_0 = version.Must(version.NewVersion("1.4.0"))
v1_6_0 = version.Must(version.NewVersion("1.6.0"))
v1_6_1 = version.Must(version.NewVersion("1.6.1"))
v1_6_2 = version.Must(version.NewVersion("1.6.2"))
)

func BackendTypesAsOneOfConstraint(tfVersion *version.Version) schema.OneOf {
Expand Down
10 changes: 9 additions & 1 deletion internal/schema/backends/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func s3Backend(v *version.Version) *schema.BodySchema {
"skip_credentials_validation": {
Constraint: schema.LiteralType{Type: cty.Bool},
IsOptional: true,
Description: lang.Markdown("Skip the credentials validation via STS API."),
Description: lang.Markdown("Skip the credentials validation via STS API. Useful for testing and for AWS API implementations that do not have STS available."),
},

"skip_get_ec2_platforms": {
Expand Down Expand Up @@ -485,5 +485,13 @@ func s3Backend(v *version.Version) *schema.BodySchema {
}
}

if v.GreaterThanOrEqual(v1_6_2) {
bodySchema.Attributes["skip_s3_checksum"] = &schema.AttributeSchema{
Constraint: schema.LiteralType{Type: cty.Bool},
IsOptional: true,
Description: lang.Markdown("Do not include checksum when uploading S3 Objects. Useful for some S3-Compatible APIs."),
}
}

return bodySchema
}

0 comments on commit 3d87057

Please sign in to comment.