Created
April 8, 2022 19:17
-
-
Save fguisso/ff1ef87d218ec364f9f15cb087d530c7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_providers { | |
aws = { | |
source = "hashicorp/aws" | |
version = "~> 3.27" | |
} | |
} | |
required_version = ">= 0.14.9" | |
} | |
provider "aws" { | |
profile = "default" | |
region = "us-east-1" | |
} | |
data "aws_availability_zones" "all_azs" { | |
state = "available" | |
} | |
resource "aws_launch_template" "ec2_launch_template" { | |
name = "github_runner_launch_template" | |
description = "Launch Template for GitHub Runners EC2" | |
image_id = var.ami | |
instance_type = var.instance_type | |
key_name = var.key_name | |
user_data = base64encode(templatefile("${path.cwd}/bootstrap.tmpl", { github_repo_url = var.github_repo_url, github_repo_pat_token = var.github_repo_pat_token, runner_name = var.runner_name, labels = join(",", var.labels) })) | |
tags = { | |
Name = "github_runner" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment