// The configuration saved in the working directory state file is used
// in this case, since it will contain any additional values that
// were provided via -backend-config arguments on terraform init.
schema:=b.ConfigSchema()
configVal,err:=s.Backend.Config(schema)
iferr!=nil{
diags=diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Failed to decode current backend config",
fmt.Sprintf("The backend configuration created by the most recent run of \"terraform init\" could not be decoded: %s. The configuration may have been initialized by an earlier version that used an incompatible configuration structure. Run \"terraform init -reconfigure\" to force re-initialization of the backend.",err),
))
returnnil,diags
}
// The configuration saved in the working directory state file is used
// in this case, since it will contain any additional values that
// were provided via -backend-config arguments on terraform init.
schema:=b.ConfigSchema()
configVal,err:=s.Backend.Config(schema)
iferr!=nil{
diags=diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Failed to decode current backend config",
fmt.Sprintf("The backend configuration created by the most recent run of \"terraform init\" could not be decoded: %s. The configuration may have been initialized by an earlier version that used an incompatible configuration structure. Run \"terraform init -reconfigure\" to force re-initialization of the backend.",err),
))
returnnil,diags
}
// Validate the config and then configure the backend
newVal,validDiags:=b.PrepareConfig(configVal)
diags=diags.Append(validDiags)
ifvalidDiags.HasErrors(){
returnnil,diags
}
// Validate the config and then configure the backend
newVal,validDiags:=b.PrepareConfig(configVal)
diags=diags.Append(validDiags)
ifvalidDiags.HasErrors(){
returnnil,diags
}
configDiags:=b.Configure(newVal)
diags=diags.Append(configDiags)
ifconfigDiags.HasErrors(){
returnnil,diags
}
configDiags:=b.Configure(newVal)
diags=diags.Append(configDiags)
ifconfigDiags.HasErrors(){
returnnil,diags
}
// If the result of loading the backend is an enhanced backend,