Skip to content

Commit 1824bae

Browse files
committed
docs: Add changeset
1 parent 7918096 commit 1824bae

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
"@guardian/cdk": patch
3+
---
4+
5+
Correctly validate stack existence when instantiating a `RiffRaffYamlFile` to generate `riff-raff.yaml`.
6+
7+
Given the below set of stacks, an `Error` will now be thrown as there is a missing instance of `MyDatabaseStack` for `CODE`.
8+
9+
```typescript
10+
new MyApplicationStack(app, "App-CODE-deploy", {
11+
env: {
12+
region: "eu-west-1",
13+
},
14+
stack: "deploy",
15+
stage: "CODE",
16+
});
17+
new MyApplicationStack(app, "App-PROD-deploy", {
18+
env: {
19+
region: "eu-west-1",
20+
},
21+
stack: "deploy",
22+
stage: "PROD",
23+
});
24+
25+
new MyDatabaseStack(app, "Database-PROD-deploy", {
26+
env: {
27+
region: "eu-west-1",
28+
},
29+
stack: "deploy",
30+
stage: "PROD",
31+
});
32+
```
33+
34+
Previously, the validation would incorrectly pass.
35+
36+
<details><summary>Invalid `riff-raff.yaml`</summary>
37+
<p>
38+
39+
```yaml
40+
allowedStages:
41+
- CODE
42+
- PROD
43+
deployments:
44+
cfn-eu-west-1-deploy-my-application-stack:
45+
type: cloud-formation
46+
regions:
47+
- eu-west-1
48+
stacks:
49+
- deploy
50+
app: my-application-stack
51+
contentDirectory: /private/var/folders/0_/pvjwppsx5cl19t4n6_rmm_y80000gp/T/cdk.out9xIUJu
52+
parameters:
53+
templateStagePaths:
54+
CODE: App-CODE-deploy.template.json
55+
PROD: App-PROD-deploy.template.json
56+
cfn-eu-west-1-deploy-my-database-stack:
57+
type: cloud-formation
58+
regions:
59+
- eu-west-1
60+
stacks:
61+
- deploy
62+
app: my-database-stack
63+
contentDirectory: /private/var/folders/0_/pvjwppsx5cl19t4n6_rmm_y80000gp/T/cdk.out9xIUJu
64+
parameters:
65+
templateStagePaths:
66+
PROD: Database-PROD-deploy.template.json
67+
```
68+
69+
</p>
70+
</details>

0 commit comments

Comments
 (0)