Skip to content

Commit

Permalink
adjust ephemeral example for job retry
Browse files Browse the repository at this point in the history
  • Loading branch information
npalm committed Aug 16, 2024
1 parent 161e50e commit 939aebd
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 11 deletions.
15 changes: 9 additions & 6 deletions examples/default/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ module "runners" {
# iops = null
# }]

# Grab zip files via lambda_download
# When not explicitly set lambda zip files are grapped from the module requiring lambda build.
# Alternatively you can set the path to the lambda zip files here.
#
# For example grab zip files via lambda_download
# webhook_lambda_zip = "../lambdas-download/webhook.zip"
# runner_binaries_syncer_lambda_zip = "../lambdas-download/runner-binaries-syncer.zip"
# runners_lambda_zip = "../lambdas-download/runners.zip"
Expand Down Expand Up @@ -117,11 +120,11 @@ module "runners" {
}

# enable job_retry feature. Be careful with this feature, it can lead to API rate limits.
job_retry = {
enable = true
max_attempts = 1
delay_in_seconds = 180
}
# job_retry = {
# enable = true
# max_attempts = 1
# delay_in_seconds = 180
# }

# enable metric creation by the control plane (experimental)
# enable_metrics_control_plane = true
Expand Down
20 changes: 15 additions & 5 deletions examples/ephemeral/main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
locals {
environment = var.environment != null ? var.environment : "ephemeral"
aws_region = "eu-west-1"
aws_region = var.aws_region
}

resource "random_id" "random" {
Expand Down Expand Up @@ -32,10 +32,13 @@ module "runners" {
webhook_secret = random_id.random.hex
}

# Grab the lambda packages from local directory. Must run /.ci/build.sh first
webhook_lambda_zip = "../../lambda_output/webhook.zip"
runner_binaries_syncer_lambda_zip = "../../lambda_output/runner-binaries-syncer.zip"
runners_lambda_zip = "../../lambda_output/runners.zip"
# When not explicitly set lambda zip files are grapped from the module requiring lambda build.
# Alternatively you can set the path to the lambda zip files here.
#
# For example grab zip files via lambda_download
# webhook_lambda_zip = "../lambdas-download/webhook.zip"
# runner_binaries_syncer_lambda_zip = "../lambdas-download/runner-binaries-syncer.zip"
# runners_lambda_zip = "../lambdas-download/runners.zip"

enable_organization_runners = true
runner_extra_labels = ["default", "example"]
Expand Down Expand Up @@ -93,6 +96,13 @@ module "runners" {
# maxReceiveCount = 50 # 50 retries every 30 seconds => 25 minutes
# deadLetterTargetArn = null
# }

# Enable beta feature job retry
job_retry = {
enable = true
max_attempts = 1
delay_in_seconds = 180
}
}

module "webhook_github_app" {
Expand Down
8 changes: 8 additions & 0 deletions examples/ephemeral/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,11 @@ variable "environment" {
type = string
default = null
}


variable "aws_region" {
description = "AWS region."

type = string
default = "eu-west-1"
}

0 comments on commit 939aebd

Please sign in to comment.