github.com/minamijoyo/terraform@v0.7.8-0.20161029001309-18b3736ba44b/builtin/providers/aws/data_source_aws_billing_service_account.go (about)

     1  package aws
     2  
     3  import (
     4  	"github.com/hashicorp/terraform/helper/schema"
     5  )
     6  
     7  // See http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-getting-started.html#step-2
     8  var billingAccountId = "386209384616"
     9  
    10  func dataSourceAwsBillingServiceAccount() *schema.Resource {
    11  	return &schema.Resource{
    12  		Read: dataSourceAwsBillingServiceAccountRead,
    13  
    14  		Schema: map[string]*schema.Schema{
    15  			"arn": &schema.Schema{
    16  				Type:     schema.TypeString,
    17  				Computed: true,
    18  			},
    19  		},
    20  	}
    21  }
    22  
    23  func dataSourceAwsBillingServiceAccountRead(d *schema.ResourceData, meta interface{}) error {
    24  	d.SetId(billingAccountId)
    25  
    26  	d.Set("arn", "arn:aws:iam::"+billingAccountId+":root")
    27  
    28  	return nil
    29  }