Custom application looks for new files in particular folders an S3 bucket and interacts with the WorldShare Identity Management API based on the data in the delimited file
Clone this repository
$ git clone {url}
or download directly from GitHub.
Change into the application directory
$ python -m venv venv
$ . venv/bin/activate
$ pip install -r requirements.txt
$ python -m pytest
usage: processSheet.py [-h] --itemFile ITEMFILE --operation
{getUsers,createUsers,deleteUsers,findUsers,addCorrelationInfoToUsers,findUserCorrelationInfo}
--outputDir OUTPUTDIR
optional arguments:
-h, --help show this help message and exit
--itemFile ITEMFILE File you want to process
--operation {getUsers,createUsers,deleteUsers,findUsers,addCorrelationInfoToUsers,findUserCorrelationInfo}
Operation to run: getUsers,
createUsers, deleteUsers,
addCorrelationInfoToUsers,
findUserCorrelationInfo
--outputDir OUTPUTDIR
Directory to save output to
$ python processSheet.py --itemFile samples/barcodes.csv --operation findUsers --outputDir samples/principalIDs.csv
- Install AWS Commandline tools
- https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html I reccomend using pip.
- Create an AWS user in IAM console. Give it appropriate permissions. Copy the key and secret for this user to use in the CLI.
- Configure the commandline tools - https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html
- Make sure you add -- key/secret -- region
- Use the AWS Console to create a bucket. Note your bucket name!!!
- Create folder idm_events/
- Add a sample csv file of user identifier data
- Add a sample csv file of user barcode data
-
Alter s3_event.json to point to your bucket and your sample txt file.
-
Use serverless to test locally
serverless invoke local --function findUsers --path s3-findUsers-event.json
-
Alter s3-getUsers-event.json to point to your bucket and your sample csv file.
-
Use serverless to test locally
serverless invoke local --function getUsers --path s3-getUsers-event.json
- Download and setup the application, see Installing locally
- Deploy the code using serverless
$ serverless deploy