diff --git a/go.mod b/go.mod index 0265bd10..6b472fb6 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.14 require ( github.com/google/go-cmp v0.5.6 github.com/hashicorp/go-version v1.3.0 - github.com/hashicorp/hcl-lang v0.0.0-20210728150846-565e9ca96f5a + github.com/hashicorp/hcl-lang v0.0.0-20210730145509-f403a86a1605 github.com/hashicorp/hcl/v2 v2.10.1 github.com/hashicorp/terraform-json v0.12.0 github.com/hashicorp/terraform-registry-address v0.0.0-20210412075316-9b2996cce896 diff --git a/go.sum b/go.sum index 0c4f85f7..abe2d763 100644 --- a/go.sum +++ b/go.sum @@ -27,8 +27,8 @@ github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9 github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.3.0 h1:McDWVJIU/y+u1BRV06dPaLfLCaT7fUTJLp5r04x7iNw= github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/hcl-lang v0.0.0-20210728150846-565e9ca96f5a h1:/4iJtfKKXrHCi99FQgUeHvF6OBNUzJeVO7Tsmfj8F1s= -github.com/hashicorp/hcl-lang v0.0.0-20210728150846-565e9ca96f5a/go.mod h1:xzXU6Fn+TWVaZUFxV8CyAsObi2oMgSEFAmLvCx2ArzM= +github.com/hashicorp/hcl-lang v0.0.0-20210730145509-f403a86a1605 h1:558O3NRU7baTVlQNgui1NeHDORRFEgTsICpHmI+ubA0= +github.com/hashicorp/hcl-lang v0.0.0-20210730145509-f403a86a1605/go.mod h1:xzXU6Fn+TWVaZUFxV8CyAsObi2oMgSEFAmLvCx2ArzM= github.com/hashicorp/hcl/v2 v2.10.1 h1:h4Xx4fsrRE26ohAk/1iGF/JBqRQbyUqu5Lvj60U54ys= github.com/hashicorp/hcl/v2 v2.10.1/go.mod h1:FwWsfWEjyV/CMj8s/gqAuiviY72rJ1/oayI9WftqcKg= github.com/hashicorp/terraform-json v0.12.0 h1:8czPgEEWWPROStjkWPUnTQDXmpmZPlkQAwYYLETaTvw= diff --git a/schema/convert_json.go b/schema/convert_json.go index 5e95a9c8..1261d9f9 100644 --- a/schema/convert_json.go +++ b/schema/convert_json.go @@ -119,10 +119,7 @@ func convertAttributesFromJson(attributes map[string]*tfjson.SchemaAttribute) ma func exprConstraintsFromAttribute(attr *tfjson.SchemaAttribute) schema.ExprConstraints { var expr schema.ExprConstraints if attr.AttributeType != cty.NilType { - return schema.ExprConstraints{ - schema.TraversalExpr{OfType: attr.AttributeType}, - schema.LiteralTypeExpr{Type: attr.AttributeType}, - } + return convertAttributeTypeToExprConstraints(attr.AttributeType) } if attr.AttributeNestedType != nil { switch attr.AttributeNestedType.NestingMode { @@ -165,6 +162,62 @@ func exprConstraintsFromAttribute(attr *tfjson.SchemaAttribute) schema.ExprConst return expr } +func convertAttributeTypeToExprConstraints(attrType cty.Type) schema.ExprConstraints { + ec := schema.ExprConstraints{ + schema.TraversalExpr{OfType: attrType}, + schema.LiteralTypeExpr{Type: attrType}, + } + + if attrType.IsListType() { + ec = append(ec, schema.ListExpr{ + Elem: convertAttributeTypeToExprConstraints(attrType.ElementType()), + }) + } + if attrType.IsSetType() { + ec = append(ec, schema.SetExpr{ + Elem: convertAttributeTypeToExprConstraints(attrType.ElementType()), + }) + } + if attrType.IsTupleType() { + te := schema.TupleExpr{Elems: make([]schema.ExprConstraints, 0)} + for _, elemType := range attrType.TupleElementTypes() { + te.Elems = append(te.Elems, convertAttributeTypeToExprConstraints(elemType)) + } + ec = append(ec, te) + } + if attrType.IsMapType() { + ec = append(ec, schema.MapExpr{ + Elem: convertAttributeTypeToExprConstraints(attrType.ElementType()), + }) + } + if attrType.IsObjectType() { + ec = append(ec, convertCtyObjectToObjectExprAttr(attrType)) + } + + return ec +} + +func convertCtyObjectToObjectExprAttr(obj cty.Type) schema.ObjectExpr { + attrTypes := obj.AttributeTypes() + attributes := make(schema.ObjectExprAttributes, len(attrTypes)) + for name, attrType := range attrTypes { + aSchema := &schema.AttributeSchema{ + Expr: convertAttributeTypeToExprConstraints(attrType), + } + + if obj.AttributeOptional(name) { + aSchema.IsOptional = true + } else { + aSchema.IsRequired = true + } + + attributes[name] = aSchema + } + return schema.ObjectExpr{ + Attributes: attributes, + } +} + func convertJsonAttributesToObjectExprAttr(attrs map[string]*tfjson.SchemaAttribute) schema.ObjectExpr { attributes := make(schema.ObjectExprAttributes, len(attrs)) for name, attr := range attrs { diff --git a/schema/module_schema.go b/schema/module_schema.go index 620093e3..dfb879dc 100644 --- a/schema/module_schema.go +++ b/schema/module_schema.go @@ -1,6 +1,8 @@ package schema import ( + "sort" + "github.com/hashicorp/hcl-lang/lang" "github.com/hashicorp/hcl-lang/schema" "github.com/hashicorp/terraform-schema/internal/schema/refscope" @@ -20,7 +22,7 @@ func SchemaForDependentModuleBlock(localName string, modMeta *module.Meta) (*sch modOutputTypes := make(map[string]cty.Type, 0) modOutputVals := make(map[string]cty.Value, 0) - targetableOutputs := make([]*schema.Targetable, 0) + targetableOutputs := make(schema.Targetables, 0) for name, output := range modMeta.Outputs { addr := lang.Address{ @@ -51,6 +53,8 @@ func SchemaForDependentModuleBlock(localName string, modMeta *module.Meta) (*sch modOutputVals[name] = output.Value } + sort.Sort(targetableOutputs) + addr := lang.Address{ lang.RootStep{Name: "module"}, lang.AttrStep{Name: localName}, diff --git a/schema/schema_merge_v012_test.go b/schema/schema_merge_v012_test.go index e1317b5e..8c7d6e63 100644 --- a/schema/schema_merge_v012_test.go +++ b/schema/schema_merge_v012_test.go @@ -83,6 +83,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -106,6 +112,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -129,6 +141,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -208,6 +226,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, }, "prefix": { @@ -241,6 +265,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -308,6 +338,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -453,6 +489,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -510,6 +552,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.List(cty.String)}, schema.LiteralTypeExpr{Type: cty.List(cty.String)}, + schema.ListExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, }, "keepers": { @@ -520,6 +568,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -532,6 +586,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.List(cty.String)}, schema.LiteralTypeExpr{Type: cty.List(cty.String)}, + schema.ListExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, }, "result_count": { @@ -576,6 +636,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -720,6 +786,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -810,6 +882,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, }, "prefix": { @@ -843,6 +921,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -910,6 +994,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1055,6 +1145,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1112,6 +1208,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.List(cty.String)}, schema.LiteralTypeExpr{Type: cty.List(cty.String)}, + schema.ListExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, }, "keepers": { @@ -1122,6 +1224,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1134,6 +1242,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.List(cty.String)}, schema.LiteralTypeExpr{Type: cty.List(cty.String)}, + schema.ListExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, }, "result_count": { @@ -1178,6 +1292,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1322,6 +1442,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1387,6 +1513,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1399,6 +1531,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, }, "random": { @@ -1444,6 +1582,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1456,6 +1600,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, }, "random": { @@ -1501,6 +1651,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1513,6 +1669,12 @@ var expectedMergedSchema_v012 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, }, "random": { diff --git a/schema/schema_merge_v013_test.go b/schema/schema_merge_v013_test.go index 0a299d48..9e9b0d8c 100644 --- a/schema/schema_merge_v013_test.go +++ b/schema/schema_merge_v013_test.go @@ -141,6 +141,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, IsSensitive: true, @@ -591,6 +597,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.List(cty.String)}, schema.LiteralTypeExpr{Type: cty.List(cty.String)}, + schema.ListExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -605,6 +617,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.List(cty.String)}, schema.LiteralTypeExpr{Type: cty.List(cty.String)}, + schema.ListExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -634,6 +652,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.List(cty.String)}, schema.LiteralTypeExpr{Type: cty.List(cty.String)}, + schema.ListExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -662,6 +686,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.List(cty.String)}, schema.LiteralTypeExpr{Type: cty.List(cty.String)}, + schema.ListExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -768,6 +798,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, IsSensitive: true, @@ -1218,6 +1254,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.List(cty.String)}, schema.LiteralTypeExpr{Type: cty.List(cty.String)}, + schema.ListExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1232,6 +1274,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.List(cty.String)}, schema.LiteralTypeExpr{Type: cty.List(cty.String)}, + schema.ListExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1261,6 +1309,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.List(cty.String)}, schema.LiteralTypeExpr{Type: cty.List(cty.String)}, + schema.ListExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1289,6 +1343,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.List(cty.String)}, schema.LiteralTypeExpr{Type: cty.List(cty.String)}, + schema.ListExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1367,6 +1427,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, Description: lang.MarkupContent{ Value: "A map of arbitrary strings that, when changed, will force the null resource to be replaced, re-running any associated provisioners.", @@ -1400,6 +1466,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1429,6 +1501,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1513,6 +1591,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1553,6 +1637,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1626,6 +1716,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1777,6 +1873,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1840,6 +1942,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.List(cty.String)}, schema.LiteralTypeExpr{Type: cty.List(cty.String)}, + schema.ListExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, }, "keepers": { @@ -1850,6 +1958,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -1862,6 +1976,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.List(cty.String)}, schema.LiteralTypeExpr{Type: cty.List(cty.String)}, + schema.ListExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, }, "result_count": { @@ -1912,6 +2032,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -2062,6 +2188,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -2133,6 +2265,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -2145,6 +2283,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, }, "random": { @@ -2196,6 +2340,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -2208,6 +2358,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, }, "random": { @@ -2259,6 +2415,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, IsOptional: true, }, @@ -2271,6 +2433,12 @@ var expectedMergedSchema_v013 = &schema.BodySchema{ Expr: schema.ExprConstraints{ schema.TraversalExpr{OfType: cty.Map(cty.String)}, schema.LiteralTypeExpr{Type: cty.Map(cty.String)}, + schema.MapExpr{ + Elem: schema.ExprConstraints{ + schema.TraversalExpr{OfType: cty.String}, + schema.LiteralTypeExpr{Type: cty.String}, + }, + }, }, }, "random": {