-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parameterized name as suffix for all resources tag #31
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
variable "name" { | ||
description = "Unique name to be assigned to all resources" | ||
default = "" | ||
type = string | ||
} | ||
|
||
variable "region" { | ||
description = "The region from which this module will be executed." | ||
type = string | ||
validation { | ||
condition = can(regex("(us(-gov)?|ap|ca|cn|eu|sa)-(central|(north|south)?(east|west)?)-\\d", var.region)) | ||
error_message = "Variable var: region is not valid." | ||
} | ||
} | ||
|
||
variable "tags" { | ||
description = "Tags to apply to resources" | ||
|
@@ -18,3 +32,19 @@ variable "temp_license" { | |
description = "Temporary license details" | ||
type = map(string) | ||
} | ||
|
||
variable "k8s_version" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wellsiau-aws I believe that K8 version is best to not be parametrised in alignment with the EKS Addons v5 https://github.com/aws-ia/terraform-aws-eks-blueprints-addons/blob/main/tests/complete/main.tf#L65 and blueprints patterns https://github.com/aws-ia/terraform-aws-eks-blueprints/blob/main/patterns/stateful/main.tf#L6 in benefit of maintenance and its support. It is aligned with Blueprints Terraform caveats that differs from AWS Quickstart approach. In the second there were many parameters to be configured (including passing your existing VPC in our old CloudBees CI which makes things more complicated to maintain). Consecutive releases of this addons increase the version of the K8s as well as the CloudBees CI charts https://github.com/cloudbees/terraform-aws-cloudbees-ci-eks-addon/blob/main/main.tf#L12 ==> That version bump requires to be tested and validated. Leaving the K8s version as variable could lead to a situation not tested and frustration for end-user. Note: At the end blueprints are seen as pattern but users can modify locals for their requirements at their own risk (assuming they know what they are doing). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This variable makes it easier for user to run test without modifying the underlying .tf files. That said, I recognized the concern of externalizing other cluster / EKS level attributes, which are not the purpose of this reference blueprint. |
||
description = "EKS cluster version, refer to: https://docs.cloudbees.com/docs/cloudbees-common/latest/supported-platforms/cloudbees-ci-cloud#_kubernetes " | ||
type = string | ||
default = "1.26" | ||
} | ||
|
||
variable "vpc_cidr" { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wellsiau-aws I personally believe that CIDR for the EKS cluster VPC is best to not be parametrised in alignment with the EKS Addons v5 https://github.com/aws-ia/terraform-aws-eks-blueprints-addons/blob/main/tests/complete/main.tf#L47 and blueprints patterns https://github.com/aws-ia/terraform-aws-eks-blueprints/blob/main/patterns/stateful/main.tf#L38 in benefit of maintenance. As it was said before, it is aligned with Blueprints Terraform caveats that differs from AWS Quickstart approach. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same as above |
||
description = "CIDR for the EKS cluster VPC" | ||
type = string | ||
default = "10.0.0.0/16" | ||
validation { | ||
condition = can(cidrhost(var.vpc_cidr, 0)) | ||
error_message = "Must be valid IPv4 CIDR." | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions:
1.- Replace
cbci-bp-${var.name}
bycbci-bp01${local.name}
. Notecbci-bp01
==> it refers to CBCI Blueprints 01 (getting started). It does nothing to do with random2.- Add to locals
3.- Please, repeat the same approach for
cbci-bp02${local.name}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good, I will add the suggestion