Skip to content

Commit cc998ff

Browse files
committed
stack/app name
1 parent 90d60ec commit cc998ff

File tree

4 files changed

+23
-31
lines changed

4 files changed

+23
-31
lines changed

ab-testing/cdk/bin/cdk.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import "source-map-support/register.js";
22
import { RiffRaffYamlFile } from "@guardian/cdk/lib/riff-raff-yaml-file/index.js";
33
import { App } from "aws-cdk-lib";
4-
import { DictionaryDeployLambda } from "../lib/dictionaryDeployLambda.ts";
4+
import { AbTestingStack } from "../lib/abTestingStack.ts";
55

66
const app = new App();
77

8-
const appName = "ab-testing-deploy";
8+
const appName = "ab-testing";
99

10-
new DictionaryDeployLambda(app, "DictionaryDeployLambdaCode", {
10+
new AbTestingStack(app, "AbTestingCode", {
1111
stack: "frontend",
1212
stage: "CODE",
1313
env: {
@@ -16,7 +16,7 @@ new DictionaryDeployLambda(app, "DictionaryDeployLambdaCode", {
1616
app: appName,
1717
});
1818

19-
new DictionaryDeployLambda(app, "DictionaryDeployLambdaProd", {
19+
new AbTestingStack(app, "AbTestingProd", {
2020
stack: "frontend",
2121
stage: "PROD",
2222
env: {
@@ -60,7 +60,7 @@ deployments.set("admin/ab-testing", {
6060

6161
// We need the test artifacts in place before deploying the lambda that uses them
6262
deployments
63-
.get(`cfn-eu-west-1-frontend-dictionary-deploy-lambda`)
63+
.get(`cfn-eu-west-1-frontend-ab-testing-stack`)
6464
?.dependencies?.push("config/ab-testing");
6565

6666
riffRaff.synth();

ab-testing/cdk/lib/dictionaryDeployLambda.test.ts renamed to ab-testing/cdk/lib/abTestingStack.test.ts

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { snapshot } from "node:test";
33
import { basename } from "path";
44
import { GuRoot } from "@guardian/cdk/lib/constructs/root.js";
55
import { Template } from "aws-cdk-lib/assertions";
6-
import { DictionaryDeployLambda } from "./dictionaryDeployLambda.ts";
6+
import { AbTestingStack } from "./abTestingStack.ts";
77

88
snapshot.setResolveSnapshotPath(
99
() =>
@@ -15,36 +15,28 @@ snapshot.setResolveSnapshotPath(
1515
void describe("The ID5 Baton Lambda stack", () => {
1616
void it("matches the CODE snapshot", ({ assert }) => {
1717
const app = new GuRoot();
18-
const stack = new DictionaryDeployLambda(
19-
app,
20-
"DictionaryDeployLambda",
21-
{
22-
stack: "frontend",
23-
stage: "CODE",
24-
env: {
25-
region: "eu-west-1",
26-
},
27-
app: "ab-testing-deploy",
18+
const stack = new AbTestingStack(app, "AbTestingStack", {
19+
stack: "frontend",
20+
stage: "CODE",
21+
env: {
22+
region: "eu-west-1",
2823
},
29-
);
24+
app: "ab-testing-deploy",
25+
});
3026
const template = Template.fromStack(stack);
3127
assert.snapshot(template.toJSON());
3228
});
3329

3430
void it("matches the PROD snapshot", ({ assert }) => {
3531
const app = new GuRoot();
36-
const stack = new DictionaryDeployLambda(
37-
app,
38-
"DictionaryDeployLambda",
39-
{
40-
stack: "frontend",
41-
stage: "PROD",
42-
env: {
43-
region: "eu-west-1",
44-
},
45-
app: "ab-testing-deploy",
32+
const stack = new AbTestingStack(app, "AbTestingStack", {
33+
stack: "frontend",
34+
stage: "PROD",
35+
env: {
36+
region: "eu-west-1",
4637
},
47-
);
38+
app: "ab-testing-deploy",
39+
});
4840
const template = Template.fromStack(stack);
4941
assert.snapshot(template.toJSON());
5042
});

ab-testing/cdk/lib/dictionaryDeployLambda.ts renamed to ab-testing/cdk/lib/abTestingStack.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type Props = GuStackProps & {
1111
app: string;
1212
};
1313

14-
export class DictionaryDeployLambda extends GuStack {
14+
export class AbTestingStack extends GuStack {
1515
constructor(scope: App, id: string, props: Props) {
1616
super(scope, id, props);
1717

ab-testing/dictionary-deploy-lambda/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const getSecureString = async (name: string) => {
2121

2222
const getFastlyConfig = async () => {
2323
const stringParam = await getSecureString(
24-
`/ab-testing-deploy/${process.env.STAGE}/fastly-ab-testing-config`,
24+
`/ab-testing/${process.env.STAGE}/fastly-config`,
2525
);
2626
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- empty string is invalid JSON too
2727
const json = JSON.parse(stringParam || "{}") as unknown;
@@ -37,7 +37,7 @@ export const handler: Handler = async (
3737
): Promise<void> => {
3838
try {
3939
const apiToken = await getSecureString(
40-
`/ab-testing-deploy/${process.env.STAGE}/fastly-api-token`,
40+
`/ab-testing/${process.env.STAGE}/fastly-api-token`,
4141
);
4242

4343
if (!apiToken) {

0 commit comments

Comments
 (0)