Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/plain-colts-jam.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@guardian/cdk": minor
---

Update the `GuParameterStoreReadPolicy` construct to remove the hard-coded `PolicyName` property.
This allows the `GuParameterStoreReadPolicy` singleton to be instantiated multiple times in a single `GuStack` when there are multiple apps.
1 change: 0 additions & 1 deletion src/constructs/iam/policies/parameter-store-read.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ describe("GuParameterStoreReadPolicy", () => {
Template.fromStack(stack).resourceCountIs("AWS::IAM::Policy", 1);

Template.fromStack(stack).hasResourceProperties("AWS::IAM::Policy", {
PolicyName: "parameter-store-read-policy",
PolicyDocument: {
Version: "2012-10-17",
Statement: [
Expand Down
1 change: 0 additions & 1 deletion src/constructs/iam/policies/parameter-store-read.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export class GuParameterStoreReadPolicy extends GuAppAwareConstruct(GuPolicy) {

private constructor(scope: GuStack, props: AppIdentity) {
super(scope, "ParameterStoreRead", {
policyName: "parameter-store-read-policy",
statements: [new ReadParametersByPath(scope, props), new ReadParametersByName(scope, props)],
...props,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ exports[`The GuInstanceRole construct should allow additional policies to be spe
],
"Version": "2012-10-17",
},
"PolicyName": "parameter-store-read-policy",
"PolicyName": "ParameterStoreReadTesting0F3B634A",
"Roles": [
{
"Ref": "InstanceRoleTestingCB7BD146",
Expand Down Expand Up @@ -541,7 +541,7 @@ exports[`The GuInstanceRole construct should be possible to create multiple inst
],
"Version": "2012-10-17",
},
"PolicyName": "parameter-store-read-policy",
"PolicyName": "ParameterStoreReadMyfirstappE5C5C329",
"Roles": [
{
"Ref": "InstanceRoleMyfirstapp5C11A22B",
Expand Down Expand Up @@ -600,7 +600,7 @@ exports[`The GuInstanceRole construct should be possible to create multiple inst
],
"Version": "2012-10-17",
},
"PolicyName": "parameter-store-read-policy",
"PolicyName": "ParameterStoreReadMysecondapp76C0E32C",
"Roles": [
{
"Ref": "InstanceRoleMysecondapp48DD15D7",
Expand Down Expand Up @@ -871,7 +871,7 @@ exports[`The GuInstanceRole construct should create an additional logging policy
],
"Version": "2012-10-17",
},
"PolicyName": "parameter-store-read-policy",
"PolicyName": "ParameterStoreReadTesting0F3B634A",
"Roles": [
{
"Ref": "InstanceRoleTestingCB7BD146",
Expand Down Expand Up @@ -1090,7 +1090,7 @@ exports[`The GuInstanceRole construct should create the correct resources with m
],
"Version": "2012-10-17",
},
"PolicyName": "parameter-store-read-policy",
"PolicyName": "ParameterStoreReadTesting0F3B634A",
"Roles": [
{
"Ref": "InstanceRoleTestingCB7BD146",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ exports[`The GuEc2AppExperimental pattern matches the snapshot 1`] = `
],
"Version": "2012-10-17",
},
"PolicyName": "parameter-store-read-policy",
"PolicyName": "ParameterStoreReadTestguec2app072DCDE1",
"Roles": [
{
"Ref": "InstanceRoleTestguec2appC325BE42",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ exports[`the GuLoadBalancedAppExperimental pattern should support all existing G
],
"Version": "2012-10-17",
},
"PolicyName": "parameter-store-read-policy",
"PolicyName": "ParameterStoreReadTestguec2app072DCDE1",
"Roles": [
{
"Ref": "InstanceRoleTestguec2appC325BE42",
Expand Down Expand Up @@ -1463,7 +1463,7 @@ exports[`the GuLoadBalancedAppExperimental pattern should support all existing G
],
"Version": "2012-10-17",
},
"PolicyName": "parameter-store-read-policy",
"PolicyName": "ParameterStoreReadTestgu2D9B3F35",
"Roles": [
{
"Ref": "InstanceRoleTestguD5DB5D23",
Expand Down Expand Up @@ -2337,7 +2337,7 @@ exports[`the GuLoadBalancedAppExperimental pattern should support experimental E
],
"Version": "2012-10-17",
},
"PolicyName": "parameter-store-read-policy",
"PolicyName": "ParameterStoreReadTestgu2D9B3F35",
"Roles": [
{
"Ref": "InstanceRoleTestguD5DB5D23",
Expand Down Expand Up @@ -3519,7 +3519,7 @@ exports[`the GuLoadBalancedAppExperimental pattern should support new ECS and hy
],
"Version": "2012-10-17",
},
"PolicyName": "parameter-store-read-policy",
"PolicyName": "ParameterStoreReadTestgu2D9B3F35",
"Roles": [
{
"Ref": "EcsTaskDefinitionTaskRoleB7B6D8DD",
Expand Down
4 changes: 2 additions & 2 deletions src/patterns/ec2-app/__snapshots__/base.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ exports[`the GuEC2App pattern can produce a restricted EC2 app locked to specifi
],
"Version": "2012-10-17",
},
"PolicyName": "parameter-store-read-policy",
"PolicyName": "ParameterStoreReadTestguec2app072DCDE1",
"Roles": [
{
"Ref": "InstanceRoleTestguec2appC325BE42",
Expand Down Expand Up @@ -1463,7 +1463,7 @@ exports[`the GuEC2App pattern should produce a functional EC2 app with minimal a
],
"Version": "2012-10-17",
},
"PolicyName": "parameter-store-read-policy",
"PolicyName": "ParameterStoreReadTestguec2app072DCDE1",
"Roles": [
{
"Ref": "InstanceRoleTestguec2appC325BE42",
Expand Down