Skip to content

Terraform module which provisions EC2 instances as Shell Runners for Gitlab Projects

Notifications You must be signed in to change notification settings

infraspecdev/terraform-aws-gitlab-shell-runner

Repository files navigation

gitlab-shell-runner

This Terraform module provisions an AWS EC2 instance and configures it as a GitLab Runner with Shell executor, allowing it to run CI/CD jobs for your GitLab projects. The module can be used to deploy multiple runners and can be customized to your specific needs.

Usage

module "gitlab_shell_runner" {
  source = "https://github.com/infraspecdev/terraform-aws-gitlab-shell-runner"

  ami_id                    = "ami-0addfae420fd47aab"
  instance_type             = "t2.micro"
  instance_count            = 2
  vpc_security_group_ids    = ["sg-0b0b0b0b0b0b0b0b0"]
  subnet_id                 = "subnet-0b0e1c4b5b1b1b1b1"
  gitlab_url                = "https://gitlab.example.com"
  runner_registration_token = "runner-registration-token-here"
  ssh_public_key            = "ssh-public-key-here"
}

Examples

Example

Requirements

Name Version
terraform ~> 1.3.0
aws >= 4.49.0

Providers

Name Version
aws 4.51.0

Modules

No modules.

Resources

Name Type
aws_instance.this resource
aws_key_pair.this resource

Inputs

Name Description Type Default Required
additional_tags Additional tags to apply to the resources map(string) {} no
ami_id AMI to use for the instance string "ami-0addfae420fd47aab" no
gitlab_url URL of your Gitlab instance string n/a yes
instance_count Number of instances to provision number n/a yes
instance_type Type of instance to provision string n/a yes
run_untagged_jobs Should run untagged jobs or not bool true no
runner_description Description for Gitlab Runners string "Shell Runner" no
runner_locked Should Lock the runners or not bool false no
runner_registration_token Registration token for Gitlab Runners string n/a yes
runner_tags Tags for Gitlab Runners for filtering list(string)
[
"shell",
"aws"
]
no
ssh_public_key Existing SSH public key to use for the key pair string null no
subnet_id VPC Subnet ID to launch in string n/a yes
vpc_security_group_ids List of security group IDs to associate list(string) n/a yes

Outputs

No outputs.

Authors

Module maintained by Infraspec.

About

Terraform module which provisions EC2 instances as Shell Runners for Gitlab Projects

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •