diff --git a/builtin/providers/aws/resource_aws_lambda_event_source_mapping_test.go b/builtin/providers/aws/resource_aws_lambda_event_source_mapping_test.go index 15ca56ac79f4..59fe5b56e6d0 100644 --- a/builtin/providers/aws/resource_aws_lambda_event_source_mapping_test.go +++ b/builtin/providers/aws/resource_aws_lambda_event_source_mapping_test.go @@ -2,6 +2,8 @@ package aws import ( "fmt" + "regexp" + "strconv" "testing" "github.com/aws/aws-sdk-go/aws" @@ -25,6 +27,23 @@ func TestAccAWSLambdaEventSourceMapping_basic(t *testing.T) { testAccCheckAWSLambdaEventSourceMappingAttributes(&conf), ), }, + resource.TestStep{ + Config: testAccAWSLambdaEventSourceMappingConfigUpdate, + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaEventSourceMappingExists("aws_lambda_event_source_mapping.lambda_event_source_mapping_test", &conf), + resource.TestCheckResourceAttr("aws_lambda_event_source_mapping.lambda_event_source_mapping_test", + "batch_size", + strconv.Itoa(200)), + resource.TestCheckResourceAttr("aws_lambda_event_source_mapping.lambda_event_source_mapping_test", + "enabled", + strconv.FormatBool(false)), + resource.TestMatchResourceAttr( + "aws_lambda_event_source_mapping.lambda_event_source_mapping_test", + "function_arn", + regexp.MustCompile("example_lambda_name_update$"), + ), + ), + }, }, }) } @@ -94,7 +113,7 @@ func testAccCheckAWSLambdaEventSourceMappingAttributes(mapping *lambda.EventSour const testAccAWSLambdaEventSourceMappingConfig = ` resource "aws_iam_role" "iam_for_lambda" { name = "iam_for_lambda" - assume_role_policy = <