diff --git a/builtin/providers/aws/resource_aws_lambda_function_test.go b/builtin/providers/aws/resource_aws_lambda_function_test.go index 1530ec34a..abfc40ae8 100644 --- a/builtin/providers/aws/resource_aws_lambda_function_test.go +++ b/builtin/providers/aws/resource_aws_lambda_function_test.go @@ -6,6 +6,7 @@ import ( "io/ioutil" "os" "path/filepath" + "regexp" "strings" "testing" @@ -51,6 +52,10 @@ func TestAccAWSLambdaFunction_VPC(t *testing.T) { testAccCheckAwsLambdaFunctionName(&conf, "example_lambda_name"), testAccCheckAwsLambdaFunctionArnHasSuffix(&conf, ":example_lambda_name"), testAccCheckAWSLambdaFunctionVersion(&conf, "$LATEST"), + resource.TestCheckResourceAttr("aws_lambda_function.lambda_function_test", "vpc_config.#", "1"), + resource.TestCheckResourceAttr("aws_lambda_function.lambda_function_test", "vpc_config.0.subnet_ids.#", "1"), + resource.TestCheckResourceAttr("aws_lambda_function.lambda_function_test", "vpc_config.0.security_group_ids.#", "1"), + resource.TestMatchResourceAttr("aws_lambda_function.lambda_function_test", "vpc_config.0.vpc_id", regexp.MustCompile("^vpc-")), ), }, },