Skip to content

Commit

Permalink
schema/backend: Reflect 1.2 & 1.3 changes in azurerm (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko authored May 31, 2023
1 parent f11f12c commit da6b8f7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions internal/schema/backends/azurerm.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,20 @@ func azureRmBackend(v *version.Version) *schema.BodySchema {
}
}

// This attribute was both introduced and deprecated in 1.2 🙈
// https://github.com/hashicorp/terraform/commit/9f710558 (introduction)
// https://github.com/hashicorp/terraform/commit/2eb9118c (deprecation)
if v.GreaterThanOrEqual(v1_2_0) {
bodySchema.Attributes["use_microsoft_graph"] = &schema.AttributeSchema{
Constraint: schema.LiteralType{Type: cty.Bool},
IsOptional: true,
Description: lang.Markdown("This field now defaults to `true` and will be removed in v1.3 of Terraform Core due to the deprecation of ADAL by Microsoft."),
}
if v.GreaterThanOrEqual(v1_3_0) {
// See https://github.com/hashicorp/terraform/commit/05528e8c (removal)
delete(bodySchema.Attributes, "use_microsoft_graph")
}
}

return bodySchema
}
1 change: 1 addition & 0 deletions internal/schema/backends/backends.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var (
v0_13_1 = version.Must(version.NewVersion("0.13.1"))
v0_14_0 = version.Must(version.NewVersion("0.14.0"))
v0_15_0 = version.Must(version.NewVersion("0.15.0"))
v1_2_0 = version.Must(version.NewVersion("1.2.0"))
v1_3_0 = version.Must(version.NewVersion("1.3.0"))
v1_4_0 = version.Must(version.NewVersion("1.4.0"))
)
Expand Down

0 comments on commit da6b8f7

Please sign in to comment.