From 4947b5ad00e8c6277c39c792b114d599266b2d77 Mon Sep 17 00:00:00 2001
From: Emin Alemdar <77338109+eminalemdar@users.noreply.github.com>
Date: Mon, 2 Oct 2023 17:05:53 +0300
Subject: [PATCH] Updated IAM Policy and added default null values for
autoscaler vars (#54)
* Updated IAM Policy and added default null values for autoscaler variables
* Updated the module version numbers
---
.spacelift/config.yml | 2 +-
README.md | 8 ++++----
iam.tf | 2 +-
variables.tf | 3 +++
4 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/.spacelift/config.yml b/.spacelift/config.yml
index 9eff0b3..b0722c8 100644
--- a/.spacelift/config.yml
+++ b/.spacelift/config.yml
@@ -1,5 +1,5 @@
version: 1
-module_version: 1.8.0
+module_version: 1.8.1
tests:
- name: AMD64-based workerpool
project_root: examples/amd64
diff --git a/README.md b/README.md
index b0819ff..680d2a1 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ terraform {
}
module "my_workerpool" {
- source = "github.com/spacelift-io/terraform-aws-spacelift-workerpool-on-ec2?ref=v1.8.0"
+ source = "github.com/spacelift-io/terraform-aws-spacelift-workerpool-on-ec2?ref=v1.8.1"
configuration = <<-EOT
export SPACELIFT_TOKEN="${var.worker_pool_config}"
@@ -124,9 +124,9 @@ $ make docs
| [poweroff\_delay](#input\_poweroff\_delay) | Number of seconds to wait before powering the EC2 instance off after the Spacelift launcher stopped | `number` | `15` | no |
| [schedule\_expression](#input\_schedule\_expression) | The scheduling expression | `string` | `"rate(1 minute)"` | no |
| [security\_groups](#input\_security\_groups) | List of security groups to use | `list(string)` | n/a | yes |
-| [spacelift\_api\_key\_endpoint](#input\_spacelift\_api\_key\_endpoint) | Full URL of the Spacelift API endpoint to use, eg. https://demo.app.spacelift.io | `string` | n/a | yes |
-| [spacelift\_api\_key\_id](#input\_spacelift\_api\_key\_id) | ID of the Spacelift API key to use | `string` | n/a | yes |
-| [spacelift\_api\_key\_secret](#input\_spacelift\_api\_key\_secret) | Secret corresponding to the Spacelift API key to use | `string` | n/a | yes |
+| [spacelift\_api\_key\_endpoint](#input\_spacelift\_api\_key\_endpoint) | Full URL of the Spacelift API endpoint to use, eg. https://demo.app.spacelift.io | `string` | `null` | no |
+| [spacelift\_api\_key\_id](#input\_spacelift\_api\_key\_id) | ID of the Spacelift API key to use | `string` | `null` | no |
+| [spacelift\_api\_key\_secret](#input\_spacelift\_api\_key\_secret) | Secret corresponding to the Spacelift API key to use | `string` | `null` | no |
| [volume\_encryption](#input\_volume\_encryption) | Whether to encrypt the EBS volume | `bool` | `false` | no |
| [volume\_size](#input\_volume\_size) | Size of instance EBS volume | `number` | `40` | no |
| [vpc\_subnets](#input\_vpc\_subnets) | List of VPC subnets to use | `list(string)` | n/a | yes |
diff --git a/iam.tf b/iam.tf
index e9cb7f2..cc556ce 100644
--- a/iam.tf
+++ b/iam.tf
@@ -68,7 +68,7 @@ data "aws_iam_policy_document" "autoscaler" {
"autoscaling:DescribeAutoScalingGroups",
]
- resources = [module.asg.autoscaling_group_arn]
+ resources = ["*"]
}
# Allow the Lambda to DescribeInstances and TerminateInstances on the EC2 instances.
diff --git a/variables.tf b/variables.tf
index fb8b704..e1b57b3 100644
--- a/variables.tf
+++ b/variables.tf
@@ -147,17 +147,20 @@ variable "autoscaler_version" {
variable "spacelift_api_key_id" {
type = string
description = "ID of the Spacelift API key to use"
+ default = null
}
variable "spacelift_api_key_secret" {
type = string
sensitive = true
description = "Secret corresponding to the Spacelift API key to use"
+ default = null
}
variable "spacelift_api_key_endpoint" {
type = string
description = "Full URL of the Spacelift API endpoint to use, eg. https://demo.app.spacelift.io"
+ default = null
}
variable "schedule_expression" {