Skip to content

Conversation

@johnduffell
Copy link
Member

Following on from recent work to add a reusable SR domain construct #3106
and a reusable SR lambda construct

It appears that using them can reduce duplication and make our stacks more readable and consistent.

It also means that changes e.g. adding en environment variable to tell node to use source maps, would be a one liner.

This PR moves a bunch more stacks over to use the above constructs.

Comment on lines -141 to -154
new StripeDisputes(app, 'stripe-disputes-CODE', {
stack: 'support',
stage: 'CODE',
domainName: `stripe-disputes-code.${supportApisDomain}`,
hostedZoneId: supportHostedZoneId,
certificateId: supportCertificateId,
});
new StripeDisputes(app, 'stripe-disputes-PROD', {
stack: 'support',
stage: 'PROD',
domainName: `stripe-disputes.${supportApisDomain}`,
hostedZoneId: supportHostedZoneId,
certificateId: supportCertificateId,
});
Copy link
Member Author

Choose a reason for hiding this comment

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

it's better not to repeart the parameters every time here and in the tests, as they're more likely to get mixed up, now the stacks are constructed with a standard incantation above

Comment on lines +286 to +287
new MetricPushApi(app, 'CODE', 'membership-CODE-metric-push-api');
new MetricPushApi(app, 'PROD', 'membership-PROD-metric-push-api');
Copy link
Member Author

Choose a reason for hiding this comment

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

not sure why this needs a specific stack name, but I kept it just in case

new MParticleApi(app, 'mparticle-api-PROD', {
stack: 'support',
stage: 'PROD',
});
Copy link
Member Author

@johnduffell johnduffell Oct 1, 2025

Choose a reason for hiding this comment

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

don't forget to load the "large diff"s below and review them all
(I will comment on the first instance of each interesting thing)

Comment on lines +94 to +97
{
"Key": "App",
"Value": "alarms-handler",
},
Copy link
Member Author

Choose a reason for hiding this comment

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

using SrStack ensures that everything is tagged correctly with the App, (this should happen anyway via riffraff/cfn, but GuCDK makes it explicit if it knows the app)

{
"Key": "Stack",
"Value": "membership",
"Value": "support",
Copy link
Member Author

Choose a reason for hiding this comment

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

as with most of the tests, for some reason it was passing in membership. Now it's not passed in at all so it is definitely consistent.

@johnduffell johnduffell force-pushed the jd/convert-more-stacks branch 2 times, most recently from 3cded12 to 73d2341 Compare October 1, 2025 20:08
},
"MetricPushDNSRecord": {
"Properties": {
"Comment": "CNAME for metric-push-api API CODE",
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think this comment goes anywhere, I was looking in AWS console and I couldn't see it

@johnduffell johnduffell force-pushed the jd/convert-more-stacks branch from 73d2341 to 5f8653a Compare October 1, 2025 22:04
"Comment": "CNAME for metric-push-api API CODE",
"HostedZoneName": "support.guardianapis.com.",
"Name": "metric-push-api-code.support.guardianapis.com",
"HostedZoneId": "Z1E4V12LQGXFEC",
Copy link
Member Author

Choose a reason for hiding this comment

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

some places use HostedZoneName and some HostedZoneId, better to be consistent

"Ref": "AWS::AccountId",
},
":certificate/b384a6a0-2f54-4874-b99b-96eeff96c009",
":certificate/c1efc564-9ff8-4a03-be48-d1990a3d79d2",
Copy link
Member Author

Choose a reason for hiding this comment

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

this was actually wrong in the snapshot
supportCertificateId instead of membershipCertificateId

"EvaluationPeriods": 1,
"MetricName": "5XXError",
"Namespace": "AWS/ApiGateway",
"Period": 60,
Copy link
Member Author

Choose a reason for hiding this comment

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

metric push API is a bit broken in that it was in membership stack but uses the support domain. I think it's best to make sure it's on support all throughout.

@johnduffell johnduffell force-pushed the jd/convert-more-stacks branch 2 times, most recently from dc49d0e to 8e9c8f5 Compare October 1, 2025 22:10
@johnduffell johnduffell force-pushed the jd/convert-more-stacks branch from 8e9c8f5 to 9c5f5e8 Compare October 2, 2025 12:04
# Conflicts:
#	cdk/lib/__snapshots__/stripe-disputes.test.ts.snap
#	cdk/lib/stripe-disputes.test.ts
#	cdk/lib/stripe-disputes.ts
@Reettaphant Reettaphant added maintenance Departmental tracking: maintenance work, not a fix or a feature and removed maintenance labels Oct 21, 2025
@johnduffell
Copy link
Member Author

closing as it was too big so I extracted plenty of smaller PRs from this one, whatever is left over is conflicting and unusable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Departmental tracking: maintenance work, not a fix or a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants