Skip to content

Commit c79eb8f

Browse files
authored
Merge pull request #2224 from guardian/changeset-release/main
🦋 Release package updates
2 parents 5aaef93 + 9d4a27d commit c79eb8f

File tree

3 files changed

+85
-83
lines changed

3 files changed

+85
-83
lines changed

Diff for: .changeset/moody-needles-end.md

-82
This file was deleted.

Diff for: CHANGELOG.md

+84
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,89 @@
11
# @guardian/cdk
22

3+
## 54.0.0
4+
5+
### Major Changes
6+
7+
- 4548884: This change includes some potentially breaking changes for consumers of:
8+
9+
- [`GuEc2App`](https://guardian.github.io/cdk/classes/patterns.GuEc2App.html)
10+
- [`GuPlayApp`](https://guardian.github.io/cdk/classes/patterns.GuPlayApp.html) (a subclass of `GuEc2App`)
11+
- [`GuPlayWorkerApp`](https://guardian.github.io/cdk/classes/patterns.GuPlayWorkerApp.html) (a subclass of `GuEc2App`)
12+
- [`GuNodeApp`](https://guardian.github.io/cdk/classes/patterns.GuNodeApp.html) (a subclass of `GuEc2App`)
13+
14+
Since [v49.0.2](https://github.com/guardian/cdk/releases/tag/v49.0.2),
15+
the EC2 instance profile created in `GuEc2App`, and it's subclasses,
16+
used the [`AmazonSSMManagedInstanceCore`](https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonSSMManagedInstanceCore.html) AWS Managed Policy
17+
to enable the [SSM+SSH capability](https://github.com/guardian/ssm-scala?tab=readme-ov-file#in-aws).
18+
19+
In addition to enabling SSM+SSH, this Managed Policy also provided read access to all SSM Parameters.
20+
This is not least privilege.
21+
22+
In this version, usage of the `AmazonSSMManagedInstanceCore` Managed Policy is swapped for a custom,
23+
more minimal, policy.
24+
25+
> [!IMPORTANT]
26+
> Before upgrading to this version,
27+
> ensure your application is not relying on the IAM Policy behaviour provided by `AmazonSSMManagedInstanceCore`.
28+
29+
If your application is reading SSM Parameters outside the `/STAGE/STACK/APP/*` namespace,
30+
you will need to add an explicit policy.
31+
32+
An IAM Policy to read SSM Parameters in the `/STAGE/STACK/APP/*` namespace is already provided by the `GuEc2App` construct,
33+
via [`GuParameterStoreReadPolicy`](https://guardian.github.io/cdk/classes/constructs_iam.GuParameterStoreReadPolicy.html)
34+
35+
To understand if your application is impacted,
36+
consult [this Service Catalogue query](https://metrics.gutools.co.uk/goto/KZhWJVoIg?orgId=1)
37+
showing CloudFormation stacks using the above _and_ using GuCDK v49.0.2 or above.
38+
39+
<details><summary>Query ran in Service Catalogue</summary>
40+
<p>
41+
42+
```sql
43+
with data as (
44+
select cfn.account_id
45+
, acc.name as account_name
46+
, tml.stack_id
47+
, cfn.last_updated_time
48+
, cfn.region
49+
, cfn.stack_name
50+
, tml.metadata ->> 'gu:cdk:version' as gucdk_version
51+
, cfn.tags ->> 'gu:repo' as repository
52+
, cfn.tags ->> 'Stack' as stack
53+
, cfn.tags ->> 'Stage' as stage
54+
, cfn.tags ->> 'App' as app
55+
from aws_cloudformation_template_summaries tml
56+
join aws_accounts acc on tml.account_id = acc.id
57+
join aws_cloudformation_stacks cfn on tml.stack_arn = cfn.arn
58+
where tml.metadata is not null
59+
and (
60+
(metadata -> 'gu:cdk:constructs')::jsonb ? 'GuEc2App'
61+
OR (metadata -> 'gu:cdk:constructs')::jsonb ? 'GuPlayApp'
62+
OR (metadata -> 'gu:cdk:constructs')::jsonb ? 'GuPlayWorkerApp'
63+
OR (metadata -> 'gu:cdk:constructs')::jsonb ? 'GuNodeApp'
64+
)
65+
),
66+
ownership as (
67+
select distinct full_name
68+
, galaxies_team
69+
, team_contact_email
70+
from view_repo_ownership
71+
where galaxies_team is not null
72+
and team_contact_email is not null
73+
)
74+
75+
select data.*
76+
, ownership.galaxies_team
77+
, ownership.team_contact_email
78+
from data
79+
left join ownership on data.repository = ownership.full_name
80+
where gucdk_version like '49%' -- affected version is 49.0.2 onwards, so this will catch some extra stacks, but hopefully not too many!
81+
OR gucdk_version like '5%';
82+
```
83+
84+
</p>
85+
</details>
86+
387
## 53.1.1
488

589
### Patch Changes

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@guardian/cdk",
33
"description": "Generic Guardian flavoured AWS CDK components",
4-
"version": "53.1.1",
4+
"version": "54.0.0",
55
"main": "lib/index.js",
66
"types": "lib/index.d.ts",
77
"files": [

0 commit comments

Comments
 (0)