Skip to content

Commit

Permalink
Merge pull request #94 from jubranNassar/adds-missing-tags
Browse files Browse the repository at this point in the history
Adds missing variable
  • Loading branch information
jubranNassar authored Aug 19, 2024
2 parents f9b468b + 42feba9 commit fa109b2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .spacelift/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 1
module_version: 2.5.0
module_version: 2.6.0
tests:
- name: AMD64-based workerpool
project_root: examples/amd64
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ terraform {
}
module "my_workerpool" {
source = "github.com/spacelift-io/terraform-aws-spacelift-workerpool-on-ec2?ref=v2.5.0"
source = "github.com/spacelift-io/terraform-aws-spacelift-workerpool-on-ec2?ref=v2.6.0"
configuration = <<-EOT
export SPACELIFT_TOKEN="${var.worker_pool_config}"
Expand Down
4 changes: 4 additions & 0 deletions autoscaler.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ resource "aws_ssm_parameter" "spacelift_api_key_secret" {
name = "/${local.function_name}/spacelift-api-secret-${var.worker_pool_id}"
type = "SecureString"
value = var.spacelift_api_key_secret
tags = var.additional_tags
}

resource "null_resource" "download" {
Expand Down Expand Up @@ -62,13 +63,15 @@ resource "aws_lambda_function" "autoscaler" {
tracing_config {
mode = "Active"
}
tags = var.additional_tags
}

resource "aws_cloudwatch_event_rule" "scheduling" {
count = var.enable_autoscaling ? 1 : 0
name = local.function_name
description = "Spacelift autoscaler scheduling for worker pool ${var.worker_pool_id}"
schedule_expression = var.schedule_expression
tags = var.additional_tags
}

resource "aws_cloudwatch_event_target" "scheduling" {
Expand All @@ -90,4 +93,5 @@ resource "aws_cloudwatch_log_group" "log_group" {
count = var.enable_autoscaling ? 1 : 0
name = "/aws/lambda/${local.function_name}"
retention_in_days = 7
tags = var.additional_tags
}
3 changes: 3 additions & 0 deletions iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ resource "aws_iam_role" "this" {
Principal = { Service = "ec2.amazonaws.com" }
}]
})
tags = var.additional_tags
}

locals {
Expand All @@ -46,6 +47,7 @@ resource "aws_iam_instance_profile" "this" {

name = local.base_name
role = var.create_iam_role ? aws_iam_role.this[0].name : var.custom_iam_role_name
tags = var.additional_tags
}

data "aws_iam_policy_document" "autoscaler" {
Expand Down Expand Up @@ -126,4 +128,5 @@ resource "aws_iam_role" "autoscaler" {
}

depends_on = [module.asg]
tags = var.additional_tags
}
1 change: 1 addition & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,4 @@ variable "autoscaler_s3_package" {
description = "Configuration to retrieve autoscaler lambda package from s3 bucket"
default = null
}

0 comments on commit fa109b2

Please sign in to comment.