diff --git a/builtin/providers/aws/resource_aws_iam_group_membership_test.go b/builtin/providers/aws/resource_aws_iam_group_membership_test.go index 9fd65b5a6..5b1930543 100644 --- a/builtin/providers/aws/resource_aws_iam_group_membership_test.go +++ b/builtin/providers/aws/resource_aws_iam_group_membership_test.go @@ -57,6 +57,26 @@ func TestAccAWSGroupMembership_basic(t *testing.T) { }) } +func TestAccAWSGroupMembership_paginatedUserList(t *testing.T) { + var group iam.GetGroupOutput + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSGroupMembershipDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAWSGroupMemberConfigPaginatedUserList, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGroupMembershipExists("aws_iam_group_membership.team", &group), + resource.TestCheckResourceAttr( + "aws_iam_group_membership.team", "users.#", "101"), + ), + }, + }, + }) +} + func testAccCheckAWSGroupMembershipDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).iamconn @@ -202,3 +222,22 @@ resource "aws_iam_group_membership" "team" { group = "${aws_iam_group.group.name}" } ` + +const testAccAWSGroupMemberConfigPaginatedUserList = ` +resource "aws_iam_group" "group" { + name = "test-paginated-group" + path = "/" +} + +resource "aws_iam_group_membership" "team" { + name = "tf-testing-paginated-group-membership" + users = ["${aws_iam_user.user.*.name}"] + group = "${aws_iam_group.group.name}" +} + +resource "aws_iam_user" "user" { + count = 101 + name = "${format("paged-test-user-%d", count.index + 1)}" + path = "/" +} +`