A mini-project that uses AWS services to automate the creation of JIRA tickets/issues and send notifications to a designated Slack channel. The API Gateway acts as the entry point, receiving HTTP requests that trigger Lambda Functions. The Lambda Functions process the requests, creating JIRA tickets/issues based on the provided information. To ensure reliable and scalable processing, Simple Queue Service (SQS) is employed as a buffer between the API Gateway and the Lambda Functions. The processed tickets/issues are then published to the designated Slack channel, notifying the team members.
Please note that this mini-project serves as a demonstration of integrating AWS services such as API Gateway, Lambda Functions, and Simple Queue Service (SQS), for creating JIRA tickets/issues and sending notifications to a Slack channel. It is not intended for real-world production use and may lack certain features, optimizations, and security issues required for a production-ready application.
- JIRA Setup and Authentication
- Slack Setup and Authentication
- JIRA and Slack Secrets Manager Configuration
- CloudWatch Alert Secrets Manager Configuration
-
Grant CloudWatch Logs permission to execute the Lambda Function. Replace the placeholder
account_id
with your account, andregion
with your desired region.dev@dev:~$ aws lambda add-permission \ --function-name "log-subscription" \ --statement-id "log-subscription" \ --principal "logs.amazonaws.com" \ --action "lambda:InvokeFunction" \ --source-arn "arn:aws:logs:region:account_id:log-group:*:*" \ --source-account "account_id"
-
Create a Lambda Subscription Filter.
-
Using AWS Console
- Go to CloudWatch → Logs → Log groups → Log Group Name
- Go to Subscription filters → Create → Create Lambda subscription filter
- Choose the Lambda function for the destination that you want to subscribe to the filter
- Configure log format and filters
- Sample configuration of log format and filters
- Log format: JSON
- Subscription filter format:
{$.log_level="ERROR"}
- Sample configuration of log format and filters
-
Using AWS CLI
-
Create a subscription filter using the following command and replace the placeholder
account_id
with your account,region
with your desired region,log_group_name
with the log group to process, andfilter_pattern
with your desired pattern.dev@dev:~$ aws logs put-subscription-filter \ --log-group-name "log_group_name" \ --filter-name "log-error-subscription" \ --filter-pattern "filter_pattern" \ --destination-arn "arn:aws:lambda:region:account_id:function:log-subscription"
-
-
-
Install all the dependencies and bootstrap your project
dev@dev:~:bus-ticketing$ make init
To initialize the project with specific AWS profile, you can pass a parameter called
profile
.dev@dev:~:bus-ticketing$ make init profile=profile_name
-
Deploy the project.
dev@dev:~:bus-ticketing$ make deploy # Deploying with specific AWS profile dev@dev:~:bus-ticketing$ make deploy profile=profile_name
go test
run unit testscdk deploy
deploy this stack to your default AWS account/regioncdk diff
compare deployed stack with current statecdk synth
emits the synthesized CloudFormation templatecdk bootstrap
deployment of AWS CloudFormation template to a specific AWS environment (account and region)cdk destroy
destroy this stack from your default AWS account/region