Commit 12f804c
committed
fix(dynamodb): use concrete ARN account/region when resourceName is tokenized
The previous broad `Token.isUnresolved(tableArn)` guard in
`validateMultiAccountReplica` skipped splitArn extraction whenever any
part of the source table ARN was tokenized, even if just the resourceName
was a token with concrete account and region components. This caused
`sourceAccount` and `sourceRegion` to fall back to the stack that owns
the imported resource (often the same as the replica stack), which
falsely triggered the `MultiAccountReplicaMustBeDifferentAccount` and
`MultiAccountReplicaMustBeDifferentRegion` errors for imported tables
whose ARN had a tokenized table name.
Now `splitArn` is always called and the extracted account/region are
used whenever they are concrete, falling back to the stack's values only
when the ARN's corresponding part is itself a token.
Closes #38354
🤖🤖🤖 Generated with AI - this code was authored with the help of an AI agent1 parent be92dbb commit 12f804c
2 files changed
Lines changed: 41 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1603 | 1603 | | |
1604 | 1604 | | |
1605 | 1605 | | |
1606 | | - | |
1607 | | - | |
1608 | | - | |
1609 | | - | |
1610 | | - | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
1611 | 1621 | | |
1612 | 1622 | | |
1613 | 1623 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4116 | 4116 | | |
4117 | 4117 | | |
4118 | 4118 | | |
| 4119 | + | |
| 4120 | + | |
| 4121 | + | |
| 4122 | + | |
| 4123 | + | |
| 4124 | + | |
| 4125 | + | |
| 4126 | + | |
| 4127 | + | |
| 4128 | + | |
| 4129 | + | |
| 4130 | + | |
| 4131 | + | |
| 4132 | + | |
| 4133 | + | |
| 4134 | + | |
| 4135 | + | |
| 4136 | + | |
| 4137 | + | |
| 4138 | + | |
| 4139 | + | |
| 4140 | + | |
| 4141 | + | |
| 4142 | + | |
| 4143 | + | |
| 4144 | + | |
4119 | 4145 | | |
4120 | 4146 | | |
4121 | 4147 | | |
| |||
0 commit comments