This project contains Lambda functions that update dlp-access DynamoDB tables to have the necessary data for the collection folder tree.
- collectionTitleEditFunction: This will modify the titles for IAWA sub-collections to NOT include identifiers to collection table.
- createCollectionMapFunction: This will create JSON files in the CollectionMap-yourenv S3 Bucket and update collection and collectionmap tables.
- createCollectionHeirarchyFunction: This will update collection heirarchy information to collection table.
- createUpdateFunction: This will update archive, collection, and collectionmap table's createdAt, etc fields.
- archiveCollectionHeirarchyFunction: This will update archive/collection heirarchy information to archive table.
Click Next to continue
Name | Description |
---|---|
Stack name | any valid name |
Region | a valid AWS region. e.g. us-east-1 |
CollectionTable | DynamoDB Collection table name |
ArchiveTable | DynamoDB Archive table name |
CollectionmapTable | DynamoDB Collectionmap table name |
S3BucketName | Target S3 bucket name |
Leave it as is and click Next
Make sure all checkboxes under Capabilities section are CHECKED
Click Create stack
wget https://vtdlp-dev-cf.s3.amazonaws.com/69ad1fde579ab387572e0bb1d9e84b84.template -O dlpaccesslambas.template
aws cloudformation deploy --template-file dlpaccesslambas.template --stack-name demo --parameter-overrides 'SourceTable=sourcetable TargetTable=targettable Region=us-east-1' --capabilities CAPABILITY_IAM --region us-east-1
To use the SAM CLI, you need the following tools.
- SAM CLI - Install the SAM CLI
- Python 3 installed
- Docker - Install Docker community edition
To build the application for the first time, run the following in your shell:
sam build --use-container
Above command will build the source of the application. The SAM CLI installs dependencies defined in requirements.txt
, creates a deployment package, and saves it in the .aws-sam/build
folder.
To package the application, run the following in your shell:
sam package --output-template-file packaged.yaml --s3-bucket BUCKETNAME
Above command will package the application and upload it to the S3 bucket you specified.
Run the following in your shell to deploy the application to AWS:
sam deploy --template-file packaged.yaml --stack-name STACKNAME --s3-bucket BUCKETNAME --parameter-overrides 'CollectionTable=CollectionTable ArchiveTable=ArchiveTable CollectionmapTable=CollectionmapTable S3BucketName=S3BucketName Region=us-east-1' --capabilities CAPABILITY_IAM --region us-east-1
- Stack Name: The name of the stack to deploy to CloudFormation. This should be unique to your account and region, and a good starting point would be something matching your project name.
- AWS Region: The AWS region you want to deploy your app to.
aws lambda invoke --function-name LambdaFunctioName out --log-type Tail --query 'LogResult' --output text | base64 -d
To delete the sample application that you created, use the AWS CLI. Assuming you used your project name for the stack name, you can run the following:
aws cloudformation delete-stack --stack-name StackName