diff --git a/builtin/providers/aws/data_source_aws_elb_service_account.go b/builtin/providers/aws/data_source_aws_elb_service_account.go index 8101dac094..ae60e8b81f 100644 --- a/builtin/providers/aws/data_source_aws_elb_service_account.go +++ b/builtin/providers/aws/data_source_aws_elb_service_account.go @@ -32,6 +32,10 @@ func dataSourceAwsElbServiceAccount() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "arn": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, }, } } @@ -44,6 +48,9 @@ func dataSourceAwsElbServiceAccountRead(d *schema.ResourceData, meta interface{} if accid, ok := elbAccountIdPerRegionMap[region]; ok { d.SetId(accid) + + d.Set("arn", "arn:aws:iam::"+accid+":root") + return nil } diff --git a/builtin/providers/aws/data_source_aws_elb_service_account_test.go b/builtin/providers/aws/data_source_aws_elb_service_account_test.go index bf818fe882..ef62e2b1d4 100644 --- a/builtin/providers/aws/data_source_aws_elb_service_account_test.go +++ b/builtin/providers/aws/data_source_aws_elb_service_account_test.go @@ -15,12 +15,14 @@ func TestAccAWSElbServiceAccount_basic(t *testing.T) { Config: testAccCheckAwsElbServiceAccountConfig, Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.aws_elb_service_account.main", "id", "797873946194"), + resource.TestCheckResourceAttr("data.aws_elb_service_account.main", "arn", "arn:aws:iam::797873946194:root"), ), }, resource.TestStep{ Config: testAccCheckAwsElbServiceAccountExplicitRegionConfig, Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.aws_elb_service_account.regional", "id", "156460612806"), + resource.TestCheckResourceAttr("data.aws_elb_service_account.regional", "arn", "arn:aws:iam::156460612806:root"), ), }, }, diff --git a/website/source/docs/providers/aws/d/elb_service_account.html.markdown b/website/source/docs/providers/aws/d/elb_service_account.html.markdown index 178d7c3ad7..4705cfe502 100644 --- a/website/source/docs/providers/aws/d/elb_service_account.html.markdown +++ b/website/source/docs/providers/aws/d/elb_service_account.html.markdown @@ -68,3 +68,4 @@ resource "aws_elb" "bar" { ## Attributes Reference * `id` - The ID of the AWS ELB service account in the selected region. +* `arn` - The ARN of the AWS ELB service account in the selected region.