Skip to content

feat(integrations): AWS SES, IAM Identity Center, and enhanced IAM/STS/CloudWatch/DynamoDB#4245

Merged
waleedlatif1 merged 12 commits intostagingfrom
feat/aws
Apr 21, 2026
Merged

feat(integrations): AWS SES, IAM Identity Center, and enhanced IAM/STS/CloudWatch/DynamoDB#4245
waleedlatif1 merged 12 commits intostagingfrom
feat/aws

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Add AWS SES v2 integration with 9 operations: send email, send templated email, send bulk email, manage templates, get account info
  • Add AWS IAM Identity Center integration with 12 operations: account assignments, permission sets, user/group lookup, assignment status polling
  • Add 3 new IAM tools: list attached role policies, list attached user policies, simulate principal policy
  • Fix DynamoDB duplicate subBlock IDs (renamed to operation-scoped IDs), add subblock migrations for backwards compatibility with existing workflows
  • Fix CloudWatch, STS, DynamoDB, and IAM routes: adopt withRouteHandler, toError, client.destroy(), nullable Zod schemas
  • Fix Identity Center: list_instances missing pagination, list_groups incorrect instanceArn condition
  • Apply withRouteHandler to all new route files (SES, Identity Center, new IAM routes)
  • Add docs for Identity Center and SES integrations

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…M/STS/CloudWatch/DynamoDB integrations

- Add AWS SES v2 integration with 9 operations (send email, templated, bulk, templates, account)
- Add AWS IAM Identity Center integration with 12 operations (account assignments, permission sets, users, groups)
- Add 3 new IAM tools: list-attached-role-policies, list-attached-user-policies, simulate-principal-policy
- Fix DynamoDB duplicate subBlock IDs, add operation-scoped field names, add subblock migrations
- Add authMode: AuthMode.ApiKey to DynamoDB block
- Fix CloudWatch routes: toError, client.destroy(), withRouteHandler, auth outside try
- Fix STS/DynamoDB/IAM routes: nullable Zod schemas, withRouteHandler adoption
- Fix Identity Center: list_instances pagination, list_groups instanceArn condition
- Add subblock migrations for renamed DynamoDB fields (key, filterExpression, etc.)
- Apply withRouteHandler to all new and existing AWS tool routes
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Apr 21, 2026 10:58pm

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 21, 2026

PR Summary

Medium Risk
Adds new public-facing contact endpoint plus new AWS integrations and expands AWS tool APIs (IAM/DynamoDB/CloudWatch), which could affect request validation, pagination, and email delivery behavior. Most changes are additive but touch infra-adjacent routes and AWS SDK client lifecycle/error handling.

Overview
Adds new integrations for AWS IAM Identity Center and AWS SES in the docs and landing integrations catalog, including new icons and tool metadata entries.

Expands AWS tool surface area and docs: IAM gains endpoints/docs for listing attached role/user policies and simulating principal policy; DynamoDB endpoints/docs add conditional writes/deletes plus pagination/sort controls for query/scan; STS and CloudWatch docs are clarified and CloudWatch routes are updated to improve logging, error formatting (toError), and ensure AWS clients are destroy()’d.

Adds a new /contact landing page with a client-side contact form and a new POST /api/contact route that validates input, rate-limits by IP, emails help@…, and attempts a confirmation email to the submitter.

Reviewed by Cursor Bugbot for commit 8e64140. Configure here.

…compatibility

Workflows saved with the old shared IDs (key, filterExpression, etc.) that migrate
to get-scoped slots via subblock-migrations still work correctly on update/delete/scan/put
operations via fallback lookups in tools.config.params.
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/app/api/tools/iam/utils.ts Outdated
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 21, 2026

Greptile Summary

This PR adds AWS SES v2 (9 operations), AWS IAM Identity Center (12 operations), and 3 new IAM tools, while refactoring existing CloudWatch, DynamoDB, IAM, and STS routes to use withRouteHandler, toError, and client.destroy(). It also fixes duplicate subblock IDs in the DynamoDB block with a migration and backward-compatible fallbacks in the params function.

Confidence Score: 5/5

PR is safe to merge; all previously reported issues have been addressed and no new blocking defects were found.

All previously flagged issues (delete conditionExpression fallback, pageSize min(0), send-email bodyText/bodyHtml refine check) have replies indicating they were fixed. The DynamoDB migration has correct fallback chains (updateKey || getKey, deleteKey || getKey, scanFilterExpression || queryFilterExpression) covering legacy workflows. New SES, Identity Center, and IAM tools follow consistent patterns with withRouteHandler, client.destroy(), and toError. Remaining findings are P2 style suggestions only.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/lib/workflows/migrations/subblock-migrations.ts Adds DynamoDB subblock ID migrations mapping shared IDs (key, filterExpression, expressionAttributeNames, expressionAttributeValues, limit, conditionExpression) to operation-scoped IDs; the params function has correct getKey/queryFilterExpression fallbacks for update/delete operations.
apps/sim/blocks/blocks/dynamodb.ts Renames duplicate subblock IDs to operation-scoped IDs and adds backward-compatible fallbacks (e.g. updateKey
apps/sim/blocks/blocks/ses.ts New SES block with 9 operations; correct credential visibility (password: true), send_email refine check for bodyText/bodyHtml, and proper pageSize parsing.
apps/sim/blocks/blocks/identity_center.ts New Identity Center block with 12 operations; instanceArn correctly excluded for operations using the IdentityStore/Organizations client; all required fields properly conditioned.
apps/sim/app/api/tools/ses/utils.ts New SES utility file wrapping SESv2Client; sendEmail, sendTemplatedEmail, sendBulkEmail, listIdentities, listTemplates, CRUD for templates all look correct.
apps/sim/app/api/tools/identity-center/utils.ts New Identity Center utility; createOrganizationsClient correctly hard-codes us-east-1 for the Organizations API; all SSO Admin and IdentityStore operations look correct.
apps/sim/app/api/tools/iam/utils.ts Adds listAttachedRolePolicies, listAttachedUserPolicies, and simulatePrincipalPolicy; getUser correctly made optional to default to the caller when userName is omitted.
apps/sim/app/api/tools/ses/send-email/route.ts New SES send-email route; bodyText/bodyHtml refine check is present; withRouteHandler and client.destroy() correctly applied.
apps/sim/app/api/tools/ses/send-bulk-email/route.ts Bulk email route parses and re-validates destinations JSON against DestinationSchema before sending; correct error handling.
apps/sim/app/api/tools/identity-center/list-instances/route.ts Fixed list-instances route now accepts maxResults and nextToken for proper pagination; withRouteHandler applied.
apps/sim/app/api/tools/iam/simulate-principal-policy/route.ts New simulate-principal-policy route; actionNames comma parsing handled in util; resourceArns defaults to * when not provided.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Block params function] --> B{operation}
    B --> C[SES Block - 9 ops]
    B --> D[Identity Center Block - 12 ops]
    B --> E[IAM Block - 3 new ops]
    B --> F[DynamoDB Block - refactored]

    C --> C1[send_email / send_templated_email / send_bulk_email]
    C --> C2[list_identities / get_account]
    C --> C3[create / get / list / delete template]

    D --> D1[list_instances / list_accounts / describe_account]
    D --> D2[list_permission_sets / get_user / get_group / list_groups]
    D --> D3[create / delete account_assignment / check status / list_account_assignments]

    E --> E1[list_attached_role_policies]
    E --> E2[list_attached_user_policies]
    E --> E3[simulate_principal_policy]

    F --> MIG[Migration: shared IDs to scoped IDs]
    MIG --> M1[key to getKey]
    MIG --> M2[filterExpression to queryFilterExpression]
    MIG --> M3[conditionExpression to updateConditionExpression]
    F --> FB[Params fallbacks in code]
    FB --> FB1[updateKey OR getKey]
    FB --> FB2[deleteKey OR getKey]
    FB --> FB3[scanFilterExpression OR queryFilterExpression]

    D1 --> AWS1[OrganizationsClient - us-east-1]
    D2 --> AWS2[IdentitystoreClient]
    D3 --> AWS3[SSOAdminClient]
    C1 --> AWS4[SESv2Client]
Loading

Reviews (4): Last reviewed commit: "fix(aws): add gradient background to Ide..." | Re-trigger Greptile

Comment thread apps/sim/lib/workflows/migrations/subblock-migrations.ts
Comment thread apps/sim/app/api/tools/ses/list-identities/route.ts
Comment thread apps/sim/app/api/tools/ses/send-email/route.ts
waleedlatif1 and others added 3 commits April 21, 2026 12:46
…on (#4242)

* feat(contact): add contact page, migrate help/demo forms to useMutation

* improvement(contact): address greptile review feedback

- Map contact topic to help email type for accurate confirmation emails
- Drop Zod schema details from 400 response on public /api/contact
- Wire aria-describedby + aria-invalid in LandingField for both forms
- Reset helpMutation on modal reopen to match demo-request pattern

* improvement(landing): extract shared LandingField component
…ations routes (#4243)

* fix(layout): use plain inline script for PublicEnvScript to set env before chunks eval on error pages

* fix(landing): handle runtime env race on error-page renders

React skips SSR on unhandled server errors and re-renders on the client
(see vercel/next.js#63980, #82456). Root-layout scripts — including the
runtime env script that populates window.__ENV — are inserted but not
executed on that client re-render, so any client module that reads env
at module evaluation crashes the render into a blank "Application error"
overlay instead of rendering the styled 404.

This replaces the earlier PublicEnvScript tweak with the architectural
fix:

- auth-client.ts: fall back to window.location.origin when getBaseUrl()
  throws on the client. Auth endpoints are same-origin, so this is the
  correct baseURL on the client. Server-side we still throw on genuine
  misconfig.
- loading.tsx under /models/[provider], /models/[provider]/[model], and
  /integrations/[slug]: establishes a Suspense boundary below the root
  layout so a page-level notFound() no longer invalidates the layout's
  SSR output (the fix endorsed by Next.js maintainers in #63980).
- layout.tsx: revert disableNextScript — the research showed this
  doesn't actually fix error-page renders. The real fix is above.

* improvement(landing): use emcn Loader in scoped loading.tsx, trim auth-client comment

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
…amoDB integrations

- IAM: replace non-existent StatementId with SourcePolicyType in simulatePrincipalPolicy
- IAM: add .int() constraint to list-users/roles/policies/groups Zod schemas
- IAM: remove redundant manual requestId from all 21 IAM route handlers
- SES: add .refine() body validation to create-template route
- SES: make bulk email destination templateData optional, only include ReplacementEmailContent when present
- SES: fix pageSize guard to if (pageSize != null) to correctly forward 0
- SES: add max(100) to list-templates pageSize, revert list-identities to min(0) per SDK
- STS: fix logger.error calls to use structured metadata pattern
- Identity Center: remove deprecated account.Status fallback, use account.State only
- DynamoDB: convert empty interface extends to type aliases, remove redundant error field, fix barrel to absolute imports
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/app/api/tools/cloudwatch/list-metrics/route.ts
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/app/api/tools/ses/list-identities/route.ts
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/docs/components/icons.tsx
Comment thread apps/sim/app/api/tools/ses/utils.ts Outdated
@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1
Copy link
Copy Markdown
Collaborator Author

@cursor review

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 8e64140. Configure here.

@waleedlatif1 waleedlatif1 merged commit 2d94b37 into staging Apr 21, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/aws branch April 21, 2026 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant