diff --git a/backend/remote-state/swift/backend.go b/backend/remote-state/swift/backend.go index e1e4e95b2..595b05191 100644 --- a/backend/remote-state/swift/backend.go +++ b/backend/remote-state/swift/backend.go @@ -109,7 +109,7 @@ func New() backend.Backend { "insecure": &schema.Schema{ Type: schema.TypeBool, Optional: true, - DefaultFunc: schema.EnvDefaultFunc("OS_INSECURE", ""), + DefaultFunc: schema.EnvDefaultFunc("OS_INSECURE", nil), Description: descriptions["insecure"], }, @@ -256,7 +256,6 @@ func (b *Backend) configure(ctx context.Context) error { DomainName: data.Get("domain_name").(string), EndpointType: data.Get("endpoint_type").(string), IdentityEndpoint: data.Get("auth_url").(string), - Insecure: data.Get("insecure").(bool), Password: data.Get("password").(string), Token: data.Get("token").(string), TenantID: data.Get("tenant_id").(string), @@ -265,6 +264,11 @@ func (b *Backend) configure(ctx context.Context) error { UserID: data.Get("user_id").(string), } + if v, ok := data.GetOkExists("insecure"); ok { + insecure := v.(bool) + config.Insecure = &insecure + } + if err := config.LoadAndValidate(); err != nil { return err }