This is an AWS Marketplace only feature. |
Overview
This document outlines the steps to configure the Kill Bill application to send events to an Amazon Simple Queue Service (SQS) queue.
Kill Bill generates different events when various actions occur within the system. For more details, refer to the Kill Bill events documentation.
Prerequisites
-
Access to AWS Management Console.
-
IAM permissions to create and manage SQS and IAM roles.
-
SSH access to the EC2 instance running Kill Bill.
Configuration Steps
Step 1: Create an SQS Queue
-
In the AWS Management Console, search for
SQS
(Simple Queue Service). -
Under the Get started section, click on Create queue.
-
Choose the type of queue:
-
Standard: At-least-once delivery, message ordering isn’t preserved.
-
FIFO: First-in-first-out delivery, message ordering is preserved.
-
-
Enter a name for the queue.
-
Adjust any configurations as per your requirements.
-
Click on Create queue.
Step 2: Create an IAM Role
-
In the AWS Management Console, navigate to the
IAM
(Identity and Access Management) service. -
Click on Roles in the sidebar.
-
Click on Create role.
-
Choose the AWS service type and select EC2 as the service that will use this role.
-
Click on Next: Permissions.
-
Attach the following policy to allow sending messages to SQS:
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "sqs:SendMessage", "Resource": "arn:aws:sqs:{REGION}:{ACCOUNT_ID}:{QUEUE_NAME}" } ] }
-
Click on Next: Tags, add any tags if needed, and then click on Next: Review.
-
Enter a name for the role and click on Create role.
Step 3: Attach the IAM Role to the EC2 Instance
-
Navigate to the EC2 Dashboard in the AWS Management Console.
-
Select the EC2 instance where Kill Bill is running.
-
Click on Actions, then Security, and choose Modify IAM role.
-
Select the IAM role created in Step 2 from the dropdown menu.
-
Click on Update IAM role.
Step 4: Configure Kill Bill to Use SQS
-
SSH to the EC2 instance running Kill Bill.
-
Edit the
/var/lib/tomcat/bin/setenv2.sh
file to include the following properties. Be sure to replacequeueName
with the name of your SQS queue and adjustmaxRetries
if necessary:
-Dcom.killbill.aws.enableSqsEvents=true
-Dcom.killbill.aws.sqs.queueName=<queue-name>
-Dcom.killbill.aws.sqs.maxRetries=5
Step 5: Restart the Kill Bill EC2 Instance
Restart the EC2 instance to apply the changes:
sudo reboot
Step 6: Test the Configuration
-
To test the setup, install any plugin, add a user, or make tenant configuration changes in Kill Bill. These actions should generate events that will be sent to the SQS queue.
-
Check the SQS dashboard to see if the events are received. Here is a sample event that might be sent to SQS:
{
"objectId": "af64be18-a334-4f42-8f07-b2cdc93861a6",
"objectType": "TENANT_KVS",
"eventType": "TENANT_CONFIG_CHANGE",
"accountId": null,
"tenantId": "4effbb8c-1c40-4051-871a-613ff6e954cb",
"metaData": "{\"key\":\"CATALOG\"}"
}
Conclusion
By following these steps, you can configure Kill Bill to send events to an AWS SQS queue, enabling better event-driven integrations and workflows.