Skip to content

Commit

Permalink
Add missing CLIInit call -- applying now works! But it asks for confi…
Browse files Browse the repository at this point in the history
…rm, unlike local. 🤔
  • Loading branch information
nfagerlund committed Jun 5, 2023
1 parent eb2fa0d commit 4ecd3bb
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions internal/command/meta_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,22 @@ func (m *Meta) BackendForCloudPlan(hostname, runId string) (backend.Enhanced, tf
}
confDiags := c.ConfigureFromSavedPlan(hostname, runId)
diags = diags.Append(confDiags)

// Cloud backend always supports CLI initialization, do it.
cliOpts, err := m.backendCLIOpts()
if err != nil {
diags = diags.Append(err)
return nil, diags
}
if err := c.CLIInit(cliOpts); err != nil {
diags = diags.Append(fmt.Errorf(
"Error initializing cloud backend: %s\n\n"+
"This is a bug; please report it to the Terraform developers",
err,
))
return nil, diags
}

return c, diags
}

Expand Down

0 comments on commit 4ecd3bb

Please sign in to comment.