RunBooks Across Environments: ServiceIDs
Run your RunBook across multiple environments
Last updated
Run your RunBook across multiple environments
Last updated
Often, you'll need to run the same RunBook in multiple environments. Using the ServiceId, the RUnBook remains the source of truth, and one RunBook run against multiple environments.
To make this work, we'll move away from distinct credentials for each Action, and switch to ServiceIds:
Before we get ahead of ourselves, let's take a step back and start from the beginning.
In each environment you wish to run the xRunBook in, you'll need a credential for each service. For each of these credentials, create a ServiceId (that is the same across environments.)
For example: you have an AWS credential in two environments: dev and prod with the names AWS_EC2_dev and AWS_EC2_prod. Give each of these credentials a serviceId (for example AWS_EC2).
In order to run a xRunBook multiple environments, you'll need to 'Enable Environment Selection" on the RunBook Details page.
Next - open the xRunBook Editor. For each Action change from Credential to serviceId, and select the serviceID.
Now, when you run the xRunBook, you'll need to add the environment as an input parameter.
Navigate to xRunbooks, click the "unSkript xRunBooks" tab.
Search for IAM, and the "Create IAM User" will appear. Click the menu button to the right, and import this xRunBook into your proxy.
Now, open the xRunBook ("My xRunBooks" and it'll be at the top of the list). Click the menu button, and pick "Open Details." on this page, select the "Enable environment selection" checkbox:
Now, we can edit the Workflow - configuring each Action. Click the Edit button. For each Action, you can configure a SessionId for the Credential instead of the actual credential.
Since the Credential is a variable that points to a credential in BOTH "test_staging" and "test_production", this xRunBook can be run in either environment. Repeat for each Action in the xRunBook.
Save the xRunBook, and when you click "Run" in the xRunBook page, you will be prompted to choose the environment (or environments) you'd like to run the xRunBook: