AWS DevOps CICD Pipelines
Introduction
This tutorial will guide you through setting up two CI/CD pipelines using AWS CodeBuild to automate the management of business rules in DecisionRules. The first pipeline will handle moving business rules from one DecisionRules space to another, even across different environments (e.g., from development to production). The second pipeline will focus on Point-in-Time Recovery, allowing you to revert to a previous state of your business rules when necessary.
Prerequisites
For the following steps you will need access to
AWS Account
AWS CodeBuild – Used to orchestrate the migration of the rules
S3 – Used to store backups of your rules
Setting up the Migration pipeline
This pipeline will be able to export rules from one selected space into another destination space.
AWS S3 Setup
First we need to set up the storage that will be used to back up the rules. In your AWS account navigate to S3 and execute the following steps:
Navigate to S3 → Buckets
Click Create bucket
Choose a name for the bucket
All the other settings can be left as defaults
Click Create bucket
Now you should have everything you need in S3.
AWS CodeBuild setup
Now that we have the backup storage prepared we can go and configure the migration pipeline itself. Execute the following steps:
Navigate to CodeBuild (using the search bar)
Navigate to Build projects
Click Create build project
Fill in name, description, etc.
Buildspec – Insert build commands – select Insert build commands and paste the following code:
Under Environment → Environment variables add the following:
BUCKET_NAME (plaintext)
Fill in the name of your storage bucket that will be used to store backups
ENV_URL_SRC and ENV_URL_DEST (plaintext)
URL for your DR API (
https://api.decisionrules.ioas an example for public cloud)
SRC_ENV (plaintext)
Management API key of the Source space
DEST_ENV (plaintext)
Management API key of the Destination space
Under Artifacts → Artifact 1 – Primary
Select Amazon S3
Put in your bucket's name
Click Create build project
Open the newly created project and click Start build
After the build is successfully finished, the destination space should now contain a copy of the rules in the source space, and a backup file for both should now be available in the selected bucket.
Setting up a rollback pipeline
This pipeline will be able to restore your space to a previous state based on the backups created by the migration pipeline, stored in S3.
AWS S3 setup
The storage bucket was already created for the previous pipeline. If you are not using it, follow its instructions to create the bucket.
AWS CodeBuild setup
The setup closely resembles the setup of the previous pipeline.
Navigate to CodeBuild (using the search bar)
Navigate to Build projects
Click Create build project
Fill in name, description, etc.
Buildspec – Insert build commands – select Insert build commands and paste the following code:
Under Environment → Environment variables add the following:
BUCKET_NAME
Fill in the name of your storage bucket that is used to store backups
ENV_URL_DEST
URL for your DR API (
https://api.decisionrules.ioas an example for public cloud)
DEST_ENV
Management API key of the Destination space
FOLDER_NAME
Path of the folder used to store the backup of the space that is being rolled back (e.g.
backup-2025-05-06T12:20:00)
FILE_NAME
Name of the file that is being rolled back to (should be in the BUCKET_NAME bucket), e.g.
exportDestination.json
Click Create build project
Running the pipeline
In this pipeline we want to choose, for each execution, the specific backup file that we are rolling back to. This can be achieved two ways.
Running the build manually ("Start build with overrides" button)
Open the project and click Start build with overrides.
Under Environment variables, change the FOLDER_NAME and FILE_NAME variables to contain the required backup file.
Click Start build.
Running the build using the AWS CLI
Start the build from the command line using aws codebuild start-build with the --environment-variables-override option, as described here: https://docs.aws.amazon.com/cli/latest/reference/codebuild/start-build.html
After running the command you should be able to monitor the process in CodeBuild.
Last updated
Was this helpful?

