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

     1  package aws
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/aws/aws-sdk-go/service/ec2"
     7  	"github.com/hashicorp/terraform/helper/resource"
     8  )
     9  
    10  func TestAccAWSVPC_coreMismatchedDiffs(t *testing.T) {
    11  	var vpc ec2.Vpc
    12  
    13  	resource.Test(t, resource.TestCase{
    14  		PreCheck:     func() { testAccPreCheck(t) },
    15  		Providers:    testAccProviders,
    16  		CheckDestroy: testAccCheckVpcDestroy,
    17  		Steps: []resource.TestStep{
    18  			resource.TestStep{
    19  				Config: testMatchedDiffs,
    20  				Check: resource.ComposeTestCheckFunc(
    21  					testAccCheckVpcExists("aws_vpc.test", &vpc),
    22  					testAccCheckVpcCidr(&vpc, "10.0.0.0/16"),
    23  					resource.TestCheckResourceAttr(
    24  						"aws_vpc.test", "cidr_block", "10.0.0.0/16"),
    25  				),
    26  			},
    27  		},
    28  	})
    29  }
    30  
    31  const testMatchedDiffs = `resource "aws_vpc" "test" {
    32      cidr_block = "10.0.0.0/16"
    33  
    34      tags {
    35          Name = "Repro GH-4965"
    36      }
    37  
    38      lifecycle {
    39          ignore_changes = ["tags"]
    40      }
    41  }`