Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ module "this" {
security_group_type = "egress"
load_balancer_name = "${local.project_name}-lb"
domain = local.domain
domain_zone = local.zone
}
1 change: 1 addition & 0 deletions examples/cert/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ module "this" {
security_group_type = "project"
load_balancer_name = "${local.project_name}-lb"
domain = local.domain
domain_zone = local.zone
cert_use_strategy = "create"
}
1 change: 1 addition & 0 deletions examples/domain/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ module "this" {
security_group_type = "project"
load_balancer_name = "${local.project_name}-lb"
domain = local.domain
domain_zone = local.zone
}
32 changes: 32 additions & 0 deletions examples/dualstack/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

provider "aws" {
default_tags {
tags = {
Id = local.identifier
Owner = "terraform-ci@suse.com"
}
}
}
provider "acme" {
server_url = "https://acme-staging-v02.api.letsencrypt.org/directory"
}
locals {
identifier = var.identifier
example = "dualstack"
project_name = "tf-${substr(md5(join("-", [local.example, md5(local.identifier)])), 0, 5)}-${local.identifier}"
zone = var.zone
domain = "${local.identifier}.${local.zone}"
}

# AWS reserves the first four IP addresses and the last IP address in any CIDR block for its own use (cumulatively)
# gives 256 usable addresses from .1 to .254, but AWS reserves .1 to .4 and .255, leaving .5 to .254
module "this" {
source = "../../"
vpc_name = "${local.project_name}-vpc"
vpc_type = "dualstack"
security_group_name = "${local.project_name}-sg"
security_group_type = "egress"
load_balancer_name = "${local.project_name}-lb"
domain = local.domain
domain_zone = local.zone
}
18 changes: 18 additions & 0 deletions examples/dualstack/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
output "vpc" {
value = module.this.vpc
}
output "subnets" {
value = module.this.subnets
}
output "security_group" {
value = module.this.security_group
}
output "load_balancer" {
value = module.this.load_balancer
}
output "domain" {
value = module.this.domain
}
output "certificate" {
value = module.this.certificate
}
6 changes: 6 additions & 0 deletions examples/dualstack/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
variable "identifier" {
type = string
}
variable "zone" {
type = string
}
21 changes: 21 additions & 0 deletions examples/dualstack/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
terraform {
required_version = ">= 1.5.0, < 1.6"
required_providers {
local = {
source = "hashicorp/local"
version = ">= 2.4"
}
aws = {
source = "hashicorp/aws"
version = ">= 5.11"
}
random = {
source = "hashicorp/random"
version = ">= 3.1"
}
acme = {
source = "vancluever/acme"
version = ">= 2.0"
}
}
}
1 change: 1 addition & 0 deletions examples/ingress/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module "this" {
security_group_name = "${local.project_name}-sg"
security_group_type = "egress"
domain = local.domain
domain_zone = local.zone
load_balancer_name = "${local.project_name}-lb"
load_balancer_access_cidrs = {
application = {
Expand Down
33 changes: 33 additions & 0 deletions examples/ipv6/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

provider "aws" {
default_tags {
tags = {
Id = local.identifier
Owner = "terraform-ci@suse.com"
}
}
}
provider "acme" {
server_url = "https://acme-staging-v02.api.letsencrypt.org/directory"
}
locals {
identifier = var.identifier
example = "ipv6"
project_name = "tf-${substr(md5(join("-", [local.example, md5(local.identifier)])), 0, 5)}-${local.identifier}"
zone = var.zone
domain = "${local.identifier}.${local.zone}"
}

# AWS reserves the first four IP addresses and the last IP address in any CIDR block for its own use (cumulatively)
# gives 256 usable addresses from .1 to .254, but AWS reserves .1 to .4 and .255, leaving .5 to .254
module "this" {
source = "../../"
vpc_name = "${local.project_name}-vpc"
vpc_type = "ipv6"
subnet_use_strategy = "create"
security_group_name = "${local.project_name}-sg"
security_group_type = "egress"
load_balancer_name = "${local.project_name}-lb"
domain = local.domain
domain_zone = local.zone
}
21 changes: 21 additions & 0 deletions examples/ipv6/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
output "vpc" {
value = module.this.vpc
}
output "subnets" {
value = module.this.subnets
}
output "security_group" {
value = module.this.security_group
}
output "load_balancer" {
value = module.this.load_balancer
}
output "domain" {
value = module.this.domain
}
output "certificate" {
value = module.this.certificate
}
output "subnet_map" {
value = module.this.subnet_map
}
6 changes: 6 additions & 0 deletions examples/ipv6/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
variable "identifier" {
type = string
}
variable "zone" {
type = string
}
21 changes: 21 additions & 0 deletions examples/ipv6/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
terraform {
required_version = ">= 1.5.0, < 1.6"
required_providers {
local = {
source = "hashicorp/local"
version = ">= 2.4"
}
aws = {
source = "hashicorp/aws"
version = ">= 5.11"
}
random = {
source = "hashicorp/random"
version = ">= 3.1"
}
acme = {
source = "vancluever/acme"
version = ">= 2.0"
}
}
}
44 changes: 44 additions & 0 deletions examples/selectsubnets/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

provider "aws" {
default_tags {
tags = {
Id = local.identifier
Owner = "terraform-ci@suse.com"
}
}
}
provider "acme" {
server_url = "https://acme-staging-v02.api.letsencrypt.org/directory"
}
locals {
identifier = var.identifier
example = "selectsubnets"
project_name = "tf-${substr(md5(join("-", [local.example, md5(local.identifier)])), 0, 5)}-${local.identifier}"
zone = var.zone
domain = "${local.identifier}.${local.zone}"
}

module "setup" {
source = "../../"
vpc_name = local.project_name
subnet_names = [local.project_name]
security_group_use_strategy = "skip"
}

# AWS reserves the first four IP addresses and the last IP address in any CIDR block for its own use (cumulatively)
# gives 256 usable addresses from .1 to .254, but AWS reserves .1 to .4 and .255, leaving .5 to .254
module "this" {
depends_on = [
module.setup,
]
source = "../../"
vpc_use_strategy = "select"
vpc_name = local.project_name
subnet_use_strategy = "select"
subnet_names = [local.project_name]
security_group_name = "${local.project_name}-sg"
security_group_type = "egress"
load_balancer_name = "${local.project_name}-lb"
domain = local.domain
domain_zone = local.zone
}
18 changes: 18 additions & 0 deletions examples/selectsubnets/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
output "vpc" {
value = module.this.vpc
}
output "subnets" {
value = module.this.subnets
}
output "security_group" {
value = module.this.security_group
}
output "load_balancer" {
value = module.this.load_balancer
}
output "domain" {
value = module.this.domain
}
output "certificate" {
value = module.this.certificate
}
6 changes: 6 additions & 0 deletions examples/selectsubnets/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
variable "identifier" {
type = string
}
variable "zone" {
type = string
}
21 changes: 21 additions & 0 deletions examples/selectsubnets/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
terraform {
required_version = ">= 1.5.0, < 1.6"
required_providers {
local = {
source = "hashicorp/local"
version = ">= 2.4"
}
aws = {
source = "hashicorp/aws"
version = ">= 5.11"
}
random = {
source = "hashicorp/random"
version = ">= 3.1"
}
acme = {
source = "vancluever/acme"
version = ">= 2.0"
}
}
}
1 change: 1 addition & 0 deletions examples/selectvpc/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ module "this" {
security_group_type = "egress"
load_balancer_name = "${local.project_name}-lb"
domain = local.domain
domain_zone = local.zone
}
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading