This project deploys an AWS Lex V2 chatbot for analyzing IoT data stored in an S3 bucket. The infrastructure is defined using Terraform, and the project includes a Lambda function for chatbot fulfillment.
- Leverages AWS Lex V2 for natural language understanding and conversation management.
- Utilizes Lambda function to process user input and retrieve data from S3.
- Provides dynamic responses based on information stored in the CSV file.
- Offers a cost-effective and scalable solution for chatbot development.
bot.tf
: Defines the Lex V2 bot configuration using Terraform.lambda_function.zip
: Contains the Python code for the Lambda function.main.tf
: Defines the main Terraform configuration for Lambda and IAM roles.provider.tf
: Configures the Terraform AWS provider.S3bucket.tf
: Defines the S3 bucket to store the energy consumption data CSV file.Energy Consumption Data.csv
: The CSV file containing the energy consumption data (to be uploaded manually).
-
Terraform Setup: Make sure you have Terraform installed. If not, follow the official installation guide.
-
AWS Credentials: Configure your AWS credentials using
aws configure
if not done already. -
Clone the Repository:
git clone <repository-url>
git clone <repository-url>
-
Initialize Terraform:
terraform init
-
Deploy Infrastructure: to deploy the AWS resources.
terraform apply
-
Upload Data to S3: Manually upload the CSV file (Energy Consumption Data.csv) to the S3 bucket created.
-
Create Intents: Create intents using lex console.
□ Create 1st intent
GetCurrentUsagelntent
□ Create 2nd intent
GetAverageUsage
-
Build the Chatbot:
-
Test the Chatbot: Interact with the chatbot using the Lex console or a chatbot client integrated with Lex.
- The Lex V2 bot creation is currently done manually through the AWS console due to Terraform AWS provider limitations.
- Ensure proper IAM roles and policies are in place for the Lambda function to access S3 and CloudWatch Logs.
- This is a basic example and can be extended to support more complex interactions and data sources.
- Modify the code and configuration files to fit your specific needs.
-
Integration with Amazon Kinesis and AWS IoT Core: In future iterations, consider incorporating Amazon Kinesis for real-time data streaming and AWS IoT Core for efficient IoT device communication. This can enhance the system by allowing direct ingestion of IoT data into S3, providing a more seamless and real-time chatbot experience.
The project lays the foundation for future enhancements, suggesting integration possibilities with Amazon Kinesis and AWS IoT Core for a more dynamic and real-time chatbot experience.
This project is licensed under the MIT License - see the LICENSE.md file for details