Skip to content

Commit ea2c59e

Browse files
committed
updates
1 parent 4b1c780 commit ea2c59e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

internal/exec/terraform_outputs.go

+4-7
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ const (
3636

3737
varEnvVarPrefix = "TF_VAR_"
3838
cliArgEnvVarPrefix = "TF_CLI_ARGS_"
39-
40-
componentStr = "component"
41-
stackStr = "stack"
4239
)
4340

4441
var prohibitedEnvVars = []string{
@@ -300,7 +297,7 @@ func GetTerraformOutput(
300297
sections, err := ExecuteDescribeComponent(component, stack, true, true, nil)
301298
if err != nil {
302299
u.PrintfMessageToTUI("\r✗ %s\n", message)
303-
log.Fatal("Failed to describe the component", componentStr, component, stackStr, stack, "error", err)
300+
log.Fatal("Failed to describe the component", cfg.ComponentStr, component, cfg.StackStr, stack, "error", err)
304301
}
305302

306303
// Check if the component in the stack is configured with the 'static' remote state backend, in which case get the
@@ -321,7 +318,7 @@ func GetTerraformOutput(
321318
terraformOutputs, err := execTerraformOutput(atmosConfig, component, stack, sections)
322319
if err != nil {
323320
u.PrintfMessageToTUI("\r✗ %s\n", message)
324-
log.Fatal("Failed to execute terraform output", componentStr, component, stackStr, stack, "error", err)
321+
log.Fatal("Failed to execute terraform output", cfg.ComponentStr, component, cfg.StackStr, stack, "error", err)
325322
}
326323

327324
// Cache the result
@@ -347,7 +344,7 @@ func getTerraformOutputVariable(
347344

348345
res, err := u.EvaluateYqExpression(atmosConfig, outputs, val)
349346
if err != nil {
350-
log.Fatal("Error evaluating terraform output", "output", output, componentStr, component, stackStr, stack, "error", err)
347+
log.Fatal("Error evaluating terraform output", "output", output, cfg.ComponentStr, component, cfg.StackStr, stack, "error", err)
351348
}
352349

353350
return res
@@ -367,7 +364,7 @@ func getStaticRemoteStateOutput(
367364

368365
res, err := u.EvaluateYqExpression(atmosConfig, remoteStateSection, val)
369366
if err != nil {
370-
log.Fatal("Error evaluating the 'static' remote state backend output", "output", output, componentStr, component, stackStr, stack, "error", err)
367+
log.Fatal("Error evaluating the 'static' remote state backend output", "output", output, cfg.ComponentStr, component, cfg.StackStr, stack, "error", err)
371368
}
372369

373370
return res

pkg/config/const.go

+3
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,7 @@ const (
9292
AtmosProDefaultEndpoint = "api"
9393

9494
TerraformDefaultWorkspace = "default"
95+
96+
ComponentStr = "component"
97+
StackStr = "stack"
9598
)

0 commit comments

Comments
 (0)