|
|
|
|
@ -9,7 +9,7 @@ import (
|
|
|
|
|
"github.com/mitchellh/goamz/rds"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestAccAWSDbSubnetGroup(t *testing.T) {
|
|
|
|
|
func TestAccAWSDBSubnetGroup(t *testing.T) {
|
|
|
|
|
var v rds.DBSubnetGroup
|
|
|
|
|
|
|
|
|
|
testCheck := func(*terraform.State) error {
|
|
|
|
|
@ -19,12 +19,12 @@ func TestAccAWSDbSubnetGroup(t *testing.T) {
|
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
|
|
|
Providers: testAccProviders,
|
|
|
|
|
CheckDestroy: testAccCheckDbSubnetGroupDestroy,
|
|
|
|
|
CheckDestroy: testAccCheckDBSubnetGroupDestroy,
|
|
|
|
|
Steps: []resource.TestStep{
|
|
|
|
|
resource.TestStep{
|
|
|
|
|
Config: testAccDbSubnetGroupConfig,
|
|
|
|
|
Config: testAccDBSubnetGroupConfig,
|
|
|
|
|
Check: resource.ComposeTestCheckFunc(
|
|
|
|
|
testAccCheckDbSubnetGroupExists(
|
|
|
|
|
testAccCheckDBSubnetGroupExists(
|
|
|
|
|
"aws_db_subnet_group.foo", &v),
|
|
|
|
|
testCheck,
|
|
|
|
|
),
|
|
|
|
|
@ -33,7 +33,7 @@ func TestAccAWSDbSubnetGroup(t *testing.T) {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func testAccCheckDbSubnetGroupDestroy(s *terraform.State) error {
|
|
|
|
|
func testAccCheckDBSubnetGroupDestroy(s *terraform.State) error {
|
|
|
|
|
conn := testAccProvider.Meta().(*AWSClient).rdsconn
|
|
|
|
|
|
|
|
|
|
for _, rs := range s.RootModule().Resources {
|
|
|
|
|
@ -64,7 +64,7 @@ func testAccCheckDbSubnetGroupDestroy(s *terraform.State) error {
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func testAccCheckDbSubnetGroupExists(n string, v *rds.DBSubnetGroup) resource.TestCheckFunc {
|
|
|
|
|
func testAccCheckDBSubnetGroupExists(n string, v *rds.DBSubnetGroup) resource.TestCheckFunc {
|
|
|
|
|
return func(s *terraform.State) error {
|
|
|
|
|
rs, ok := s.RootModule().Resources[n]
|
|
|
|
|
if !ok {
|
|
|
|
|
@ -90,18 +90,20 @@ func testAccCheckDbSubnetGroupExists(n string, v *rds.DBSubnetGroup) resource.Te
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const testAccDbSubnetGroupConfig = `
|
|
|
|
|
const testAccDBSubnetGroupConfig = `
|
|
|
|
|
resource "aws_vpc" "foo" {
|
|
|
|
|
cidr_block = "10.1.0.0/16"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resource "aws_subnet" "foo" {
|
|
|
|
|
cidr_block = "10.1.1.0/24"
|
|
|
|
|
availability_zone = "us-west-2a"
|
|
|
|
|
vpc_id = "${aws_vpc.foo.id}"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resource "aws_subnet" "bar" {
|
|
|
|
|
cidr_block = "10.1.2.0/24"
|
|
|
|
|
availability_zone = "us-west-2b"
|
|
|
|
|
vpc_id = "${aws_vpc.foo.id}"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|