-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Download architecture specific laucher (#30)
- Loading branch information
Showing
12 changed files
with
164 additions
and
63 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
version: 1 | ||
module_version: 1.2.0 | ||
module_version: 1.3.0 | ||
|
||
tests: | ||
- name: Set up in a separate VPC | ||
project_root: examples/separate-vpc | ||
- name: AMD64-based workerpool | ||
project_root: examples/amd64 | ||
|
||
- name: ARM64-based workerpool | ||
project_root: examples/arm64 |
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# AMD64 (x86_64) based worker pool | ||
|
||
In this example, we are setting up an amd64-based EC2 autoscaling group inside a VPC. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "<5.0" | ||
} | ||
|
||
random = { source = "hashicorp/random" } | ||
} | ||
} | ||
|
||
provider "aws" { | ||
region = "eu-west-1" | ||
} | ||
|
||
data "aws_vpc" "this" { | ||
default = true | ||
} | ||
|
||
data "aws_security_group" "this" { | ||
name = "default" | ||
vpc_id = data.aws_vpc.this.id | ||
} | ||
|
||
data "aws_subnets" "this" { | ||
filter { | ||
name = "vpc-id" | ||
values = [data.aws_vpc.this.id] | ||
} | ||
} | ||
|
||
resource "random_pet" "this" {} | ||
|
||
#### Spacelift worker pool #### | ||
|
||
module "this" { | ||
source = "../../" | ||
|
||
configuration = <<-EOT | ||
export SPACELIFT_TOKEN="<token-here>" | ||
export SPACELIFT_POOL_PRIVATE_KEY="<private-key-here>" | ||
EOT | ||
security_groups = [data.aws_security_group.this.id] | ||
vpc_subnets = data.aws_subnets.this.ids | ||
worker_pool_id = random_pet.this.id | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# ARM64 pool | ||
|
||
In this example, we'll create a worker pool that will run on ARM64 instances. We'll use the `t4g.micro` instance type, which is the smallest ARM64 instance type available on AWS. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
terraform { | ||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "<5.0" | ||
} | ||
|
||
random = { source = "hashicorp/random" } | ||
} | ||
} | ||
|
||
provider "aws" { | ||
region = "eu-west-1" | ||
} | ||
|
||
data "aws_vpc" "this" { | ||
default = true | ||
} | ||
|
||
data "aws_security_group" "this" { | ||
name = "default" | ||
vpc_id = data.aws_vpc.this.id | ||
} | ||
|
||
data "aws_subnets" "this" { | ||
filter { | ||
name = "vpc-id" | ||
values = [data.aws_vpc.this.id] | ||
} | ||
} | ||
|
||
data "aws_ami" "this" { | ||
most_recent = true | ||
name_regex = "^spacelift-\\d{10}-arm64$" | ||
owners = ["643313122712"] | ||
|
||
filter { | ||
name = "root-device-type" | ||
values = ["ebs"] | ||
} | ||
|
||
filter { | ||
name = "virtualization-type" | ||
values = ["hvm"] | ||
} | ||
|
||
filter { | ||
name = "architecture" | ||
values = ["arm64"] | ||
} | ||
} | ||
|
||
resource "random_pet" "this" {} | ||
|
||
#### Spacelift worker pool #### | ||
|
||
module "this" { | ||
source = "../../" | ||
|
||
configuration = <<-EOT | ||
export SPACELIFT_TOKEN="<token-here>" | ||
export SPACELIFT_POOL_PRIVATE_KEY="<private-key-here>" | ||
EOT | ||
security_groups = [data.aws_security_group.this.id] | ||
vpc_subnets = data.aws_subnets.this.ids | ||
worker_pool_id = random_pet.this.id | ||
ami_id = data.aws_ami.this.id | ||
ec2_instance_type = "t4g.micro" | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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