Skip to content

Commit 7d44da7

Browse files
author
rohit-ng
committed
refactor: extract cluster name to optional variable
1 parent eff4989 commit 7d44da7

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

.header.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
![Kong](https://github.com/user-attachments/assets/3dda9db7-cf8e-4cd2-a507-4e50f9252ffe)
44

5-
# Prerequisites for Setting Up AWS SSM Parameters
5+
# Assumptions
66

7-
To configure and manage your AWS resources and GitHub Actions using Secure String parameters in AWS Systems Manager Parameter Store, follow the steps below to add the required parameters:
7+
This setup assumes that the `ECS cluster` that has `Auto Scaling Group (ASG)` exist with the name `default`. If you are using different name, you can provide those in the variables section of your Terraform configuration.
88

9-
# Important Note
9+
# Prerequisites for Setting Up AWS SSM Parameters
1010

11-
This setup assumes that the ECS cluster and Auto Scaling Group (ASG) exist with the name default. If you are using different names, you can provide those in the variables section of your Terraform configuration.
11+
To configure and manage your AWS resources and GitHub Actions using Secure String parameters in AWS Systems Manager Parameter Store, follow the steps below to add the required parameters:
1212

1313
## AWS CLI Installation
1414

examples/complete/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module "kong" {
2020
backup_window = var.backup_window
2121
maintenance_window = var.maintenance_window
2222

23+
cluster_name = var.cluster_name
2324
ssl_policy = var.ssl_policy
2425
container_image = var.container_image
2526
log_configuration_for_kong = var.log_configuration_for_kong

examples/complete/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ variable "maintenance_window" {
8383
type = string
8484
}
8585

86+
variable "cluster_name" {
87+
description = "Name of the cluster"
88+
type = string
89+
}
90+
8691
variable "ssl_policy" {
8792
type = string
8893
description = "(Optional) Name of the SSL Policy for the listener."

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ resource "aws_iam_role_policy_attachment" "ecs_exec" {
197197
################################################################################
198198

199199
data "aws_ecs_cluster" "default" {
200-
cluster_name = "default"
200+
cluster_name = var.cluster_name
201201
}
202202

203203
module "ecs_kong" {

variables.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,15 @@ variable "maintenance_window" {
9191
default = null
9292
}
9393

94+
variable "cluster_name" {
95+
description = "Name of the cluster"
96+
type = string
97+
default = "default"
98+
}
99+
94100
variable "ssl_policy" {
95101
type = string
96-
description = "(Optional) Name of the SSL Policy for the listener."
102+
description = "Name of the SSL Policy for the listener."
97103
default = "ELBSecurityPolicy-2016-08"
98104
}
99105

0 commit comments

Comments
 (0)