provider/aws: Improve test for VPC-based Lambda func

This commit is contained in:
Radek Simko 2016-04-13 14:45:47 +01:00
parent 9c236e7508
commit 3f188d5d1b
1 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"path/filepath" "path/filepath"
"regexp"
"strings" "strings"
"testing" "testing"
@ -51,6 +52,10 @@ func TestAccAWSLambdaFunction_VPC(t *testing.T) {
testAccCheckAwsLambdaFunctionName(&conf, "example_lambda_name"), testAccCheckAwsLambdaFunctionName(&conf, "example_lambda_name"),
testAccCheckAwsLambdaFunctionArnHasSuffix(&conf, ":example_lambda_name"), testAccCheckAwsLambdaFunctionArnHasSuffix(&conf, ":example_lambda_name"),
testAccCheckAWSLambdaFunctionVersion(&conf, "$LATEST"), 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-")),
), ),
}, },
}, },