-
Notifications
You must be signed in to change notification settings - Fork 15
feature: Frigg 2.0 features #394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
d-klotz
wants to merge
851
commits into
main
Choose a base branch
from
next
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 123 commits
Commits
Show all changes
851 commits
Select commit
Hold shift + click to select a range
2ad4ebc
docs: rename DOCTOR.md to HEALTH.md for clarity
claude 58651f8
refactor(cli): move frigg-cli to top-level package for lerna/auto pub…
seanspeaks a0b734c
chore: regenerate package-lock.json after CLI package move
seanspeaks 86c5119
fix(cli): update infrastructure imports after package move
seanspeaks 6244457
feat(cli): add interactive stack selection and fix MismatchAnalyzer bug
seanspeaks 88215e7
feat(cli): add progress logging to doctor command
seanspeaks 7664bf4
fix(health): implement proper orphan detection with tag-based filtering
seanspeaks 6c75188
fix(health): detect orphans with CloudFormation tags but not in stack
seanspeaks 56cb6a8
refactor(health): implement percentage-based health scoring
seanspeaks 4cafcbd
fix(health): update tests for percentage-based health scoring
seanspeaks 0ce227b
docs(health): add comprehensive orphan detection relationship analysis
seanspeaks eb440da
docs(health): complete drift analysis for acme-integrations-dev
seanspeaks 574af37
docs(health): critical discovery - build template != deployed template
seanspeaks 8b13ab3
feat(health): implement template comparison for correct logical ID ma…
seanspeaks 9b24e8e
docs(health): comprehensive implementation guide for template compari…
seanspeaks e864c89
test(health): comprehensive TDD tests for template comparison services
seanspeaks 57de216
test(health): TDD tests for importWithLogicalIdMapping use case
seanspeaks 26fd97a
feat(cli): integrate template comparison for correct logical ID mapping
seanspeaks f35f6cc
docs(health): comprehensive TDD implementation summary
seanspeaks 1c5608d
feat(migration): Merge refactor/add-better-support-for-commands with …
seanspeaks 898a56c
docs(health): add cleanup command specification for orphaned resources
seanspeaks 6a0bba7
feat(health): implement CloudFormation resource import and property r…
seanspeaks a794ea3
test(health): add comprehensive tests for import execution and monito…
seanspeaks ca45ad3
docs(deploy): add comprehensive specification for deploy dry-run mode
seanspeaks 3e895e3
fix(infrastructure): Aurora version and orphaned KMS key handling
seanspeaks edb48ba
Merge pull request #474 from friggframework/claude/investigate-deploy…
seanspeaks b591174
feat: Add Aurora PostgreSQL discovery and Prisma Lambda Layer optimiz…
seanspeaks d9ce07d
perf(migration): restore aggressive Lambda package exclusions
seanspeaks 22f170f
Delete .safla directory
seanspeaks c7da846
Merge pull request #476 from friggframework/Remove-to-release
seanspeaks 2b28eb0
docs(infrastructure): add comprehensive pre-deployment health check s…
seanspeaks 4e6d7e7
Fix deployment issues from GitHub issue #481
claude d788231
Enhance deployment fixes: critical timing fix and AppDefinition disco…
claude c063a2a
Remove obsolete comment regarding Issue #481
seanspeaks dfc3a7c
feat(integration): enhance delete integration process with module loa…
d-klotz fce56c8
feat(integration): add moduleFactory to delete integration process
d-klotz 411f36e
fix(infrastructure): prevent Prisma layer build race condition with c…
seanspeaks 7be62db
fix(infrastructure): resolve uv_cwd error by delegating cleanup to bu…
seanspeaks 563eae6
fix(infrastructure): prevent .esbuild directory cleanup during packaging
seanspeaks caa9000
fix(infrastructure): prevent concurrent Prisma layer builds with PID …
seanspeaks ec0598b
Merge pull request #483 from friggframework/fix/integration-deletion-…
d-klotz 217a30b
fix(infrastructure): memoize createFriggInfrastructure to prevent dup…
seanspeaks f16726b
fix(frigg-cli): move devtools to peerDependency to prevent duplicate …
seanspeaks 6a32e49
fix(frigg-cli): update devtools peerDependency to accept canary versions
seanspeaks 6216503
fix(frigg-cli): use wildcard range for devtools peerDependency
seanspeaks 77654e1
fix(frigg-cli): use wildcard * for devtools peerDependency
seanspeaks fcb9803
fix(infrastructure): implement filesystem-based caching to prevent du…
seanspeaks 1423610
refactor: consolidate frigg-cli into devtools package
seanspeaks 3ed9691
fix(ci): add npm install to fix rollup optional dependency bug
seanspeaks 119b941
fix(ci): properly fix rollup optional dependency bug
seanspeaks a7c0bb5
fix(ci): also clean and reinstall in ui package workspace
seanspeaks 2c97276
removing package-locks and seeing where it gets us
seanspeaks 4a68c4d
revert: restore original release workflow without rollup bug workaround
seanspeaks ed71e22
fix(ci): upgrade all workflows to Node 22 to match package.json requi…
seanspeaks 6f679fe
fix(ci): add workaround for npm workspace optional dependency bug
seanspeaks bda352c
fix(deps): use npm overrides to force rollup platform binaries instal…
seanspeaks f4a6deb
Merge pull request #482 from friggframework/claude/fix-issue-481-011C…
seanspeaks 442987d
fix(serverless-plugin): fix offline queue environment mapping and app…
seanspeaks 7d01fb0
Merge pull request #486 from friggframework/claude/fix-issue-481-011C…
seanspeaks d3468e8
Get health check working with prisma db connections
seanspeaks 5a8e56e
Addressing DDD feedback
seanspeaks 2c2fb9d
fix(core): remove default prismaClient parameter for IoC container su…
seanspeaks edcba37
Apply suggestion from @graphite-app[bot]
seanspeaks 63ed8db
Apply suggestion from @graphite-app[bot]
seanspeaks 88d2c44
Merge pull request #487 from friggframework/claude/fix-issue-481-011C…
seanspeaks f438efd
Refactor integration mapping to use plain object for DTO conversion
d-klotz 39a19f6
Merge pull request #491 from friggframework/fix/integration-record-re…
d-klotz 669f13d
fix: make sure messages is not undefined
d-klotz a553608
Merge pull request #492 from friggframework/fix/integration-record-re…
d-klotz 663ddb6
docs: enhance deployment issues spec with plugin responsibility and d…
seanspeaks 6dcd97d
docs: remove deployment issues file (migrated to GitHub issue #481)
seanspeaks f8d621f
feat: include Prisma migrations in Lambda layer
seanspeaks 8921aa4
Merge pull request #493 from friggframework/fix/add-prisma-migrations…
seanspeaks a94ee46
fix(infrastructure): attach Prisma Lambda layer to all integration fu…
seanspeaks a3f25f9
fix(core): hydrate integrations for ANY event with integrationId
seanspeaks 285d192
feat(core): add Process table migration
seanspeaks 9192c35
fix(core): attach modules using Definition.modules keys via getName()
seanspeaks fc85987
Merge pull request #496 from friggframework/fix/queue-worker-prisma-l…
seanspeaks 37a354e
fix(infrastructure): enhance VPC resource discovery and management
d-klotz 2ef107f
feat(database): add DocumentDB support across various repositories an…
d-klotz d78661e
feat(database): enhance DocumentDB support in validation and error me…
d-klotz 4c64a49
refactor(credential-repository): improve credential mapping and enhan…
d-klotz 897122d
refactor(database): enhance DocumentDB integration and user repositor…
d-klotz 5d51f03
feat(encryption): implement DocumentDBEncryptionService for secure da…
d-klotz 832ff75
feat(encryption): enhance DocumentDBEncryptionService with custom sch…
d-klotz e23a5e0
feat(encryption): streamline custom encryption schema loading in Docu…
d-klotz 92857c1
feat: add option to disable Prisma Lambda Layer and bundle with funct…
d-klotz 336977b
Update to ignore the new aws sdk files
seanspeaks f025f81
feat(encryption): integrate DocumentDBEncryptionService for credentia…
d-klotz 42b46ad
Merge pull request #499 from friggframework/feat/support-documentdb-w…
d-klotz 82efe90
Updates for logging, remove later as needed
seanspeaks 9d746f1
feat(encryption): add API key encryption + module-level encryption co…
claude d72d514
fix: documentdb encryption, value validation and improved error messages
d-klotz 35bc02b
refactor: remove code comments
d-klotz ce72072
Refactor credential repository to unify user ID handling and improve …
d-klotz 91bf244
refactor: improve code readability and formatting in DocumentDB encry…
d-klotz a22c92d
fix: correct identifier property naming in createCredential function
d-klotz ad1d41b
fix: update integrationId handling to use string representation in Do…
d-klotz d7a1a9f
Merge remote-tracking branch 'origin/next' into fix/module-reference-key
seanspeaks 1b044bb
Merge remote-tracking branch 'origin/fix/documentdb-support-and-minor…
seanspeaks 330e50d
fix: Auto-create organization user independently when individual exists
seanspeaks 29da1f3
Merge pull request #503 from friggframework/fix/documentdb-support-an…
d-klotz 4c6de84
fix: Support legacy "user" field for backward compatibility in creden…
seanspeaks d86d093
fix: Link individual user to organization user on auto-creation
seanspeaks 2969639
feat: Auto-link disconnected users by default with opt-in strict mode
seanspeaks 056db99
feat: Add linkIndividualToOrganization method to UserRepositoryPostgres
seanspeaks 02de8cb
feat: Add linkIndividualToOrganization to all user repositories
seanspeaks 701403a
fix(core): Allow organization users to access entities owned by linke…
seanspeaks a5af5b4
fix(core): remove duplicate Process table migration and add resolve e…
seanspeaks 2ea41ac
Merge branch 'next' into claude/review-issue-500-01NXdGZrCfmzzJwtQnuE…
claude c9c05da
refactor(encryption): address PR review feedback
claude 6dd1d0b
fix(core): Support both 'user' and 'userId' in module entity identifiers
seanspeaks d582c5c
Merge pull request #502 from friggframework/claude/review-issue-500-0…
seanspeaks b74f21e
chore: remove debug console.log statements from production code
seanspeaks 07be663
Merge remote-tracking branch 'origin/next' into fix/module-reference-key
seanspeaks 01b5197
fix: Address PR review feedback from Cursor bot
seanspeaks 222cc9e
Merge pull request #498 from friggframework/fix/module-reference-key
seanspeaks 884050f
refactor: rename user retrieval methods for clarity and add organizat…
d-klotz 3cbbd4f
Merge pull request #507 from friggframework/refactor/use-consistent-m…
d-klotz 4eacba8
feat: add deleteUserById command for user cleanup
roboli d1a9932
Merge pull request #508 from roboli/feat/add-delete-user-command
d-klotz b0f94e6
feat: add deleteIntegrationById and improve cascade delete documentation
roboli 38f3019
test: add unit tests for deleteIntegrationById command
roboli 859700b
Merge pull request #509 from roboli/fix/delete-user-cascading
d-klotz feeb2fc
fix: pass existing config to integration constructor in UpdateIntegra…
claude 0d369ea
Merge pull request #515 from friggframework/claude/issue-514-tdd-01VF…
seanspeaks e94bef8
chore: remove stale comment and fix step numbering
claude 1aaa90d
Merge pull request #516 from friggframework/claude/issue-514-tdd-01VF…
seanspeaks 91abacf
Fix .gitignore to catch all .env file variations
claude 595cc5f
Add file exclusions to devtools package to prevent .env leakage
claude c4c7e72
Exclude .env files from serverless package deployment
claude 7dafa19
Merge pull request #518 from friggframework/claude/fix-frigg-env-depl…
d-klotz b316fd2
fix(devtools): include infrastructure/ in npm package files
d-klotz bbd2a93
Merge pull request #519 from friggframework/fix/include-infrastructur…
d-klotz 7bc6ad6
fix(devtools): include test/ in npm package files
d-klotz 6641121
docs: add PR guidelines to CLAUDE.md
d-klotz 1133f45
Merge pull request #520 from friggframework/fix/include-test-in-devto…
d-klotz 26f81b8
feat(devtools): add Frigg Authenticator CLI tool
d-klotz 337187e
feat(devtools): add interactive JSON Schema form for API-Key modules
d-klotz e085d83
fix(devtools): improve Frigg Authenticator reliability
d-klotz 110b4e7
style(auth): improve code formatting and readability
d-klotz a6edb9d
refactor(auth): improve redirect URI handling in OAuth flow
d-klotz 4e7b1f4
Merge pull request #523 from friggframework/feat/frigg-authenticator
d-klotz e7525cb
chore: trigger release for auth command
d-klotz 0615632
fix: use correct property for grant type check
d-klotz e81f52e
feat(requester): enhance OAuth2Requester with detailed methods and tests
d-klotz f2dfe3f
Merge pull request #524 from friggframework/fix/use-correct-property-…
d-klotz 8d1550c
fix(devtools): pass refresh_token to refreshAccessToken in auth-tester
d-klotz 35c9beb
fix(requester): improve auth refresh handling and tests
d-klotz e37c706
Merge pull request #525 from friggframework/fix/use-correct-property-…
d-klotz 4191cd2
Merge pull request #526 from friggframework/fix/auth-tester-token-ref…
d-klotz 9817fce
feat(core): add data JSON field to Entity model for dynamic property …
d-klotz 8ad7038
Merge pull request #527 from friggframework/feat/entity-data-json-field
d-klotz da2ff89
fix(core): add debug logging to OAuth2Requester.refreshAuth()
d-klotz 8aea052
fix(core): add debug logging to OAuth2Requester.refreshAuth()
d-klotz 223ed80
refactor(core): remove legacy user field support
d-klotz a9a04d5
fix(auth): standardize user identifier key to userId
d-klotz 3dbc89c
Merge pull request #529 from friggframework/fix/combined-oauth2-and-p…
d-klotz 9e350a6
feat(scheduler): add EventBridge Scheduler commands and infrastructure
d-klotz f4960d7
feat(scheduler): add mock scheduler for local development
d-klotz 5ea5dab
feat(infrastructure): export queue ARN for all integrations
d-klotz 194f153
Revert "feat(infrastructure): export queue ARN for all integrations"
d-klotz 6010724
feat(scheduler): accept queueUrl and derive ARN internally
d-klotz d9eda3c
docs: add scheduler commands documentation
d-klotz de2fc16
refactor(scheduler): implement hexagonal architecture with interface
d-klotz bae174b
refactor(scheduler): remove createSchedulerAdapter backwards compatib…
d-klotz eb2e0bb
fix(scheduler): remove hardcoded SCHEDULER_PROVIDER and use provider-…
d-klotz 5b60782
fix(scheduler): make schedule group name stage-specific
d-klotz 3d3ee7a
Remove request and response details from FetchError text, unless stag…
MichaelRyanWebber 14108ff
fix(scheduler): use 'event' field in SQS payload instead of 'eventType'
d-klotz eec57c3
fix(oauth2): preserve refresh_token during token refresh
d-klotz 28576ce
Merge pull request #531 from friggframework/feat/scheduler-commands
d-klotz a2a5dbf
fix(oauth2): add defensive logging for refresh_token preservation
d-klotz 2897c90
fix(oauth2): improve logging for non-500 errors
d-klotz a16631c
fix(oauth2): enhance logging for refresh_token handling
d-klotz 58f7af2
Merge pull request #537 from friggframework/fix/preserve-refresh-toke…
d-klotz 74db90f
refactor(core): remove mongoose dependency, use Prisma and mongodb dr…
d-klotz f95ba19
fix(core): address code review findings from PR #546
d-klotz 8642b58
refactor(core): remove unused expectShallowEqualDbObject
d-klotz ce82650
refactor(tests): remove password encryption tests
d-klotz 45e06e5
refactor(core): remove unused Entity import
d-klotz c17a357
feat(core): add AWS SDK client-scheduler dependency
d-klotz a987d94
Merge pull request #546 from friggframework/refactor/remove-mongoose-…
d-klotz 4f3ba52
refactor(core): replace mongodb ObjectId with bson
d-klotz f9c9ccc
Merge branch 'next' into refactor/remove-mongoose-dependency
d-klotz 67ebb53
refactor(core): remove unused AWS SDK client-scheduler dependency
d-klotz aac4f40
Merge pull request #547 from friggframework/refactor/remove-mongoose-…
d-klotz 0c9482d
fix(infra): self-heal VPC subnet-route table association drift
d-klotz 1a22160
fix(infra): improve self-healing for VPC subnet associations
d-klotz 90eefb0
test(infra): add self-heal tests for VPC subnet associations
d-klotz 1435f81
test(infra): enhance fallback path tests for VPC subnets
d-klotz c8ae0ca
style(tests): format test cases for better readability
d-klotz 9740ac8
Merge pull request #548 from friggframework/fix/vpc-subnet-route-tabl…
d-klotz 1441821
fix(core): gracefully handle webhooks for deleted integrations
d-klotz b8b9a2b
fix(core): address review comments - wording and test coverage
d-klotz ce9eece
Merge pull request #550 from friggframework/fix/graceful-webhook-for-…
d-klotz dc5f898
fix(infra,core): prevent silent SQS message loss and add per-record e…
d-klotz 7a28e41
feat(infra,core): add DLQ observability — CloudWatch alarm and proces…
d-klotz 4228f35
fix(infra,core): address code review — DLQ observability improvements
d-klotz c2d0c15
fix(core): preserve HaltError semantics in Worker.run per-record isol…
d-klotz 2eff615
fix(core): update Worker.run TypeScript return type to BatchItemFailu…
d-klotz d44d80d
chore(core): cleanup stale test comment, add parse failure logging to…
d-klotz bd58f28
fix(infra): increase InternalErrorQueue VisibilityTimeout to 180s (6x…
d-klotz 80601bc
fix(infra): restore InternalErrorQueue VisibilityTimeout to original …
d-klotz ca64938
fix(infra): set DLQ alarm threshold to 500 to avoid noise from existi…
d-klotz f839939
fix(infra): evaluate DLQ alarm every 5 minutes instead of every minute
d-klotz 0b2f34e
feat(schemas): extract schemas changes from PR #522
claude 04a114b
docs: extract docs, ADRs, and root config from PR #522
claude a537f5e
fix(core): return batchItemFailures from DLQ processor per ReportBatc…
d-klotz 947779c
Merge pull request #553 from friggframework/fix/sqs-queue-message-ret…
d-klotz f7e9ccc
feat(core): mark 4xx HTTP errors as isHaltError to prevent retry ampl…
d-klotz 690c174
fix(core): exclude 408 from halt, add discard log for production visi…
d-klotz 9956eab
feat(infra): increase queue worker reserved concurrency from 5 to 20
d-klotz dd131b2
feat(core): discard webhook messages for DISABLED integrations
d-klotz 9bc8a35
style(integration-builder): format code for readability
d-klotz 8c2039c
Merge pull request #566 from friggframework/fix/halt-non-retryable-4x…
d-klotz 25bb640
Merge pull request #536 from friggframework/sanitize-fetch-error
d-klotz f193546
Merge pull request #557 from friggframework/claude/split-522-01-docs
d-klotz e377884
Merge pull request #569 from friggframework/claude/split-522-02-schemas
d-klotz 7082747
fix(core): restore integration status to ENABLED on successful re-auth
d-klotz d1c0bdf
docs(core): drop internal 'Gap C' reference from re-auth status comment
d-klotz 1636cba
fix(core): auto-disable integration when credentials are invalidated
d-klotz 724e7f4
fix(core): use ERROR status for credential failure + extend queue wor…
d-klotz 55a8027
Merge pull request #574 from friggframework/fix/core-restore-integrat…
d-klotz f65c4e0
docs(core): drop internal 'Attio dead-token loop' reference from dele…
d-klotz 4fbb93c
Merge pull request #576 from friggframework/fix/core-auto-disable-int…
d-klotz bd5a32b
ci: drop broken 'npm install -g npm@latest' from release workflow
d-klotz c1c98a8
Merge pull request #577 from friggframework/ci/remove-npm-self-upgrade
d-klotz aa7f1ad
feat(core): add observability logs to queue workers
d-klotz e866a27
feat(core): enrich worker logs with correlation identifiers
d-klotz 3f8e78e
feat(core): log lambda handler entry context
d-klotz 4f65577
fix(core): add per-request timeout to Requester to catch silent fetch…
d-klotz 312fe8b
fix(requester): keep timeout active through response body consumption
d-klotz 2d1eba8
test(requester): hoist fetch helpers, address SonarQube style nits
d-klotz 5360ba8
fix(serverless-plugin): apply CloudFormation queue Properties to Loca…
d-klotz 4487187
fix(serverless-plugin): filter unresolved CloudFormation intrinsics f…
d-klotz c0487bc
fix(core): atomic Process updates to eliminate race on counters and f…
d-klotz 235db2b
fix(core): atomic Process update — address review blockers
d-klotz 17fcce9
fix(core): add missing Postgres migrations for Entity.data and Process
d-klotz f1cb41c
fix(core,devtools): eliminate silent Lambda hangs on DB contention
d-klotz 9716b6d
fix(devtools): address review feedback on Lambda hang prevention
d-klotz f90f789
Merge pull request #578 from friggframework/feat/worker-observability…
d-klotz f660549
feat(core): forward OAuth state from /api/authorize to module API
d-klotz 5ff5209
Merge pull request #580 from friggframework/claude/plugin-queue-attri…
d-klotz 459050a
Merge pull request #579 from friggframework/claude/core-requester-tim…
d-klotz db461cc
fix(core): explicitly persist tokens on OAuth2 re-auth
d-klotz 388414b
fix(core): restore OAuth state forwarding lost during rebase
d-klotz 9b98ac9
Merge pull request #582 from friggframework/fix/core-persist-tokens-o…
d-klotz 9354408
fix(core): repoint entity credentialId when re-auth produces a differ…
d-klotz b649f7f
Merge pull request #583 from friggframework/fix/core-persist-tokens-o…
d-klotz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,3 +25,6 @@ yarn-error.log* | |
| .npmrc | ||
| .autorc | ||
| /.nx/ | ||
|
|
||
| CLAUDE.md | ||
| /.claude | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,171 @@ | ||
| # Encryption and Security | ||
|
|
||
| ## Overview | ||
|
|
||
| Frigg provides built-in support for data encryption to help you secure sensitive information in your integrations. The framework automatically configures AWS KMS (Key Management Service) for field-level encryption when enabled in your application definition. | ||
|
|
||
| ## Default Encryption: AES Keys | ||
|
|
||
| ### Out-of-the-Box Encryption | ||
|
|
||
| By default, Frigg uses a simple AES key-based encryption system that works without any additional configuration. This system uses environment variables to manage encryption keys: | ||
|
|
||
| ```javascript | ||
| // Current encryption key | ||
| process.env.AES_KEY_ID // Key identifier | ||
| process.env.AES_KEY // Actual encryption key | ||
|
|
||
| // For key rotation support | ||
| process.env.DEPRECATED_AES_KEY_ID // Previous key identifier | ||
| process.env.DEPRECATED_AES_KEY // Previous encryption key | ||
| ``` | ||
|
|
||
|
|
||
| ## Automatic KMS Configuration | ||
|
|
||
| ### Enable KMS in Your App Definition | ||
|
|
||
| To enable automatic KMS configuration, add the `encryption` property to your App Definition: | ||
|
|
||
| ```javascript | ||
| const appDefinition = { | ||
| name: 'my-frigg-app', | ||
| integrations: [ | ||
| // your integrations... | ||
| ], | ||
| encryption: { | ||
| useDefaultKMSForFieldLevelEncryption: true | ||
| } | ||
| } | ||
|
|
||
| module.exports = appDefinition; | ||
| ``` | ||
|
|
||
| ### What Happens Automatically | ||
|
|
||
| When `useDefaultKMSForFieldLevelEncryption` is set to `true`, Frigg automatically: | ||
|
|
||
| 1. **Grants KMS Permissions**: Adds `kms:GenerateDataKey` and `kms:Decrypt` permissions to all Lambda function IAM roles | ||
| 2. **Sets Environment Variable**: Configures `KMS_KEY_ARN` environment variable for runtime access | ||
| 3. **Includes KMS Plugin**: Adds the `serverless-kms-grants` plugin to your serverless configuration | ||
| 4. **Configures Default Keys**: Uses AWS default KMS keys (`kmsKeyId: '*'`) for encryption operations | ||
|
|
||
| ### Generated Infrastructure | ||
|
|
||
| The framework generates the following serverless configuration: | ||
|
|
||
| ```yaml | ||
| # IAM Permissions | ||
| provider: | ||
| iamRoleStatements: | ||
| - Effect: Allow | ||
| Action: | ||
| - kms:GenerateDataKey | ||
| - kms:Decrypt | ||
| Resource: | ||
| - '${self:custom.kmsGrants.kmsKeyId}' | ||
|
|
||
| # Environment Variables | ||
| provider: | ||
| environment: | ||
| KMS_KEY_ARN: '${self:custom.kmsGrants.kmsKeyId}' | ||
|
|
||
| # Plugins | ||
| plugins: | ||
| - serverless-kms-grants | ||
|
|
||
| # Custom Configuration | ||
| custom: | ||
| kmsGrants: | ||
| kmsKeyId: '*' | ||
| ``` | ||
|
|
||
| ## Using KMS in Your Code | ||
|
|
||
| ### Accessing the KMS Key ARN | ||
|
|
||
| The KMS key ARN is available in your Lambda functions via environment variables: | ||
|
|
||
| ```javascript | ||
| const kmsKeyArn = process.env.KMS_KEY_ARN; | ||
|
|
||
| // Use with AWS SDK for encryption operations | ||
| const { KMSClient, GenerateDataKeyCommand, DecryptCommand } = require('@aws-sdk/client-kms'); | ||
|
|
||
| const kmsClient = new KMSClient({ region: 'us-east-1' }); | ||
| ``` | ||
|
|
||
| ### Integration with Frigg Encrypt Module | ||
|
|
||
| If you're using the `@friggframework/encrypt` module, it will automatically use the configured KMS key: | ||
|
|
||
| ```javascript | ||
| const { encrypt, decrypt } = require('@friggframework/encrypt'); | ||
|
|
||
| // Encrypt sensitive data | ||
| const encryptedData = await encrypt(sensitiveString); | ||
|
|
||
| // Decrypt when needed | ||
| const decryptedData = await decrypt(encryptedData); | ||
| ``` | ||
|
|
||
| ## Security Best Practices | ||
|
|
||
| ### When to Use KMS | ||
|
|
||
| Enable KMS encryption when your integrations handle: | ||
|
|
||
| - Personal Identifiable Information (PII) | ||
| - Financial data | ||
| - Authentication tokens (beyond basic OAuth) | ||
| - Sensitive business data | ||
| - Healthcare information (PHI) | ||
|
|
||
| ### Key Management | ||
|
|
||
| - **Default Keys**: Frigg uses AWS default KMS keys (`*`) for simplicity | ||
| - **Custom Keys**: For enhanced security, consider creating dedicated KMS keys per environment | ||
| - **Key Rotation**: AWS automatically rotates default keys annually | ||
|
|
||
| ## Deployment Considerations | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| Ensure your deployment environment has: | ||
|
|
||
| 1. **IAM Permissions**: Deployment role needs KMS permissions to create grants | ||
| 2. **KMS Access**: Lambda execution role will have KMS permissions after deployment | ||
|
|
||
| ### Environment Isolation | ||
|
|
||
| KMS configurations are environment-specific: | ||
|
|
||
| - **Development**: Uses same default keys for testing | ||
| - **Staging**: Can use environment-specific keys | ||
| - **Production**: Should use dedicated production keys for maximum security | ||
|
|
||
| ### Version Requirements | ||
|
|
||
| - **Framework Version**: Requires `@friggframework/devtools` v2.1.0+ | ||
| - **AWS Provider**: Compatible with all AWS regions | ||
| - **Node.js**: Works with all supported Node.js versions (16.x, 18.x, 20.x) | ||
|
|
||
| ## Examples | ||
|
|
||
| ### Basic Setup | ||
|
|
||
| ```javascript | ||
| // app-definition.js | ||
| const appDefinition = { | ||
| name: 'secure-integration-app', | ||
| integrations: [ | ||
| SalesforceIntegration, | ||
| HubspotIntegration | ||
| ], | ||
| encryption: { | ||
| useDefaultKMSForFieldLevelEncryption: true | ||
| } | ||
| }; | ||
|
|
||
| module.exports = appDefinition; | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,186 @@ | ||
| # VPC Configuration | ||
|
|
||
| ## Overview | ||
|
|
||
| Frigg provides **complete VPC infrastructure automation** for your Lambda functions. When enabled, it creates a production-ready VPC with all necessary components: VPC, subnets, NAT Gateway, Internet Gateway, route tables, security groups, and VPC endpoints. | ||
|
|
||
| ## Quick Start - Zero Configuration | ||
|
|
||
| Enable VPC with a single flag - Frigg handles everything: | ||
|
|
||
| ```javascript | ||
| const appDefinition = { | ||
| name: 'my-frigg-app', | ||
| integrations: [ | ||
| // your integrations... | ||
| ], | ||
| vpc: { | ||
| enable: true // That's it! Complete VPC infrastructure is created automatically | ||
| } | ||
| } | ||
|
|
||
| module.exports = appDefinition; | ||
| ``` | ||
|
|
||
| ## What Gets Created Automatically | ||
|
|
||
| When `vpc.enable` is `true`, Frigg creates a complete, production-ready VPC infrastructure: | ||
|
|
||
| ### Core VPC Infrastructure | ||
| - **VPC** with DNS resolution enabled (`10.0.0.0/16` CIDR) | ||
| - **Internet Gateway** for internet connectivity | ||
| - **Public Subnet** for NAT Gateway (`10.0.1.0/24`) | ||
| - **2 Private Subnets** in different AZs for Lambda functions (`10.0.2.0/24`, `10.0.3.0/24`) | ||
| - **NAT Gateway** with Elastic IP for private subnet internet access | ||
| - **Route Tables** properly configured for internet routing | ||
|
|
||
| ### Security Groups | ||
| - **Lambda Security Group** with outbound rules for: | ||
| - HTTPS (443) - API calls | ||
| - HTTP (80) - HTTP requests | ||
| - DNS (53 TCP/UDP) - Domain resolution | ||
|
|
||
| ### VPC Endpoints (Cost Optimization) | ||
| - **S3 Gateway Endpoint** (free) - Direct S3 access without NAT costs | ||
| - **DynamoDB Gateway Endpoint** (free) - Direct DynamoDB access | ||
| - **KMS Interface Endpoint** (paid, ~$22/month) - Only if KMS encryption enabled | ||
| - **Secrets Manager Interface Endpoint** (paid, ~$22/month) - For secure secret access | ||
|
|
||
| ### IAM Permissions | ||
| - **ENI Management** permissions for Lambda VPC operations | ||
|
|
||
| ## Configuration Options | ||
|
|
||
| ### Basic VPC (Zero Configuration) | ||
| ```javascript | ||
| vpc: { | ||
| enable: true // Creates complete VPC infrastructure with defaults | ||
| } | ||
| ``` | ||
|
|
||
| ### Custom CIDR Block | ||
| ```javascript | ||
| vpc: { | ||
| enable: true, | ||
| cidrBlock: '10.1.0.0/16' // Custom VPC CIDR (default: 10.0.0.0/16) | ||
| } | ||
| ``` | ||
|
|
||
| ### Disable VPC Endpoints | ||
| ```javascript | ||
| vpc: { | ||
| enable: true, | ||
| enableVPCEndpoints: false // Disable VPC endpoints (use NAT for all traffic) | ||
| } | ||
| ``` | ||
|
|
||
| ### Use Existing Infrastructure | ||
| ```javascript | ||
| vpc: { | ||
| enable: true, | ||
| securityGroupIds: ['sg-existing123'], // Use existing security groups | ||
| subnetIds: ['subnet-existing456'] // Use existing subnets | ||
| // Skips infrastructure creation, only enables VPC for Lambda | ||
| } | ||
| ``` | ||
|
|
||
| ## Generated Infrastructure | ||
|
|
||
| ### Complete CloudFormation Resources | ||
| ```yaml | ||
| # VPC and Networking | ||
| - AWS::EC2::VPC (10.0.0.0/16) | ||
| - AWS::EC2::InternetGateway | ||
| - AWS::EC2::NatGateway + Elastic IP | ||
| - AWS::EC2::Subnet (1 public, 2 private) | ||
| - AWS::EC2::RouteTable (public + private routing) | ||
|
|
||
| # Security | ||
| - AWS::EC2::SecurityGroup (Lambda + VPC Endpoints) | ||
|
|
||
| # VPC Endpoints (optional) | ||
| - AWS::EC2::VPCEndpoint (S3, DynamoDB - free) | ||
| - AWS::EC2::VPCEndpoint (KMS, Secrets Manager - paid) | ||
|
|
||
| # Lambda Configuration | ||
| provider: | ||
| vpc: | ||
| securityGroupIds: [!Ref FriggLambdaSecurityGroup] | ||
| subnetIds: | ||
| - !Ref FriggPrivateSubnet1 | ||
| - !Ref FriggPrivateSubnet2 | ||
| ``` | ||
|
|
||
| ### Cost Optimization | ||
| ```javascript | ||
| // Minimal cost setup | ||
| vpc: { | ||
| enable: true, | ||
| enableVPCEndpoints: false // Use NAT only, skip interface endpoints | ||
| } | ||
|
|
||
| // Optimized setup (recommended) | ||
| vpc: { | ||
| enable: true // Default: includes free S3/DynamoDB endpoints | ||
| } | ||
| ``` | ||
|
|
||
| ### Environment-Specific VPC | ||
| ```javascript | ||
| const appDefinition = { | ||
| vpc: { | ||
| enable: process.env.STAGE === 'prod', // Only enable VPC in production | ||
| cidrBlock: process.env.STAGE === 'prod' ? '10.0.0.0/16' : '10.1.0.0/16' | ||
| } | ||
| }; | ||
| ``` | ||
|
|
||
| ## When to Use VPC | ||
|
|
||
| ### ✅ Enable VPC For: | ||
| - **Production applications** requiring network isolation | ||
| - **Compliance requirements** (SOC 2, HIPAA, PCI DSS) | ||
| - **Integration with existing VPC resources** | ||
| - **Enhanced security posture** | ||
| - **Cost optimization** via VPC endpoints | ||
|
|
||
| ## Migration and Compatibility | ||
|
|
||
| ### Existing Applications | ||
| - **Zero breaking changes** - add `vpc: { enable: true }` when ready | ||
| - **Gradual rollout** - enable per environment | ||
| - **Rollback friendly** - disable flag to revert | ||
|
|
||
| ### Override Existing Infrastructure | ||
| ```javascript | ||
| // Use your existing VPC resources instead of auto-created ones | ||
| vpc: { | ||
| enable: true, | ||
| securityGroupIds: ['sg-your-existing'], | ||
| subnetIds: ['subnet-your-existing-1', 'subnet-your-existing-2'] | ||
| } | ||
| ``` | ||
|
|
||
|
|
||
| ### Production-Optimized Setup | ||
| ```javascript | ||
| const appDefinition = { | ||
| encryption: { useDefaultKMSForFieldLevelEncryption: true }, | ||
| vpc: { | ||
| enable: true, | ||
| cidrBlock: '10.0.0.0/16', | ||
| enableVPCEndpoints: true // Include KMS endpoint for encryption | ||
| } | ||
| }; | ||
| ``` | ||
|
|
||
| ### Existing Infrastructure Integration | ||
| ```javascript | ||
| const appDefinition = { | ||
| vpc: { | ||
| enable: true, | ||
| securityGroupIds: ['sg-prod-lambda-12345'], | ||
| subnetIds: ['subnet-prod-private-1', 'subnet-prod-private-2'] | ||
| } | ||
| }; | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| { | ||
| "$schema": "node_modules/lerna/schemas/lerna-schema.json", | ||
| "version": "1.2.2", | ||
| "version": "2.0.0-next.0", | ||
| "packages": [ | ||
| "packages/*" | ||
| ] | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea if this should be committed 😅