Skip to content

Commit

Permalink
Test for replica ARN
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Feb 9, 2023
1 parent d82bfe3 commit a7255be
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/service/dynamodb/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1587,6 +1587,10 @@ func TestAccDynamoDBTable_Replica_single(t *testing.T) {
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckInitialTableExists(ctx, resourceName, &conf),
resource.TestCheckResourceAttr(resourceName, "replica.#", "1"),
acctest.CheckResourceAttrRegionalARN(resourceName, "arn", "dynamodb", fmt.Sprintf("table/%s", rName)),
resource.TestMatchTypeSetElemNestedAttrs(resourceName, "replica.*", map[string]*regexp.Regexp{
"arn": regexp.MustCompile(fmt.Sprintf(`:dynamodb:%s:`, acctest.AlternateRegion())),
}),
),
},
{
Expand Down Expand Up @@ -2423,7 +2427,7 @@ func testAccCheckReplicaExists(ctx context.Context, n string, region string, v *
output, err := tfdynamodb.FindTableByName(ctx, conn, rs.Primary.ID)

if err != nil {
create.Error(names.DynamoDB, create.ErrActionChecking, tfdynamodb.ResNameTable, rs.Primary.ID, err)
return create.Error(names.DynamoDB, create.ErrActionChecking, tfdynamodb.ResNameTable, rs.Primary.ID, err)
}

*v = *output
Expand Down

0 comments on commit a7255be

Please sign in to comment.