Skip to content

Commit

Permalink
update snapshots and associated ddb tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kenoir committed Sep 15, 2023
1 parent 0e463c3 commit 0a86d82
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 35 deletions.
6 changes: 0 additions & 6 deletions src/constructs/ecs/__snapshots__/ecs-task.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ exports[`The GuEcsTask pattern should create the correct resources with lots of
"ap-southeast-3": {
"states": "states.ap-southeast-3.amazonaws.com",
},
"ap-southeast-4": {
"states": "states.ap-southeast-4.amazonaws.com",
},
"ca-central-1": {
"states": "states.ca-central-1.amazonaws.com",
},
Expand Down Expand Up @@ -70,9 +67,6 @@ exports[`The GuEcsTask pattern should create the correct resources with lots of
"eu-west-3": {
"states": "states.eu-west-3.amazonaws.com",
},
"il-central-1": {
"states": "states.il-central-1.amazonaws.com",
},
"me-central-1": {
"states": "states.me-central-1.amazonaws.com",
},
Expand Down
6 changes: 0 additions & 6 deletions src/patterns/ec2-app/__snapshots__/base.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -830,9 +830,6 @@ exports[`the GuEC2App pattern can produce a restricted EC2 app locked to specifi
"Type": "AWS::EC2::SecurityGroupIngress",
},
"teststackTESTtestguec2appAA7F41BE": {
"DependsOn": [
"InstanceRoleTestguec2appC325BE42",
],
"Properties": {
"LaunchTemplateData": {
"IamInstanceProfile": {
Expand Down Expand Up @@ -1672,9 +1669,6 @@ exports[`the GuEC2App pattern should produce a functional EC2 app with minimal a
"Type": "AWS::EC2::SecurityGroupIngress",
},
"teststackTESTtestguec2appAA7F41BE": {
"DependsOn": [
"InstanceRoleTestguec2appC325BE42",
],
"Properties": {
"LaunchTemplateData": {
"IamInstanceProfile": {
Expand Down
64 changes: 41 additions & 23 deletions src/patterns/ec2-app/base.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,9 @@ describe("the GuEC2App pattern", function () {
},
monitoringConfiguration: { noMonitoring: true },
userData: "",
}),
})
).toThrowError(
"Restricted apps cannot be globally accessible. Adjust CIDR ranges (0.0.0.0/0, 1.2.3.4/32) or use Public.",
"Restricted apps cannot be globally accessible. Adjust CIDR ranges (0.0.0.0/0, 1.2.3.4/32) or use Public."
);
});

Expand All @@ -335,9 +335,9 @@ describe("the GuEC2App pattern", function () {
},
monitoringConfiguration: { noMonitoring: true },
userData: "",
}),
})
).toThrowError(
"Internal apps should only be accessible on 10. ranges. Adjust CIDR ranges (93.1.2.3/12) or use Restricted.",
"Internal apps should only be accessible on 10. ranges. Adjust CIDR ranges (93.1.2.3/12) or use Restricted."
);
});

Expand Down Expand Up @@ -406,22 +406,40 @@ describe("the GuEC2App pattern", function () {
{
Action: ["dynamodb:BatchWriteItem", "dynamodb:PutItem", "dynamodb:DeleteItem", "dynamodb:UpdateItem"],
Effect: "Allow",
Resource: {
"Fn::Join": [
"",
[
"arn:aws:dynamodb:",
{
Ref: "AWS::Region",
},
":",
{
Ref: "AWS::AccountId",
},
":table/my-dynamo-table",
Resource: [
{
"Fn::Join": [
"",
[
"arn:aws:dynamodb:",
{
Ref: "AWS::Region",
},
":",
{
Ref: "AWS::AccountId",
},
":table/my-dynamo-table",
],
],
],
},
},
{
"Fn::Join": [
"",
[
"arn:aws:dynamodb:",
{
Ref: "AWS::Region",
},
":",
{
Ref: "AWS::AccountId",
},
":table/my-dynamo-table/index/*",
],
],
},
],
},
],
},
Expand Down Expand Up @@ -729,7 +747,7 @@ describe("the GuEC2App pattern", function () {
});
}).toThrowError(
"Application logging has been enabled (via the `applicationLogging` prop) but your `roleConfiguration` sets " +
"`withoutLogShipping` to true. Please turn off application logging or remove `withoutLogShipping`",
"`withoutLogShipping` to true. Please turn off application logging or remove `withoutLogShipping`"
);
});

Expand Down Expand Up @@ -824,7 +842,7 @@ describe("the GuEC2App pattern", function () {
domain,
allowedGroups: [],
},
}),
})
).toThrowError("googleAuth.allowedGroups cannot be empty!");
});

Expand Down Expand Up @@ -854,7 +872,7 @@ describe("the GuEC2App pattern", function () {
domain,
sessionTimeoutInMinutes: 61,
},
}),
})
).toThrowError("googleAuth.sessionTimeoutInMinutes must be <= 60!");
});

Expand Down Expand Up @@ -884,7 +902,7 @@ describe("the GuEC2App pattern", function () {
domain,
allowedGroups: ["[email protected]", "[email protected]"],
},
}),
})
).toThrowError("googleAuth.allowedGroups must use the @guardian.co.uk domain.");
});
});
Expand Down

0 comments on commit 0a86d82

Please sign in to comment.