diff --git a/internal/schema/backends/backends.go b/internal/schema/backends/backends.go index 081df0b6..683528a7 100644 --- a/internal/schema/backends/backends.go +++ b/internal/schema/backends/backends.go @@ -31,6 +31,7 @@ var ( v1_6_3 = version.Must(version.NewVersion("1.6.3")) v1_6_4 = version.Must(version.NewVersion("1.6.4")) v1_7_0 = version.Must(version.NewVersion("1.7.0")) + v1_8_0 = version.Must(version.NewVersion("1.8.0")) ) func BackendTypesAsOneOfConstraint(tfVersion *version.Version) schema.OneOf { diff --git a/internal/schema/backends/s3.go b/internal/schema/backends/s3.go index cc67574f..8d122fb7 100644 --- a/internal/schema/backends/s3.go +++ b/internal/schema/backends/s3.go @@ -445,11 +445,6 @@ func s3Backend(v *version.Version) *schema.BodySchema { }, }, } - bodySchema.Attributes["use_legacy_workflow"] = &schema.AttributeSchema{ - Constraint: schema.LiteralType{Type: cty.Bool}, - IsOptional: true, - Description: lang.Markdown("Use the legacy authentication workflow, preferring environment variables over backend configuration."), - } bodySchema.Attributes["custom_ca_bundle"] = &schema.AttributeSchema{ Constraint: schema.LiteralType{Type: cty.String}, IsOptional: true, @@ -541,7 +536,13 @@ func s3Backend(v *version.Version) *schema.BodySchema { } } - if v.GreaterThanOrEqual(v1_7_0) { + bodySchema.Attributes["use_legacy_workflow"] = &schema.AttributeSchema{ + Constraint: schema.LiteralType{Type: cty.Bool}, + IsOptional: true, + Description: lang.Markdown("Use the legacy authentication workflow, preferring environment variables over backend configuration."), + } + + if v.GreaterThanOrEqual(v1_7_0) && v.LessThan(v1_8_0) { bodySchema.Attributes["use_legacy_workflow"] = &schema.AttributeSchema{ Constraint: schema.LiteralType{Type: cty.Bool}, IsOptional: true, @@ -550,5 +551,10 @@ func s3Backend(v *version.Version) *schema.BodySchema { } } + if v.GreaterThanOrEqual(v1_8_0) { + // In Terraform 1.8 the use_legacy_workflow argument is be removed to encourage consistency with the AWS SDKs + bodySchema.Attributes["use_legacy_workflow"] = nil + } + return bodySchema }