fix: add more random names (#70)

Signed-off-by: matttrach <matt.trachier@suse.com>
This commit is contained in:
Matt Trachier 2024-05-03 16:48:42 -05:00 committed by GitHub
parent 261177ad4c
commit 403f6309ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
17 changed files with 153 additions and 53 deletions

View File

@ -11,18 +11,26 @@ provider "acme" {
server_url = "https://acme-staging-v02.api.letsencrypt.org/directory"
}
locals {
identifier = var.identifier
name = "tf-${local.identifier}"
zone = var.zone
domain = "${local.identifier}.${local.zone}"
identifier = var.identifier
example = "basic"
project_name = "tf-${substr(md5(join("-", [local.example, random_pet.string.id])), 0, 5)}-${local.identifier}"
zone = var.zone
domain = "${local.identifier}.${local.zone}"
}
resource "random_pet" "string" {
keepers = {
# regenerate the pet name when the identifier changes
identifier = local.identifier
}
length = 1
}
# AWS reserves the first four IP addresses and the last IP address in any CIDR block for its own use (cumulatively)
module "this" {
source = "../../"
vpc_name = local.name
vpc_name = "${local.project_name}-vpc"
vpc_cidr = "10.0.255.0/24" # gives 256 usable addresses from .1 to .254, but AWS reserves .1 to .4 and .255, leaving .5 to .254
security_group_name = local.name
security_group_name = "${local.project_name}-sg"
security_group_type = "egress"
load_balancer_name = local.name
load_balancer_name = "${local.project_name}-lb"
domain = local.domain
}

View File

@ -9,6 +9,10 @@ terraform {
source = "hashicorp/aws"
version = ">= 5.11"
}
random = {
source = "hashicorp/random"
version = ">= 3.1"
}
acme = {
source = "vancluever/acme"
version = ">= 2.0"

View File

@ -11,21 +11,29 @@ provider "acme" {
server_url = "https://acme-staging-v02.api.letsencrypt.org/directory"
}
locals {
identifier = var.identifier
name = "tf-${local.identifier}"
owner = "terraform-ci@suse.com"
zone = var.zone
domain = "${local.identifier}.${local.zone}"
identifier = var.identifier
example = "domain"
project_name = "tf-${substr(md5(join("-", [local.example, random_pet.string.id])), 0, 5)}-${local.identifier}"
owner = "terraform-ci@suse.com"
zone = var.zone
domain = "${local.identifier}.${local.zone}"
#zone = var.domain_zone
}
resource "random_pet" "string" {
keepers = {
# regenerate the pet name when the identifier changes
identifier = local.identifier
}
length = 1
}
# AWS reserves the first four IP addresses and the last IP address in any CIDR block for its own use (cumulatively)
module "this" {
source = "../../"
vpc_name = local.name
vpc_name = "${local.project_name}-vpc"
vpc_cidr = "10.0.255.0/24" # gives 256 usable addresses from .1 to .254, but AWS reserves .1 to .4 and .255, leaving .5 to .254
security_group_name = local.name
security_group_name = "${local.project_name}-sg"
security_group_type = "project"
load_balancer_name = local.name
load_balancer_name = "${local.project_name}-lb"
domain = local.domain
#domain_zone = local.zone # only specify when creating a new zone
}

View File

@ -9,6 +9,10 @@ terraform {
source = "hashicorp/aws"
version = ">= 5.11"
}
random = {
source = "hashicorp/random"
version = ">= 3.1"
}
acme = {
source = "vancluever/acme"
version = ">= 2.0"

View File

@ -12,20 +12,28 @@ provider "acme" {
#server_url = "https://acme-v02.api.letsencrypt.org/directory" # use this url in production
}
locals {
identifier = var.identifier
name = "tf-${local.identifier}"
zone = var.zone
domain = "${local.identifier}.${local.zone}"
identifier = var.identifier
example = "ingress"
project_name = "tf-${substr(md5(join("-", [local.example, random_pet.string.id])), 0, 5)}-${local.identifier}"
zone = var.zone
domain = "${local.identifier}.${local.zone}"
}
resource "random_pet" "string" {
keepers = {
# regenerate the pet name when the identifier changes
identifier = local.identifier
}
length = 1
}
# AWS reserves the first four IP addresses and the last IP address in any CIDR block for its own use (cumulatively)
module "this" {
source = "../../"
vpc_name = local.name
vpc_name = "${local.project_name}-vpc"
vpc_cidr = "10.0.255.0/24" # gives 256 usable addresses from .1 to .254, but AWS reserves .1 to .4 and .255, leaving .5 to .254
security_group_name = local.name
security_group_name = "${local.project_name}-sg"
security_group_type = "egress"
domain = local.domain
load_balancer_name = local.name
load_balancer_name = "${local.project_name}-lb"
load_balancer_access_cidrs = {
application = {
port = 443

View File

@ -9,6 +9,10 @@ terraform {
source = "hashicorp/aws"
version = ">= 5.11"
}
random = {
source = "hashicorp/random"
version = ">= 3.1"
}
acme = {
source = "vancluever/acme"
version = ">= 2.0"

View File

@ -11,16 +11,24 @@ provider "acme" {
server_url = "https://acme-staging-v02.api.letsencrypt.org/directory"
}
locals {
identifier = var.identifier
name = "tf-${local.identifier}"
identifier = var.identifier
example = "loadbalancer"
project_name = "tf-${substr(md5(join("-", [local.example, random_pet.string.id])), 0, 5)}-${local.identifier}"
}
resource "random_pet" "string" {
keepers = {
# regenerate the pet name when the identifier changes
identifier = local.identifier
}
length = 1
}
# AWS reserves the first four IP addresses and the last IP address in any CIDR block for its own use (cumulatively)
module "this" {
source = "../../"
vpc_name = local.name
vpc_name = "${local.project_name}-vpc"
vpc_cidr = "10.0.255.0/24" # gives 256 usable addresses from .1 to .254, but AWS reserves .1 to .4 and .255, leaving .5 to .254
security_group_name = local.name
security_group_name = "${local.project_name}-sg"
security_group_type = "project"
load_balancer_name = local.name
load_balancer_name = "${local.project_name}-lb"
domain_use_strategy = "skip"
}

View File

@ -9,6 +9,10 @@ terraform {
source = "hashicorp/aws"
version = ">= 5.11"
}
random = {
source = "hashicorp/random"
version = ">= 3.1"
}
acme = {
source = "vancluever/acme"
version = ">= 2.0"

View File

@ -11,15 +11,23 @@ provider "acme" {
server_url = "https://acme-staging-v02.api.letsencrypt.org/directory"
}
locals {
identifier = var.identifier
name = "tf-${local.identifier}"
identifier = var.identifier
example = "securitygroup"
project_name = "tf-${substr(md5(join("-", [local.example, random_pet.string.id])), 0, 5)}-${local.identifier}"
}
resource "random_pet" "string" {
keepers = {
# regenerate the pet name when the identifier changes
identifier = local.identifier
}
length = 1
}
# AWS reserves the first four IP addresses and the last IP address in any CIDR block for its own use (cumulatively)
module "this" {
source = "../../"
vpc_name = local.name
vpc_name = "${local.project_name}-vpc"
vpc_cidr = "10.0.255.0/24" # gives 256 usable addresses from .1 to .254, but AWS reserves .1 to .4 and .255, leaving .5 to .254
security_group_name = local.name
security_group_name = "${local.project_name}-sg"
security_group_type = "project"
load_balancer_use_strategy = "skip" # everything depending on load balancer is skipped implicitly
}

View File

@ -9,6 +9,10 @@ terraform {
source = "hashicorp/aws"
version = ">= 5.11"
}
random = {
source = "hashicorp/random"
version = ">= 3.1"
}
acme = {
source = "vancluever/acme"
version = ">= 2.0"

View File

@ -12,15 +12,23 @@ provider "acme" {
}
locals {
identifier = var.identifier
name = "tf-${local.identifier}"
zone = var.zone
domain = "${local.identifier}.${local.zone}"
identifier = var.identifier
example = "selectvpc"
project_name = "tf-${substr(md5(join("-", [local.example, random_pet.string.id])), 0, 5)}-${local.identifier}"
zone = var.zone
domain = "${local.identifier}.${local.zone}"
}
resource "random_pet" "string" {
keepers = {
# regenerate the pet name when the identifier changes
identifier = local.identifier
}
length = 1
}
module "setup" {
source = "../../"
vpc_name = local.name
vpc_name = "${local.project_name}-vpc"
vpc_cidr = "10.0.255.0/24"
subnet_use_strategy = "skip"
}
@ -32,8 +40,8 @@ module "this" {
source = "../../"
vpc_use_strategy = "select"
vpc_name = module.setup.vpc.tags.Name
security_group_name = local.name
security_group_name = "${local.project_name}-sg"
security_group_type = "egress"
load_balancer_name = local.name
load_balancer_name = "${local.project_name}-lb"
domain = local.domain
}

View File

@ -9,6 +9,10 @@ terraform {
source = "hashicorp/aws"
version = ">= 5.11"
}
random = {
source = "hashicorp/random"
version = ">= 3.1"
}
acme = {
source = "vancluever/acme"
version = ">= 2.0"

View File

@ -9,6 +9,10 @@ terraform {
source = "hashicorp/aws"
version = ">= 5.11"
}
random = {
source = "hashicorp/random"
version = ">= 3.1"
}
acme = {
source = "vancluever/acme"
version = ">= 2.0"

View File

@ -11,13 +11,21 @@ provider "acme" {
server_url = "https://acme-staging-v02.api.letsencrypt.org/directory"
}
locals {
identifier = var.identifier
name = "tf-${local.identifier}"
identifier = var.identifier
example = "subnets"
project_name = "tf-${substr(md5(join("-", [local.example, random_pet.string.id])), 0, 5)}-${local.identifier}"
}
resource "random_pet" "string" {
keepers = {
# regenerate the pet name when the identifier changes
identifier = local.identifier
}
length = 1
}
# AWS reserves the first four IP addresses and the last IP address in any CIDR block for its own use (cumulatively)
module "this" {
source = "../../"
vpc_name = local.name
vpc_name = "${local.project_name}-vpc"
vpc_cidr = "10.0.255.0/24" # gives 256 usable addresses from .1 to .254, but AWS reserves .1 to .4 and .255, leaving .5 to .254
subnets = {
"subnetA" = {

View File

@ -9,6 +9,10 @@ terraform {
source = "hashicorp/aws"
version = ">= 5.11"
}
random = {
source = "hashicorp/random"
version = ">= 3.1"
}
acme = {
source = "vancluever/acme"
version = ">= 2.0"

View File

@ -11,13 +11,21 @@ provider "acme" {
server_url = "https://acme-staging-v02.api.letsencrypt.org/directory"
}
locals {
identifier = var.identifier
name = "tf-${local.identifier}"
identifier = var.identifier
example = "vpc"
project_name = "tf-${substr(md5(join("-", [local.example, random_pet.string.id])), 0, 5)}-${local.identifier}"
}
resource "random_pet" "string" {
keepers = {
# regenerate the pet name when the identifier changes
identifier = local.identifier
}
length = 1
}
# AWS reserves the first four IP addresses and the last IP address in any CIDR block for its own use (cumulatively)
module "this" {
source = "../../"
vpc_name = local.name
vpc_name = "${local.project_name}-vpc"
vpc_cidr = "10.0.255.0/24" # gives 256 usable addresses from .1 to .254, but AWS reserves .1 to .4 and .255, leaving .5 to .254
subnet_use_strategy = "skip" # everything depending on subnet is skipped implicitly
}

View File

@ -9,6 +9,10 @@ terraform {
source = "hashicorp/aws"
version = ">= 5.11"
}
random = {
source = "hashicorp/random"
version = ">= 3.1"
}
acme = {
source = "vancluever/acme"
version = ">= 2.0"