Skip to content

Commit

Permalink
Add test for lambda permission import
Browse files Browse the repository at this point in the history
  • Loading branch information
chaspy committed Jul 21, 2019
1 parent 0626a0b commit 973f7ed
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions aws/resource_aws_lambda_permission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ func TestAccAWSLambdaPermission_basic(t *testing.T) {
rString := acctest.RandString(8)
funcName := fmt.Sprintf("tf_acc_lambda_perm_basic_%s", rString)
roleName := fmt.Sprintf("tf_acc_role_lambda_perm_basic_%s", rString)
statementId := fmt.Sprintf("tf_acc_statement_lambda_perm_basic_%s", rString)
funcArnRe := regexp.MustCompile(":function:" + funcName + "$")

resource.ParallelTest(t, resource.TestCase{
Expand All @@ -188,6 +189,12 @@ func TestAccAWSLambdaPermission_basic(t *testing.T) {
resource.TestCheckResourceAttr("aws_lambda_permission.allow_cloudwatch", "event_source_token", "test-event-source-token"),
),
},
{
ResourceName: "aws_lambda_permission.allow_cloudwatch",
ImportState: true,
ImportStateId: fmt.Sprintf("%s/%s", funcName, statementId),
ImportStateVerify: true,
},
},
})
}
Expand Down

0 comments on commit 973f7ed

Please sign in to comment.