The User Provisioning Script is an automated solution developed using the AWS CDK (Cloud Development Kit) with TypeScript. This script streamlines the process of creating and managing AWS IAM users, assigning them to specific groups, attaching relevant policies, tagging users for better organization, and enhancing security with Multi-Factor Authentication (MFA).
- Automated User Creation: Automatically create IAM users with specified configurations.
- Group Assignment: Assign users to predefined IAM groups based on their roles or job functions.
- Policy Attachment: Attach appropriate IAM policies to groups to control user permissions.
- User Tagging: Add tags to users for better organization and cost allocation.
- Enhanced Security: Implement Multi-Factor Authentication (MFA) for added security.
- Amazon Web Services (AWS)
- IAM: For managing users, groups, roles, and policies.
- CDK (Cloud Development Kit): For defining cloud infrastructure using TypeScript.
- TypeScript: Programming language used for writing the infrastructure code.
- Node.js: JavaScript runtime environment for executing code and managing dependencies.
- AWS SDK for JavaScript: To interact with AWS services programmatically.
- Git: Version control system for tracking changes in the project.
- NPM: Package manager for installing dependencies.
-
Install Node.js and NPM:
- Download and install Node.js and NPM.
- Install AWS CLI:
brew install awscli
- Install and configure the AWS CLI with your AWS credentials by following the instructions here.
-
Set up AWS CDK: - Install the AWS CDK globally using NPM:
npm install -g aws-cdk
-
Bootstrap your AWS environment to set up the necessary resources for the AWS CDK:
cdk bootstrap
-
Initialize a New CDK Project:
- Create a new directory for your project and navigate into it:
mkdir user-provisioning-script cd user-provisioning-script
-
Initialize a new CDK project in TypeScript:
cdk init app --language=typescript
-
Install Required CDK Libraries:
-
Install the necessary AWS CDK libraries for IAM, Lambda, and other services:
npm install @aws-cdk/aws-iam @aws-cdk/aws-lambda @aws-cdk/aws-sns @aws-cdk/aws-sns-subscriptions @aws-cdk/aws-s3 @aws-cdk/aws-cloudtrail @aws-cdk/aws-s3-notifications constructs
-
-
Define IAM Groups and Policies:
- Create IAM groups and define the policies for each group.
-
Create IAM Users and Attach to Groups:
- Create IAM users and assign them to the predefined groups, add tags, and enable MFA.
-
Deploy the Stack:
-
Deploy the CDK stack to your AWS account:
cdk deploy
Check out the Python Verson: https://github.com/SolemnDave/User-Provisioning-Script/tree/python