A serverless application for managing subscription groups using AWS Lambda functions.
Subscription Manager is a subscription management system that automates the process of subscribing users to Tableau reports based on their group memberships. The system consists of three main components:
-
Retool Frontend
- User interface for managing subscription mappings
- Allows administrators to:
- Select groups and associate them with specific Tableau reports/views
- Configure subscription schedules
- Delete existing mappings
- Provides a simple interface for maintaining group-to-report relationships
-
Pull Data Lambda Function
- Runs daily to synchronize Tableau data
- Pulls comprehensive information from Tableau's REST API including:
- All users
- Available reports and views
- Existing groups
- Current subscription schedules
- Updates the frontend with the latest Tableau metadata
-
Subscribe Group Lambda Function
- Executes daily to process subscription updates
- Uses the mappings created in Retool to:
- Subscribe users to reports based on their group memberships
- Automatically handle new users added to groups
- Note: Does not handle removal of subscriptions when users leave groups
The system uses a database to store:
- Group-to-report mappings
- Group names
- Report names
- Tableau metadata
- Subscription schedules
The system uses the Tableau REST API with the following configuration:
-
SITE_CONTENT_URL: Set to empty string ("") to use the default site in Tableau Server. This is used when interacting with the main/default site rather than a specific site in a multi-site Tableau Server setup.
-
API_VERSION: Set to "3.23" to match the current Tableau Server version. This version supports:
- User and group management
- Subscription creation and management
- View and workbook access
- For more details, see the Tableau REST API documentation
- Administrators use the Retool interface to create and manage group-to-report mappings
- The Pull Data Lambda function keeps the system updated with the latest Tableau information
- The Subscribe Group Lambda function processes these mappings daily to ensure users have the correct report subscriptions based on their group memberships
The project consists of two main Lambda functions:
subscription_pull_data/- Lambda function for pulling subscription datasubscription_subscribe_group/- Lambda function for managing subscription group operations
The project uses Terraform for infrastructure as code, with the main configuration in main.tf. The infrastructure includes:
- AWS Lambda functions
- Associated IAM roles and permissions
- Other AWS resources as needed
- Python 3.x
- AWS CLI configured with appropriate credentials
- Terraform installed
- Clone the repository
- Install dependencies for each Lambda function:
cd subscription_subscribe_group pip install -r requirements.txt
Each Lambda function includes its own test file:
test_lambda_function.pyfor testing the subscription group Lambda function
The project uses GitLab CI/CD for continuous integration and deployment, configured in .gitlab-ci.yml.
- Create a new branch for your feature
- Make your changes
- Submit a merge request