github.com/handlerbot/terraform@v0.10.0-beta1.0.20180726153736-26b68d98f9cb/builtin/providers/test/data_source_label.go (about)

     1  package test
     2  
     3  import (
     4  	"github.com/hashicorp/terraform/helper/schema"
     5  )
     6  
     7  func providerLabelDataSource() *schema.Resource {
     8  	return &schema.Resource{
     9  		Read: providerLabelDataSourceRead,
    10  
    11  		Schema: map[string]*schema.Schema{
    12  			"label": {
    13  				Type:     schema.TypeString,
    14  				Computed: true,
    15  			},
    16  		},
    17  	}
    18  }
    19  
    20  func providerLabelDataSourceRead(d *schema.ResourceData, meta interface{}) error {
    21  	label := meta.(string)
    22  	d.SetId(label)
    23  	d.Set("label", label)
    24  	return nil
    25  }