Sprinters runs your GitHub Actions jobs on your AWS account.
When you first set up Sprinters, a default AWS account is associated with your Sprinters account.
This AWS account is automatically used when running Sprinters-powered jobs. Its account ID isn’t required in the runs-on: label:
runs-on: sprinters:aws:ubuntu-latest
To make things more explicit however, you do have the option to include it.
For an AWS account with the ID 123456789012
the label would then look like this:
runs-on: sprinters:aws/123456789012:ubuntu-latest
AWS accounts are regularly used to fence off different environments or projects within the same AWS organization.
In addition to your default account, you can set up any number of additional AWS accounts for use with Sprinters.
To do so, run the two-minute Sprinters CloudFormation setup on each AWS account you want to use. You can then specify the appropriate account ID for each job in the label.
For an AWS account with the ID 123456789012
, the label would then look like this:
runs-on: sprinters:aws/123456789012:ubuntu-latest
And for another AWS account with the ID 987654321098
, the label would look like this instead:
runs-on: sprinters:aws/987654321098:ubuntu-latest
When you have more than one AWS account, it isn’t always easy to remember the exact AWS account ID associated with each environment or project.
To increase readability, you can associate AWS account IDs with meaningful names using GitHub Actions variables .
Imagine you defined your variables as follows:
Variable | Value |
---|---|
AWS_ACCOUNT_ID_DEV |
111122223333 |
AWS_ACCOUNT_ID_PROD |
444455556666 |
You can now use them in your workflows like this:
runs-on: sprinters:aws/${{ vars.AWS_ACCOUNT_ID_DEV }}:ubuntu-latest
runs-on: sprinters:aws/${{ vars.AWS_ACCOUNT_ID_PROD }}:ubuntu-latest
As expected, they will be substituted at runtime for their actual values:
runs-on: sprinters:aws/111122223333:ubuntu-latest
runs-on: sprinters:aws/444455556666:ubuntu-latest
Note that AWS doesn’t consider the account ID the be a secret :
While account IDs, like any identifying information, should be used and shared carefully, they are not considered secret, sensitive, or confidential information.
But if this is a concern to you, you can use this same technique to remove the explicit AWS account IDs from your labels.