Skip to content

Commit

Permalink
ipam/pool_cidr_allocation: regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Sep 8, 2023
1 parent 6b1bee6 commit ae580ad
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/service/ec2/ipam_pool_cidr_allocation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ func TestAccIPAMPoolCIDRAllocation_multiple(t *testing.T) {
testAccCheckIPAMPoolCIDRAllocationExists(ctx, resourceName, &allocation1),
testAccCheckIPAMPoolCIDRAllocationExists(ctx, resourceName2, &allocation2),
resource.TestCheckResourceAttr(resourceName, "cidr", cidr1),
resource.TestMatchResourceAttr(resourceName, "id", regexache.MustCompile(`^ipam-pool-alloc-[a-f\d]+_ipam-pool(-[a-f\d]+)$`)),
resource.TestMatchResourceAttr(resourceName, "ipam_pool_allocation_id", regexache.MustCompile(`^ipam-pool-alloc-[a-f\d]+$`)),
resource.TestMatchResourceAttr(resourceName, "id", regexache.MustCompile(`^ipam-pool-alloc-[0-9a-f]+_ipam-pool(-[0-9a-f]+)$`)),
resource.TestMatchResourceAttr(resourceName, "ipam_pool_allocation_id", regexache.MustCompile(`^ipam-pool-alloc-[0-9a-f]+$`)),
resource.TestCheckResourceAttrPair(resourceName, "ipam_pool_id", "aws_vpc_ipam_pool.test", "id"),
resource.TestCheckResourceAttr(resourceName2, "cidr", cidr2),
resource.TestMatchResourceAttr(resourceName2, "id", regexache.MustCompile(`^ipam-pool-alloc-[a-f\d]+_ipam-pool(-[a-f\d]+)$`)),
resource.TestMatchResourceAttr(resourceName2, "ipam_pool_allocation_id", regexache.MustCompile(`^ipam-pool-alloc-[a-f\d]+$`)),
resource.TestMatchResourceAttr(resourceName2, "id", regexache.MustCompile(`^ipam-pool-alloc-[0-9a-f]+_ipam-pool(-[0-9a-f]+)$`)),
resource.TestMatchResourceAttr(resourceName2, "ipam_pool_allocation_id", regexache.MustCompile(`^ipam-pool-alloc-[0-9a-f]+$`)),
resource.TestCheckResourceAttrPair(resourceName2, "ipam_pool_id", "aws_vpc_ipam_pool.test", "id"),
),
},
Expand Down Expand Up @@ -199,8 +199,8 @@ func TestAccIPAMPoolCIDRAllocation_differentRegion(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccCheckIPAMPoolCIDRAllocationExistsWithProvider(ctx, resourceName, &allocation, acctest.RegionProviderFunc(acctest.AlternateRegion(), &providers)),
resource.TestCheckResourceAttr(resourceName, "cidr", cidr),
resource.TestMatchResourceAttr(resourceName, "id", regexache.MustCompile(`^ipam-pool-alloc-[a-f\d]+_ipam-pool(-[a-f\d]+)$`)),
resource.TestMatchResourceAttr(resourceName, "ipam_pool_allocation_id", regexache.MustCompile(`^ipam-pool-alloc-[a-f\d]+$`)),
resource.TestMatchResourceAttr(resourceName, "id", regexache.MustCompile(`^ipam-pool-alloc-[0-9a-f]+_ipam-pool(-[0-9a-f]+)$`)),
resource.TestMatchResourceAttr(resourceName, "ipam_pool_allocation_id", regexache.MustCompile(`^ipam-pool-alloc-[0-9a-f]+$`)),
resource.TestCheckResourceAttrPair(resourceName, "ipam_pool_id", "aws_vpc_ipam_pool.test", "id"),
),
},
Expand Down

0 comments on commit ae580ad

Please sign in to comment.