Skip to content

Commit 87f53c5

Browse files
authored
fix(type-safe-api): ensure uniqueness of waf web acl name (#752)
Fixes #750
1 parent 7afa3b7 commit 87f53c5

File tree

2 files changed

+124
-124
lines changed

2 files changed

+124
-124
lines changed

packages/type-safe-api/src/construct/waf/open-api-gateway-web-acl.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ export class OpenApiGatewayWebAcl extends Construct {
3333

3434
const aclName = `${PDKNag.getStackPrefix(Stack.of(this))
3535
.split("/")
36-
.join("-")}-${id}-WebAcl`;
36+
.join("-")}${id}-${this.node.addr.slice(-8)}`;
3737
const ipSetName = `${aclName}-IPSet`;
3838

3939
// Create the IP Set if requested
4040
this.ipSet = props.cidrAllowList
41-
? new CfnIPSet(this, "IPSet", {
41+
? new CfnIPSet(this, "ApiIPSet", {
4242
name: ipSetName,
4343
addresses: props.cidrAllowList.cidrRanges,
4444
ipAddressVersion: props.cidrAllowList.cidrType,
@@ -120,7 +120,7 @@ export class OpenApiGatewayWebAcl extends Construct {
120120
),
121121
];
122122

123-
this.webAcl = new CfnWebACL(this, "WebACL", {
123+
this.webAcl = new CfnWebACL(this, "ApiWebACL", {
124124
name: aclName,
125125
defaultAction: {
126126
// Allow by default, and use rules to deny unwanted requests

0 commit comments

Comments
 (0)