feat: QuickSight v3.0.0 — auto-subscribe, group-based permissions, EventBridge user sync#83
Merged
Merged
Conversation
Remove AutoCleanupHours parameter and S3 lifecycle rules (ISB handles cleanup via AWS Nuke), fix Bedrock IAM policy region mismatch to match Lambda's hardcoded us-east-1, remove incorrect Amazon Lex references from scenarios.yaml, add CAPABILITY_AUTO_EXPAND for SAM transform StackSet support, and create BLUEPRINT.md registration guide.
Template uses explicit RoleName which requires CAPABILITY_NAMED_IAM. StackSet must be created in the ISB deployment region (e.g. us-west-2), not necessarily the target deployment region.
- Migrate admin password from Math.random() to Secrets Manager - Make CDK stack environment-agnostic (Fn::GetAZs for StackSet portability) - Hardcode deployment settings and DESTROY removal policies - Bump Fargate to 1 vCPU / 2 GB for faster Drupal initialization - Add per-module progress reporting to init-status page - Add CI workflow for CDK synth with bootstrap stripping and validation - Add ISB hub stack with StackSet for localgov-drupal scenario - Update scenarios.yaml (remove params, add CAPABILITY_NAMED_IAM) - Add BLUEPRINT.md with ISB deployment guide - Delete stub template.yaml (CI generates from CDK)
Replace ~40 sequential drush pm:enable calls (each spawning a separate PHP process) with a single drush pm:install call passing all modules. Eliminates redundant Drush bootstraps, dependency resolutions, and intermediate cache rebuilds. Same approach for custom NDX modules.
CloudFormation dynamic references ({{resolve:secretsmanager:...}}) are
not resolved in stack outputs, so the raw reference string was shown
instead of the actual password. Changed output to a Secrets Manager
console URL where users can retrieve the password.
Also allow docker-build workflow_dispatch to push from any branch.
QuickSight has no "all users" wildcard for permissions — only user/group ARN principals. The ndx-all-users group has permissions on all three QuickSight resources (DataSource, DataSet, Dashboard), but new users who self-provision via the console aren't automatically in the group. Add an EventBridge rule + Lambda that catches CloudTrail events for QuickSight user creation (RegisterUser, BatchCreateUser, CreateUser) and auto-adds the new user to the ndx-all-users group. Key implementation details: - EventBridge rule omits detail-type to catch both API calls and service events (console self-provisioning uses AwsServiceEvent) - Username extraction handles three event structures: responseElements, requestParameters, and serviceEventDetails (console self-provisioning) - Console CreateUser events use "Role:Session" format but QuickSight usernames use "Role/Session" — the Lambda converts accordingly - Idempotent: silently handles ResourceExistsException - Best-effort: all errors logged, never fatal - Reuses existing QuickSightSetupRole (already has CreateGroupMembership) Also fixes QuickSight setup reliability: - Add retry with backoff for RegisterUser PreconditionNotMetException, which occurs after rapid subscribe/unsubscribe cycles when QuickSight IAM integration hasn't fully propagated
5 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Major overhaul of the QuickSight dashboard template (v2.4.0 → v3.0.0) to make it fully self-contained and deployable in fresh ISB sandbox accounts where QuickSight has never been configured.
What changed
ndx-all-usersgroup. Handles all subscription states (active, unsubscribed, in-progress, failed) with polling and retry logic.ndx-all-usersgroup instead of a hardcoded SSO username. Removes theQuickSightUsernameparameter entirely.RegisterUser,BatchCreateUser,CreateUser) and automatically adds new users to thendx-all-usersgroup. Handles console self-provisioning events where the username is inserviceEventDetailswithRole:Sessionformat (converted toRole/Session).RegisterUserup to 6 times with backoff forPreconditionNotMetException, which occurs after rapid subscribe/unsubscribe cycles when QuickSight's IAM integration hasn't propagated.AutoCleanupHours(lifecycle rules replaced by explicit cleanup) andQuickSightUsername(replaced by group-based permissions).New resources (8)
QuickSightSetupRoleAWS::IAM::RoleQuickSightSetupFunctionAWS::Lambda::FunctionQuickSightSetupLogGroupAWS::Logs::LogGroupQuickSightSetupTriggerAWS::CloudFormation::CustomResourceQuickSightGroupSyncFunctionAWS::Lambda::FunctionQuickSightGroupSyncLogGroupAWS::Logs::LogGroupQuickSightGroupSyncRuleAWS::Events::RuleQuickSightGroupSyncPermissionAWS::Lambda::PermissionKey design decisions
Test plan