2016-08-16 22:05:27 +02:00
|
|
|
package aws
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestAccAWSElbServiceAccount_basic(t *testing.T) {
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
|
|
Providers: testAccProviders,
|
|
|
|
Steps: []resource.TestStep{
|
2017-01-23 17:30:28 +01:00
|
|
|
{
|
2016-08-16 22:05:27 +02:00
|
|
|
Config: testAccCheckAwsElbServiceAccountConfig,
|
|
|
|
Check: resource.ComposeTestCheckFunc(
|
|
|
|
resource.TestCheckResourceAttr("data.aws_elb_service_account.main", "id", "797873946194"),
|
2016-09-11 20:13:58 +02:00
|
|
|
resource.TestCheckResourceAttr("data.aws_elb_service_account.main", "arn", "arn:aws:iam::797873946194:root"),
|
2016-08-16 22:05:27 +02:00
|
|
|
),
|
|
|
|
},
|
2017-01-23 17:30:28 +01:00
|
|
|
{
|
2016-08-16 22:05:27 +02:00
|
|
|
Config: testAccCheckAwsElbServiceAccountExplicitRegionConfig,
|
|
|
|
Check: resource.ComposeTestCheckFunc(
|
|
|
|
resource.TestCheckResourceAttr("data.aws_elb_service_account.regional", "id", "156460612806"),
|
2016-09-11 20:13:58 +02:00
|
|
|
resource.TestCheckResourceAttr("data.aws_elb_service_account.regional", "arn", "arn:aws:iam::156460612806:root"),
|
2016-08-16 22:05:27 +02:00
|
|
|
),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
const testAccCheckAwsElbServiceAccountConfig = `
|
|
|
|
data "aws_elb_service_account" "main" { }
|
|
|
|
`
|
|
|
|
|
|
|
|
const testAccCheckAwsElbServiceAccountExplicitRegionConfig = `
|
|
|
|
data "aws_elb_service_account" "regional" {
|
|
|
|
region = "eu-west-1"
|
|
|
|
}
|
|
|
|
`
|