-
I updated my cdk-lib to version 2.118.0 and when I try to create dynamodb replicas, it gives me this error:
Has this happened to anyone else, do you know how to fix it? It should be noted that until version 2.110.0 - 2.115.0 this did not happen. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hello @racorrea! I've seen this error in other services. The root cause is that you reached the resource policy length limit. An option could be that you are using the default CloudWatch props for several StepFunctions. Then CDK re-uses the same policy, which leverages an extensive policy if you are deploying at an enterprise scale. You can identify the policy you're using with the AWS CLI:
Then, there are two options here:
|
Beta Was this translation helpful? Give feedback.
-
Hi @racorrea, Had the same issue. Solved it by using the class self.batch_table = dynamodb.Table(
self, "GlobalTable",
table_name=f"{stage_name}_global_table",
partition_key=dynamodb.Attribute(
name="global_table",
type=dynamodb.AttributeType.STRING
),
sort_key = dynamodb.Attribute(
name="sort_key",
type=dynamodb.AttributeType.STRING
),
billing_mode=dynamodb.BillingMode.PAY_PER_REQUEST,
removal_policy=RemovalPolicy.RETAIN if is_production else RemovalPolicy.DESTROY,
replication_regions=["us-east-1", "us-east-2"]
) to self.batch_table = dynamodb.TableV2(
self, "GlobalTable",
table_name=f"{stage_name}_global_table",
partition_key=dynamodb.Attribute(
name="global_table",
type=dynamodb.AttributeType.STRING
),
sort_key = dynamodb.Attribute(
name="sort_key",
type=dynamodb.AttributeType.STRING
),
billing=dynamodb.Billing.on_demand(),
removal_policy=RemovalPolicy.RETAIN if is_production else RemovalPolicy.DESTROY,
replicas=["us-east-1", "us-east-2"]
) |
Beta Was this translation helpful? Give feedback.
Hi @racorrea,
Had the same issue.
Solved it by using the class
dynamodb.TableV2
instead ofdynamodb.Table
. The change in my case was rather minimal, from