diff --git a/config/configschema/schema.go b/config/configschema/schema.go index 9a8ee550aa..0c23741fea 100644 --- a/config/configschema/schema.go +++ b/config/configschema/schema.go @@ -28,6 +28,12 @@ type Attribute struct { // Type is a type specification that the attribute's value must conform to. Type cty.Type + // Description is an English-language description of the purpose and + // usage of the attribute. A description should be concise and use only + // one or two sentences, leaving full definition to longer-form + // documentation defined elsewhere. + Description string + // Required, if set to true, specifies that an omitted or null value is // not permitted. Required bool diff --git a/helper/schema/core_schema.go b/helper/schema/core_schema.go index bf952f6631..95398578be 100644 --- a/helper/schema/core_schema.go +++ b/helper/schema/core_schema.go @@ -59,11 +59,12 @@ func (m schemaMap) CoreConfigSchema() *configschema.Block { // whose elem is a whole resource. func (s *Schema) coreConfigSchemaAttribute() *configschema.Attribute { return &configschema.Attribute{ - Type: s.coreConfigSchemaType(), - Optional: s.Optional, - Required: s.Required, - Computed: s.Computed, - Sensitive: s.Sensitive, + Type: s.coreConfigSchemaType(), + Optional: s.Optional, + Required: s.Required, + Computed: s.Computed, + Sensitive: s.Sensitive, + Description: s.Description, } } diff --git a/helper/schema/core_schema_test.go b/helper/schema/core_schema_test.go index 08f8dbd9a5..8fefc47fc2 100644 --- a/helper/schema/core_schema_test.go +++ b/helper/schema/core_schema_test.go @@ -23,8 +23,9 @@ func TestSchemaMapCoreConfigSchema(t *testing.T) { "primitives": { map[string]*Schema{ "int": { - Type: TypeInt, - Required: true, + Type: TypeInt, + Required: true, + Description: "foo bar baz", }, "float": { Type: TypeFloat, @@ -43,8 +44,9 @@ func TestSchemaMapCoreConfigSchema(t *testing.T) { &configschema.Block{ Attributes: map[string]*configschema.Attribute{ "int": { - Type: cty.Number, - Required: true, + Type: cty.Number, + Required: true, + Description: "foo bar baz", }, "float": { Type: cty.Number,