diff --git a/hcl2template/types.variables.go b/hcl2template/types.variables.go index d887216e5a5..6cb4977e0e3 100644 --- a/hcl2template/types.variables.go +++ b/hcl2template/types.variables.go @@ -755,7 +755,7 @@ func (cfg *PackerConfig) collectInputVariableValues(env []string, files []*hcl.F // The specified filename is to identify the source of where value originated from in the diagnostics report, if there is an error. func expressionFromVariableDefinition(filename string, value string, variableType cty.Type) (hclsyntax.Expression, hcl.Diagnostics) { switch variableType { - case cty.String, cty.Number, cty.NilType: + case cty.String, cty.Number, cty.NilType, cty.DynamicPseudoType: // when the type is nil (not set in a variable block) we default to // interpreting everything as a string literal. return &hclsyntax.LiteralValueExpr{Val: cty.StringVal(value)}, nil