|
1 | 1 | # @guardian/cdk |
2 | 2 |
|
| 3 | +## 64.0.0 |
| 4 | + |
| 5 | +### Major Changes |
| 6 | + |
| 7 | +- d880b52: Implement `GuParameterStoreReadPolicy` as a singleton to support `GuLoadBalancedAppExperimental` instantiating it once for the EC2 app and once for the ECS app. |
| 8 | + The result is a single `AWS::IAM::Policy` resource in the CloudFormation template, which is attached to both the EC2 and ECS roles, keeping the diff small. |
| 9 | + |
| 10 | + A [GitHub search](https://github.com/search?q=org%3Aguardian+GuParameterStoreReadPolicy+NOT+repo%3Aguardian%2Fcdk++NOT+is%3Aarchived&type=code) shows `GuParameterStoreReadPolicy` is never directly instantiated by clients. |
| 11 | + |
| 12 | +- 348cc70: Removes the `roleConfiguration` property when instantiating a `GuEc2App` or `GuLoadBalancedAppExperimental` in favour of declaring `additionalPolicies` as a top level property. |
| 13 | + As a consequence, it is no longer possible to opt-out of log shipping with `withoutLogShipping`; the IAM Policy will always grant PutRecord to the account's logging Kinesis stream. |
| 14 | + |
| 15 | + To migrate, remove the `roleConfiguration` property and move any policies declared in `roleConfiguration.additionalPolicies` to the top level `additionalPolicies` property: |
| 16 | + |
| 17 | + ```ts |
| 18 | + // Before |
| 19 | + new GuEc2App(this, { |
| 20 | + // other props |
| 21 | + roleConfiguration: { |
| 22 | + additionalPolicies: [ |
| 23 | + new GuAllowPolicy(this, "AllowPolicyCloudwatchLogs", { |
| 24 | + actions: ["cloudwatch:*", "logs:*"], |
| 25 | + resources: ["*"], |
| 26 | + }), |
| 27 | + new GuAllowPolicy(this, "AllowPolicyDescribeDecryptKms", { |
| 28 | + actions: ["kms:Decrypt", "kms:DescribeKey"], |
| 29 | + resources: [`arn:aws:kms:${region}:${account}:FrontendConfigKey`], |
| 30 | + }), |
| 31 | + ], |
| 32 | + }, |
| 33 | + }); |
| 34 | + |
| 35 | + // After |
| 36 | + new GuEc2App(this, { |
| 37 | + // other props |
| 38 | + additionalPolicies: [ |
| 39 | + new GuAllowPolicy(this, "AllowPolicyCloudwatchLogs", { |
| 40 | + actions: ["cloudwatch:*", "logs:*"], |
| 41 | + resources: ["*"], |
| 42 | + }), |
| 43 | + new GuAllowPolicy(this, "AllowPolicyDescribeDecryptKms", { |
| 44 | + actions: ["kms:Decrypt", "kms:DescribeKey"], |
| 45 | + resources: [`arn:aws:kms:${region}:${account}:FrontendConfigKey`], |
| 46 | + }), |
| 47 | + ], |
| 48 | + }); |
| 49 | + ``` |
| 50 | + |
| 51 | + A [GitHub search](https://github.com/search?q=org%3Aguardian+withoutLogShipping+NOT+repo%3Aguardian%2Fcdk++NOT+is%3Aarchived+NOT+repo%3Aguardian%2Faws-account-setup&type=code) |
| 52 | + shows the `withoutLogShipping` property is never set by clients when instantiating a `GuEc2App` or `GuLoadBalancedAppExperimental`. |
| 53 | + |
| 54 | +### Minor Changes |
| 55 | + |
| 56 | +- b97db0e: Apply `additionalPolicies` to ECS task role created for `GuLoadBalancedAppExperimental` so the ECS task role inherits any custom permissions needed to run the application. |
| 57 | + These are already applied to the EC2 instance role. |
| 58 | + |
3 | 59 | ## 63.6.2 |
4 | 60 |
|
5 | 61 | ### Patch Changes |
|
0 commit comments