diff --git a/vault/resource_ad_secret_backend.go b/vault/resource_ad_secret_backend.go index c1190a577..cfe80511e 100644 --- a/vault/resource_ad_secret_backend.go +++ b/vault/resource_ad_secret_backend.go @@ -2,10 +2,11 @@ package vault import ( "fmt" - "github.com/hashicorp/terraform-provider-vault/util" "log" "strings" + "github.com/hashicorp/terraform-provider-vault/util" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/vault/api" ) @@ -81,13 +82,6 @@ func adSecretBackendResource() *schema.Resource { Optional: true, Description: `Use anonymous bind to discover the bind DN of a user.`, }, - "formatter": { - Type: schema.TypeString, - Optional: true, - Computed: true, - Deprecated: `Formatter is deprecated and password_policy should be used with Vault >= 1.5.`, - Description: `Text to insert the password into, ex. "customPrefix{{PASSWORD}}customSuffix".`, - }, "groupattr": { Type: schema.TypeString, Optional: true, @@ -114,13 +108,6 @@ func adSecretBackendResource() *schema.Resource { Computed: true, Description: `The number of seconds after a Vault rotation where, if Active Directory shows a later rotation, it should be considered out-of-band.`, }, - "length": { - Type: schema.TypeInt, - Optional: true, - Computed: true, - Deprecated: `Length is deprecated and password_policy should be used with Vault >= 1.5.`, - Description: `The desired length of passwords that Vault generates.`, - }, "local": { Type: schema.TypeBool, Required: false, @@ -271,9 +258,6 @@ func createConfigResource(d *schema.ResourceData, meta interface{}) error { if v, ok := d.GetOkExists("discoverdn"); ok { data["discoverdn"] = v } - if v, ok := d.GetOkExists("formatter"); ok { - data["formatter"] = v - } if v, ok := d.GetOkExists("groupattr"); ok { data["groupattr"] = v } @@ -289,9 +273,6 @@ func createConfigResource(d *schema.ResourceData, meta interface{}) error { if v, ok := d.GetOkExists("last_rotation_tolerance"); ok { data["last_rotation_tolerance"] = v } - if v, ok := d.GetOkExists("length"); ok { - data["length"] = v - } if v, ok := d.GetOkExists("max_ttl"); ok { data["max_ttl"] = v } @@ -410,11 +391,6 @@ func readConfigResource(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error setting state key 'discoverdn': %s", err) } } - if val, ok := resp.Data["formatter"]; ok { - if err := d.Set("formatter", val); err != nil { - return fmt.Errorf("error setting state key 'formatter': %s", err) - } - } if val, ok := resp.Data["groupattr"]; ok { if err := d.Set("groupattr", val); err != nil { return fmt.Errorf("error setting state key 'groupattr': %s", err) @@ -440,11 +416,6 @@ func readConfigResource(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error setting state key 'last_rotation_tolerance': %s", err) } } - if val, ok := resp.Data["length"]; ok { - if err := d.Set("length", val); err != nil { - return fmt.Errorf("error setting state key 'length': %s", err) - } - } if val, ok := resp.Data["max_ttl"]; ok { if err := d.Set("max_ttl", val); err != nil { return fmt.Errorf("error setting state key 'max_ttl': %s", err) @@ -569,9 +540,6 @@ func updateConfigResource(d *schema.ResourceData, meta interface{}) error { if raw, ok := d.GetOk("discoverdn"); ok { data["discoverdn"] = raw } - if raw, ok := d.GetOk("formatter"); ok { - data["formatter"] = raw - } if raw, ok := d.GetOk("groupattr"); ok { data["groupattr"] = raw } @@ -587,9 +555,6 @@ func updateConfigResource(d *schema.ResourceData, meta interface{}) error { if raw, ok := d.GetOk("last_rotation_tolerance"); ok { data["last_rotation_tolerance"] = raw } - if raw, ok := d.GetOk("length"); ok { - data["length"] = raw - } if raw, ok := d.GetOk("max_ttl"); ok { data["max_ttl"] = raw } diff --git a/website/docs/guides/version_3_upgrade.html.markdown b/website/docs/guides/version_3_upgrade.html.markdown index 7cafe8fe5..88e310d82 100644 --- a/website/docs/guides/version_3_upgrade.html.markdown +++ b/website/docs/guides/version_3_upgrade.html.markdown @@ -27,8 +27,8 @@ can always be found in the [CHANGELOG](https://github.com/hashicorp/terraform-pr We introduced version `3.0.0` of the Vault provider in order to upgrade to the [Terraform Plugin SDKv2](https://www.terraform.io/docs/extend/sdkv2-intro.html). The change was deemed significant enough to warrant the major version bump. -In addition to the aforementioned SDK upgrade all previously deprecated fields -have been removed. +In addition to the aforementioned SDK upgrade all previously deprecated fields, +and resources have been removed. While you may see some small changes in your configurations as a result of these changes, we don't expect you'll need to make any major refactorings. @@ -72,6 +72,7 @@ state changes in the meantime. - [Data Source: `vault_kubernetes_auth_backend_role`](#data-source-vault_kubernetes_auth_backend_role) +- [Resource: `vault_ad_secret_backend`](#resource-vault_ad_secret_backend) - [Resource: `vault_approle_auth_backend_role`](#resource-vault_approle_auth_backend_role) - [Resource: `vault_auth_backend`](#resource-vault_auth_backend) - [Resource: `vault_aws_auth_backend_role`](#resource-vault_aws_auth_backend_role) @@ -144,6 +145,17 @@ The following deprecated fields have been removed: _Specifying any of the fields above in your config or trying to interpolate them in your config will raise an error._ +## Resource: `vault_ad_secret_backend` + +### Deprecated fields have been removed +The following deprecated fields have been removed: + +* `formatter` - use `password_policy` instead. + +* `length` - use `password_policy` instead. + +_Specifying any of the fields above in your config or trying to interpolate them in your config will raise an error._ + ## Resource: `vault_approle_auth_backend_role` ### Deprecated fields have been removed