github.com/danp/terraform@v0.9.5-0.20170426144147-39d740081351/builtin/providers/aws/data_source_aws_redshift_service_account_test.go (about)

     1  package aws
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/hashicorp/terraform/helper/resource"
     7  )
     8  
     9  func TestAccAWSRedshiftServiceAccount_basic(t *testing.T) {
    10  	resource.Test(t, resource.TestCase{
    11  		PreCheck:  func() { testAccPreCheck(t) },
    12  		Providers: testAccProviders,
    13  		Steps: []resource.TestStep{
    14  			resource.TestStep{
    15  				Config: testAccCheckAwsRedshiftServiceAccountConfig,
    16  				Check: resource.ComposeTestCheckFunc(
    17  					resource.TestCheckResourceAttr("data.aws_redshift_service_account.main", "id", "902366379725"),
    18  				),
    19  			},
    20  			resource.TestStep{
    21  				Config: testAccCheckAwsRedshiftServiceAccountExplicitRegionConfig,
    22  				Check: resource.ComposeTestCheckFunc(
    23  					resource.TestCheckResourceAttr("data.aws_redshift_service_account.regional", "id", "210876761215"),
    24  				),
    25  			},
    26  		},
    27  	})
    28  }
    29  
    30  const testAccCheckAwsRedshiftServiceAccountConfig = `
    31  data "aws_redshift_service_account" "main" { }
    32  `
    33  
    34  const testAccCheckAwsRedshiftServiceAccountExplicitRegionConfig = `
    35  data "aws_redshift_service_account" "regional" {
    36  	region = "eu-west-1"
    37  }
    38  `