Compare commits

...

7 commits

Author SHA1 Message Date
Adam Moussa
fce1a45c57
Merge pull request #33 from Sea-Haven-Industries/dependabot/npm_and_yarn/multi-c2c9d264fa
Some checks are pending
Deploy / deploy (push) Waiting to run
build(deps): bump brace-expansion and jest
2026-08-07 12:27:55 -04:00
dependabot[bot]
4eca09093c
build(deps): bump brace-expansion and jest
Bumps [brace-expansion](https://github.com/juliangruber/brace-expansion) to 2.1.4 and updates ancestor dependency [jest](https://github.com/jestjs/jest/tree/HEAD/packages/jest). These dependencies need to be updated together.


Updates `brace-expansion` from 1.1.18 to 2.1.4
- [Release notes](https://github.com/juliangruber/brace-expansion/releases)
- [Commits](https://github.com/juliangruber/brace-expansion/compare/v1.1.18...v2.1.4)

Updates `jest` from 29.7.0 to 30.4.2
- [Release notes](https://github.com/jestjs/jest/releases)
- [Changelog](https://github.com/jestjs/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/jestjs/jest/commits/v30.4.2/packages/jest)

---
updated-dependencies:
- dependency-name: brace-expansion
  dependency-version: 2.1.4
  dependency-type: indirect
- dependency-name: jest
  dependency-version: 30.4.2
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-07 16:24:36 +00:00
Adam Moussa
0c939405fb
Merge pull request #32 from Sea-Haven-Industries/fix/enable-ci-tests
fix(ci): enable Jest CDK stack tests (PLAT-90)
2026-08-07 12:22:53 -04:00
809bc0c84a
chore(ci): add pr policy org-required workflow 2026-08-07 12:19:12 -04:00
b92624994e
fix(ci): enable Jest CDK stack tests
Wire run-tests into CI and add assertions for SG, IAM, instance, DLM, and the imported volume attachment. Use @swc/jest because ts-jest cannot consume TypeScript 7's compiler API.
2026-08-07 12:19:12 -04:00
Adam Moussa
8b17fe81c0
Merge pull request #30 from Sea-Haven-Industries/dependabot/github_actions/minor-and-patch-f6c394aee9
build(deps): bump the minor-and-patch group with 4 updates
2026-08-07 12:05:22 -04:00
dependabot[bot]
9e09fe1568
build(deps): bump the minor-and-patch group with 4 updates
Bumps the minor-and-patch group with 4 updates: [Sea-Haven-Industries/.github/.github/workflows/ci-typescript-cdk.yaml](https://github.com/sea-haven-industries/.github), [Sea-Haven-Industries/.github/.github/workflows/callable-dependency-review.yaml](https://github.com/sea-haven-industries/.github), [Sea-Haven-Industries/.github/.github/workflows/cd-cdk.yaml](https://github.com/sea-haven-industries/.github) and [Sea-Haven-Industries/.github/.github/workflows/callable-labeler.yaml](https://github.com/sea-haven-industries/.github).


Updates `Sea-Haven-Industries/.github/.github/workflows/ci-typescript-cdk.yaml` from 1.0.2 to 1.0.4
- [Release notes](https://github.com/sea-haven-industries/.github/releases)
- [Commits](0170a57c0d...81cf168170)

Updates `Sea-Haven-Industries/.github/.github/workflows/callable-dependency-review.yaml` from 1.0.2 to 1.0.4
- [Release notes](https://github.com/sea-haven-industries/.github/releases)
- [Commits](0170a57c0d...81cf168170)

Updates `Sea-Haven-Industries/.github/.github/workflows/cd-cdk.yaml` from 1.0.2 to 1.0.4
- [Release notes](https://github.com/sea-haven-industries/.github/releases)
- [Commits](0170a57c0d...81cf168170)

Updates `Sea-Haven-Industries/.github/.github/workflows/callable-labeler.yaml` from 1.0.2 to 1.0.4
- [Release notes](https://github.com/sea-haven-industries/.github/releases)
- [Commits](0170a57c0d...81cf168170)

---
updated-dependencies:
- dependency-name: Sea-Haven-Industries/.github/.github/workflows/ci-typescript-cdk.yaml
  dependency-version: 1.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: Sea-Haven-Industries/.github/.github/workflows/callable-dependency-review.yaml
  dependency-version: 1.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: Sea-Haven-Industries/.github/.github/workflows/cd-cdk.yaml
  dependency-version: 1.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: Sea-Haven-Industries/.github/.github/workflows/callable-labeler.yaml
  dependency-version: 1.0.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-08-06 22:53:50 +00:00
9 changed files with 7681 additions and 5 deletions

View file

@ -8,6 +8,7 @@ permissions:
jobs:
ci:
uses: Sea-Haven-Industries/.github/.github/workflows/ci-typescript-cdk.yaml@0170a57c0d99b542cfafd1f3e1d369c32643f486 # v1.0.2
uses: Sea-Haven-Industries/.github/.github/workflows/ci-typescript-cdk.yaml@81cf168170f356d1423d7736f7ce93fd6611ad53 # v1.0.4
with:
node-version: "24"
run-tests: true

View file

@ -7,4 +7,4 @@ permissions:
jobs:
review:
uses: Sea-Haven-Industries/.github/.github/workflows/callable-dependency-review.yaml@0170a57c0d99b542cfafd1f3e1d369c32643f486 # v1.0.2
uses: Sea-Haven-Industries/.github/.github/workflows/callable-dependency-review.yaml@81cf168170f356d1423d7736f7ce93fd6611ad53 # v1.0.4

View file

@ -13,7 +13,7 @@ concurrency:
jobs:
deploy:
uses: Sea-Haven-Industries/.github/.github/workflows/cd-cdk.yaml@0170a57c0d99b542cfafd1f3e1d369c32643f486 # v1.0.2
uses: Sea-Haven-Industries/.github/.github/workflows/cd-cdk.yaml@81cf168170f356d1423d7736f7ce93fd6611ad53 # v1.0.4
with:
node-version: "24"
secrets:

View file

@ -10,4 +10,4 @@ permissions:
jobs:
label:
uses: Sea-Haven-Industries/.github/.github/workflows/callable-labeler.yaml@0170a57c0d99b542cfafd1f3e1d369c32643f486 # v1.0.2
uses: Sea-Haven-Industries/.github/.github/workflows/callable-labeler.yaml@81cf168170f356d1423d7736f7ce93fd6611ad53 # v1.0.4

22
.github/workflows/policy.yaml.yml vendored Normal file
View file

@ -0,0 +1,22 @@
name: PR Policy
on:
pull_request:
types: [opened, reopened, synchronize, edited, labeled, unlabeled, ready_for_review]
concurrency:
group: "policy-${{ github.event.pull_request.number }}"
cancel-in-progress: true
permissions:
contents: read
issues: read
pull-requests: read
jobs:
policy:
uses: Sea-Haven-Industries/.github/.github/workflows/callable-pr-policy.yaml@7ac3528750b346f181347bb09f6af927a1c0aa14 # v1.0.6
secrets:
JIRA_CLOUD_ID: ${{ secrets.JIRA_CLOUD_ID }}
JIRA_SERVICE_ACCOUNT_EMAIL: ${{ secrets.JIRA_SERVICE_ACCOUNT_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

7494
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -6,14 +6,19 @@
},
"scripts": {
"build": "tsc",
"test": "jest",
"cdk": "cdk",
"synth": "cdk synth",
"deploy": "cdk deploy",
"diff": "cdk diff"
},
"devDependencies": {
"@swc/core": "1.13.5",
"@swc/jest": "0.2.39",
"@types/jest": "29.5.14",
"@types/node": "^24.13.3",
"aws-cdk": "^2.1133.0",
"jest": "30.4.2",
"source-map-support": "^0.5.21",
"tsx": "4.23.1",
"typescript": "~7.0.2"
@ -21,5 +26,32 @@
"dependencies": {
"aws-cdk-lib": "2.262.1",
"constructs": "^10.7.1"
},
"jest": {
"testEnvironment": "node",
"roots": [
"<rootDir>/test"
],
"testMatch": [
"**/test/**/*.test.ts"
],
"transform": {
"^.+\\.tsx?$": [
"@swc/jest",
{
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": false
},
"target": "es2022"
},
"module": {
"type": "commonjs"
}
}
]
},
"clearMocks": true
}
}

View file

@ -0,0 +1,127 @@
import * as cdk from "aws-cdk-lib";
import { Match, Template } from "aws-cdk-lib/assertions";
import * as fs from "node:fs";
import * as path from "node:path";
import { FileShareStack } from "../lib/file-share-stack";
const context = JSON.parse(
fs.readFileSync(path.join(__dirname, "..", "cdk.context.json"), "utf8"),
) as Record<string, unknown>;
const app = new cdk.App({ context });
const stack = new FileShareStack(app, "TestFileShare", {
env: { account: "328440206208", region: "us-east-1" },
});
const template = Template.fromStack(stack);
describe("FileShareStack security group", () => {
it("allows SMB, FileBrowser, and SFTP from the office VPN", () => {
template.hasResourceProperties("AWS::EC2::SecurityGroup", {
GroupName: "file-share",
SecurityGroupIngress: Match.arrayWith([
Match.objectLike({
CidrIp: "10.10.0.0/16",
FromPort: 445,
ToPort: 445,
IpProtocol: "tcp",
}),
Match.objectLike({
CidrIp: "10.10.0.0/16",
FromPort: 8080,
ToPort: 8080,
IpProtocol: "tcp",
}),
Match.objectLike({
CidrIp: "10.10.0.0/16",
FromPort: 22,
ToPort: 22,
IpProtocol: "tcp",
}),
]),
});
});
it("allows SMB and FileBrowser from the VPC CIDR", () => {
template.hasResourceProperties("AWS::EC2::SecurityGroup", {
SecurityGroupIngress: Match.arrayWith([
Match.objectLike({
CidrIp: "10.20.0.0/16",
FromPort: 445,
ToPort: 445,
IpProtocol: "tcp",
}),
Match.objectLike({
CidrIp: "10.20.0.0/16",
FromPort: 8080,
ToPort: 8080,
IpProtocol: "tcp",
}),
]),
});
});
});
describe("FileShareStack instance IAM", () => {
it("attaches AmazonSSMManagedInstanceCore to the instance role", () => {
template.hasResourceProperties("AWS::IAM::Role", {
RoleName: "file-share-instance",
ManagedPolicyArns: Match.arrayWith([
Match.objectLike({
"Fn::Join": Match.arrayWith([
Match.arrayWith([
Match.stringLikeRegexp("AmazonSSMManagedInstanceCore"),
]),
]),
}),
]),
});
});
it("scopes Secrets Manager GetSecretValue to file-share/*", () => {
template.hasResourceProperties("AWS::IAM::Policy", {
PolicyDocument: {
Statement: Match.arrayWith([
Match.objectLike({
Action: "secretsmanager:GetSecretValue",
Effect: "Allow",
Resource:
"arn:aws:secretsmanager:us-east-1:328440206208:secret:file-share/*",
}),
]),
},
});
});
});
describe("FileShareStack instance", () => {
it("uses t4g.small with an encrypted root volume", () => {
template.hasResourceProperties("AWS::EC2::Instance", {
InstanceType: "t4g.small",
BlockDeviceMappings: Match.arrayWith([
Match.objectLike({
DeviceName: "/dev/xvda",
Ebs: Match.objectLike({
Encrypted: true,
VolumeType: "gp3",
}),
}),
]),
});
});
});
describe("FileShareStack DLM and data volume", () => {
it("enables the nightly snapshot lifecycle policy", () => {
template.hasResourceProperties("AWS::DLM::LifecyclePolicy", {
State: "ENABLED",
Description: "Nightly EBS snapshots for file share data volume",
});
});
it("attaches the imported data volume by ID", () => {
template.hasResourceProperties("AWS::EC2::VolumeAttachment", {
VolumeId: "vol-04d951cccacc435b5",
Device: "/dev/xvdf",
});
});
});

View file

@ -20,5 +20,5 @@
"resolveJsonModule": true,
"esModuleInterop": true
},
"exclude": ["node_modules", "cdk.out"]
"exclude": ["node_modules", "cdk.out", "test"]
}