Skip to content

Commit

Permalink
Initial version of the ec2 worker demo
Browse files Browse the repository at this point in the history
  • Loading branch information
flavius-dinu committed Feb 21, 2024
1 parent 1e73aa4 commit 0c4f7a8
Show file tree
Hide file tree
Showing 3 changed files with 156 additions and 1 deletion.
87 changes: 86 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,86 @@
# ec2_worker_demo
# ec2_worker_demo
<!-- BEGIN_TF_DOCS -->
## Requirements

The following requirements are needed by this module:

- <a name="requirement_aws"></a> [aws](#requirement\_aws) (~> 4.57.0)

## Providers

No providers.

## Modules

The following Modules are called:

### <a name="module_my_workerpool"></a> [my\_workerpool](#module\_my\_workerpool)

Source: github.com/spacelift-io/terraform-aws-spacelift-workerpool-on-ec2

Version: v2.3.1

## Resources

No resources.

## Required Inputs

The following input variables are required:

### <a name="input_spacelift_api_key_endpoint"></a> [spacelift\_api\_key\_endpoint](#input\_spacelift\_api\_key\_endpoint)

Description: Full URL of the Spacelift API endpoint to use, eg. https://demo.app.spacelift.io

Type: `string`

### <a name="input_spacelift_api_key_id"></a> [spacelift\_api\_key\_id](#input\_spacelift\_api\_key\_id)

Description: ID of the Spacelift API key to use

Type: `string`

### <a name="input_spacelift_api_key_secret"></a> [spacelift\_api\_key\_secret](#input\_spacelift\_api\_key\_secret)

Description: Secret corresponding to the Spacelift API key to use

Type: `string`

### <a name="input_worker_pool_config"></a> [worker\_pool\_config](#input\_worker\_pool\_config)

Description: Configuration for the worker pool

Type: `string`

### <a name="input_worker_pool_id"></a> [worker\_pool\_id](#input\_worker\_pool\_id)

Description: ID of the worker pool

Type: `string`

### <a name="input_worker_pool_private_key"></a> [worker\_pool\_private\_key](#input\_worker\_pool\_private\_key)

Description: Private key for the worker pool

Type: `string`

### <a name="input_worker_pool_security_groups"></a> [worker\_pool\_security\_groups](#input\_worker\_pool\_security\_groups)

Description: The security groups to be used for the worker pool

Type: `list(string)`

### <a name="input_worker_pool_subnets"></a> [worker\_pool\_subnets](#input\_worker\_pool\_subnets)

Description: The subnets to be used for the worker pool

Type: `list(string)`

## Optional Inputs

No optional inputs.

## Outputs

No outputs.
<!-- END_TF_DOCS -->
30 changes: 30 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.57.0"
}
}
}

provider "aws" {
region = "eu-west-1"
}

module "my_workerpool" {
source = "github.com/spacelift-io/terraform-aws-spacelift-workerpool-on-ec2?ref=v2.3.1"

configuration = <<-EOT
export SPACELIFT_TOKEN="${var.worker_pool_config}"
export SPACELIFT_POOL_PRIVATE_KEY="${var.worker_pool_private_key}"
EOT

min_size = 1
max_size = 5
worker_pool_id = var.worker_pool_id
security_groups = var.worker_pool_security_groups
vpc_subnets = var.worker_pool_subnets
spacelift_api_key_endpoint = var.spacelift_api_key_endpoint
spacelift_api_key_id = var.spacelift_api_key_id
spacelift_api_key_secret = var.spacelift_api_key_secret
}
40 changes: 40 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
variable "worker_pool_config" {
description = "Configuration for the worker pool"
type = string
}

variable "worker_pool_private_key" {
description = "Private key for the worker pool"
type = string
}

variable "worker_pool_id" {
description = "ID of the worker pool"
type = string
}

variable "spacelift_api_key_id" {
type = string
description = "ID of the Spacelift API key to use"
}

variable "spacelift_api_key_secret" {
type = string
sensitive = true
description = "Secret corresponding to the Spacelift API key to use"
}

variable "spacelift_api_key_endpoint" {
type = string
description = "Full URL of the Spacelift API endpoint to use, eg. https://demo.app.spacelift.io"
}

variable "worker_pool_security_groups" {
description = "The security groups to be used for the worker pool"
type = list(string)
}

variable "worker_pool_subnets" {
description = "The subnets to be used for the worker pool"
type = list(string)
}

0 comments on commit 0c4f7a8

Please sign in to comment.