Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions src/resources/Api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,23 +277,25 @@ export class Api {

merge(resources, {
[domainRoute53Record]: {
Type: 'AWS::Route53::RecordSet',
Type: 'AWS::Route53::RecordSetGroup',
DeletionPolicy: domain.retain ? 'Retain' : 'Delete',
Properties: {
...(domain.hostedZoneId
? { HostedZoneId: domain.hostedZoneId }
: { HostedZoneName: hostedZoneName }),
Name: domain.name,
Type: 'A',
AliasTarget: {
HostedZoneId: {
'Fn::GetAtt': [domainNameLogicalId, 'HostedZoneId'],
},
DNSName: {
'Fn::GetAtt': [domainNameLogicalId, 'AppSyncDomainName'],
},
EvaluateTargetHealth: false,
},
RecordSets: ['A', 'AAAA'].map(Type => ({
Name: domain.name,
Type,
AliasTarget: {
HostedZoneId: {
'Fn::GetAtt': [domainNameLogicalId, 'HostedZoneId'],
},
DNSName: {
'Fn::GetAtt': [domainNameLogicalId, 'AppSyncDomainName'],
},
EvaluateTargetHealth: false,
}
}))
Comment on lines +286 to +298

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Fix formatting issues to pass linter.

The arrow function and object literals have formatting issues that will cause prettier/linting to fail:

  • Line 286: Arrow function parameter needs parentheses
  • Lines 297-298: Missing trailing commas
🔧 Proposed fix for formatting
-            RecordSets: ['A', 'AAAA'].map(Type => ({
+            RecordSets: ['A', 'AAAA'].map((Type) => ({
               Name: domain.name,
               Type,
               AliasTarget: {
                 HostedZoneId: {
                   'Fn::GetAtt': [domainNameLogicalId, 'HostedZoneId'],
                 },
                 DNSName: {
                   'Fn::GetAtt': [domainNameLogicalId, 'AppSyncDomainName'],
                 },
-                EvaluateTargetHealth: false,
-              }
-            }))
+                EvaluateTargetHealth: false,
+              },
+            })),
           },

As per coding guidelines, the static analysis hints indicate these formatting violations must be addressed.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
RecordSets: ['A', 'AAAA'].map(Type => ({
Name: domain.name,
Type,
AliasTarget: {
HostedZoneId: {
'Fn::GetAtt': [domainNameLogicalId, 'HostedZoneId'],
},
DNSName: {
'Fn::GetAtt': [domainNameLogicalId, 'AppSyncDomainName'],
},
EvaluateTargetHealth: false,
}
}))
RecordSets: ['A', 'AAAA'].map((Type) => ({
Name: domain.name,
Type,
AliasTarget: {
HostedZoneId: {
'Fn::GetAtt': [domainNameLogicalId, 'HostedZoneId'],
},
DNSName: {
'Fn::GetAtt': [domainNameLogicalId, 'AppSyncDomainName'],
},
EvaluateTargetHealth: false,
},
})),
🧰 Tools
🪛 ESLint

[error] 286-286: Replace Type with (Type)

(prettier/prettier)


[error] 297-297: Insert ,

(prettier/prettier)


[error] 298-298: Insert ,

(prettier/prettier)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/resources/Api.ts` around lines 286 - 298, The RecordSets mapping has lint
failures: change the arrow callback parameter to use parentheses in the map
(i.e. use (Type) => ...) and ensure trailing commas are added for the object
literals returned by the map — add a trailing comma after the AliasTarget object
literal and after the mapped record object so the RecordSets array elements and
nested objects end with commas (references: RecordSets, the map callback Type,
domain.name, domainNameLogicalId, AppSyncDomainName, HostedZoneId,
EvaluateTargetHealth).

},
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/resources/Naming.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class Naming {
}

getDomainReoute53RecordLogicalId() {
return this.getLogicalId(`GraphQlDomainRoute53Record`);
return this.getLogicalId(`GraphQlDomainRoute53Records`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Breaking change: Logical ID modification will replace Route53 records.

Changing the CloudFormation logical ID from GraphQlDomainRoute53Record to GraphQlDomainRoute53Records will cause CloudFormation to replace the Route53 resource during stack updates. This means:

  1. A new RecordSetGroup will be created
  2. The old RecordSet will be deleted
  3. Brief DNS propagation delays may occur during the transition

This is intentional to switch from AWS::Route53::RecordSet to AWS::Route53::RecordSetGroup, but users upgrading to this version should be aware of potential brief DNS disruption.

Recommendation: Document this breaking change in the PR description, changelog, or migration guide so users can plan the upgrade during a maintenance window if needed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/resources/Naming.ts` at line 39, The change of the CloudFormation logical
ID from GraphQlDomainRoute53Record to GraphQlDomainRoute53Records (in the return
of getLogicalId) will force replacement of the Route53 resource (switching from
AWS::Route53::RecordSet to AWS::Route53::RecordSetGroup) and can cause brief DNS
disruption; update the PR description, changelog, and migration guide to clearly
call out this breaking change, list the exact symbols affected
(GraphQlDomainRoute53Record -> GraphQlDomainRoute53Records and the getLogicalId
usage), describe the replacement behavior and expected DNS propagation delay,
and recommend that users plan upgrades during a maintenance window.

}

getLogGroupLogicalId() {
Expand Down