Skip to main content

Deploying a Runner with CloudFormation

Prerequisites

  1. AWS Account: You need to have an AWS account to use AWS services, including CloudFormation.
  2. AWS EC2 Key Pair: Before creating the CloudFormation stack, you should have an EC2 Key Pair set up in your AWS account. If you don't have one, you can follow the AWS documentation to create a key pair.
  3. BlinkURL: You will need to know the Blink URL the runner should connect to. This parameter is mandatory for the CloudFormation stack.

Deployment

Use this option if you don't have Helm or a Host with a Docker Engine. Before following the next steps, make sure you have an AWS EC2 Key Pair:

  1. Click on the CloudFormation option and click on the blue Cloudformation stack link.

    runner

  2. Please sign into your AWS Account if you are not already signed in. You will then be redirected to a new page where you must fill out the Quick create stack form.

  3. Enter the values in the form as follows:

    ParameterDescription
    Stack nameGive your stack a name
    BlinkURLThe Blink URL the runner should connect to. Do not change the default value. This parameter is mandatory.
    DiskSizeThe disk size of the EC2 instance running the runner. Default is 40. This parameter is mandatory.
    InstanceEc2KeyPairThe EC2 Key Pair used for logging in to the EC2 instance running the Runner. This parameter is mandatory.
    InstanceSshAccessCIdrBlockA CIDR block describing the IP addresses from which the EC2 instance running the Runner should be accessible from. This parameter is mandatory.
    InstanceTypeThe type of the EC2 instance running the runner. Select a type from the drop-down menu. This parameter is mandatory.
    LatestAmiIDThe path of the AWS SSM parameter which stores the AMI ID of the latest Amazon Linux version. Do not change the default value.
    RunnerApiKeyCopy from the text are in the blink platform step 2 and paste the value. This parameter is mandatory.
    RunnerVersionDo not change the default value. This parameter is mandatory.
    SubnetIdID of a subnet which can access the internet in the given VPC. If this parameter and Vpcid will be left empty, a VPC with a public Subnet and an internet gateway will be created. Otherwise this parameter should be specified.
    VpcIdID of a VPC to create the EC2 instance running the runner in. If this parameter and Sunetid will be left empty, a VPC with a public Subnet and an internet gateway will be created. Otherwise this parameter should be specified.
    OnPremVaultUrlThe URL of the Vault instance the Runner should connect to. Should be specified together with the OnPremVaultRootToken parameter.
    OnPremVaultRootTokenThe Root Token of the Vault instance the Runner should connect to. Should be specified together with the OnPremVaultUrl parameter.
  4. Once you have entered all the correct values click Create stack. AWS will create a stack form with all the specific values you filled out in the form.

  5. Click Close. You can then head over to the Runners page in the Blink Platform, where you will see that your runner is now connected and how many instances it has.

    runner

    Connecting to the Runner host created with CloudFormation

    Once the stack if fully created from the above template, navigate to the Outputs tab. There you can find the Ec2InstanceUser and Ec2InstancePublicDnsName outputs, among others. Using the values of these 2 outputs and the key file which corresponds to the EC2 Key Pair you selected when creating the stack (The file should have been downloaded when the Key Pair was created), you should be able to log in to the Runner host by running the following command (given that the IP of the host from which you're running the command is within the range defined by the CIDR block you specified when creating the stack):

      ssh -i <path_to_key_file> <value of Ec2InstanceUser output>@<value of Ec2InstancePublicDnsName output>