mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-20 11:48:24 -06:00
Export AWS ELB service account ARN (#8700)
This commit is contained in:
parent
291f298535
commit
1d04cdb9bc
@ -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
|
||||
}
|
||||
|
||||
|
@ -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"),
|
||||
),
|
||||
},
|
||||
},
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user