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
4 changes: 0 additions & 4 deletions examples/basic/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ output "subnet" {
value = module.TestBasic.subnet
}

output "cidr" {
value = module.TestBasic.cidr
}

output "security_group" {
value = module.TestBasic.security_group
}
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.2.0"
required_version = ">= 1.2.0, < 1.6"
required_providers {
local = {
source = "hashicorp/local"
Expand Down
4 changes: 0 additions & 4 deletions examples/override/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ output "subnet" {
value = module.TestOverride.subnet
}

output "cidr" {
value = module.TestOverride.cidr
}

output "security_group" {
value = module.TestOverride.security_group
}
Expand Down
2 changes: 1 addition & 1 deletion examples/override/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.2.0"
required_version = ">= 1.2.0, < 1.6"
required_providers {
local = {
source = "hashicorp/local"
Expand Down
4 changes: 0 additions & 4 deletions examples/personal/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ output "subnet" {
value = module.TestPersonal.subnet
}

output "cidr" {
value = module.TestPersonal.cidr
}

output "security_group" {
value = module.TestPersonal.security_group
}
Expand Down
2 changes: 1 addition & 1 deletion examples/personal/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.2.0"
required_version = ">= 1.2.0, < 1.6"
required_providers {
local = {
source = "hashicorp/local"
Expand Down
4 changes: 0 additions & 4 deletions examples/project/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ output "subnet" {
value = module.TestProject.subnet
}

output "cidr" {
value = module.TestProject.cidr
}

output "security_group" {
value = module.TestProject.security_group
}
Expand Down
2 changes: 1 addition & 1 deletion examples/project/versions.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.2.0"
required_version = ">= 1.2.0, < 1.6"
required_providers {
local = {
source = "hashicorp/local"
Expand Down
16 changes: 16 additions & 0 deletions examples/sgip/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

locals {
identifier = "sgip"
}

module "this" {
source = "../../"
owner = "terraform-ci@suse.com"
vpc_name = "terraform-aws-access-${local.identifier}"
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
skip_subnet = true
security_group_name = "terraform-aws-access-${local.identifier}"
security_group_type = "specific"
security_group_ip = "192.168.1.1"
skip_ssh = true
}
15 changes: 15 additions & 0 deletions examples/sgip/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
output "vpc" {
value = module.this.vpc
}

output "subnet" {
value = module.this.subnet
}

output "security_group" {
value = module.this.security_group
}

output "ssh_key" {
value = module.this.ssh_key
}
6 changes: 6 additions & 0 deletions examples/sgip/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
variable "key" {
type = string
}
variable "key_name" {
type = string
}
17 changes: 17 additions & 0 deletions examples/sgip/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
terraform {
required_version = ">= 1.2.0, < 1.6"
required_providers {
local = {
source = "hashicorp/local"
version = ">= 2.4"
}
aws = {
source = "hashicorp/aws"
version = ">= 5.11"
}
http = {
source = "hashicorp/http"
version = ">= 3.4"
}
}
}
16 changes: 16 additions & 0 deletions examples/skipsecuritygroup/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
locals {
identifier = "skipsg"
}
# vpc, subnet, and ssh key
module "this" {
source = "../../"
owner = "terraform-ci@suse.com"
vpc_name = "terraform-aws-access-${local.identifier}"
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_name = "terraform-aws-access-${local.identifier}"
subnet_cidr = "10.0.255.224/28" # gives 14 usable addresses from .225 to .238, but AWS reserves .225 to .227 and .238, leaving .227 to .237
availability_zone = "us-west-1b" # check what availability zones are available in your region before setting this
skip_security_group = true
public_ssh_key = var.key
ssh_key_name = var.key_name
}
15 changes: 15 additions & 0 deletions examples/skipsecuritygroup/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
output "vpc" {
value = module.this.vpc
}

output "subnet" {
value = module.this.subnet
}

output "security_group" {
value = module.this.security_group
}

output "ssh_key" {
value = module.this.ssh_key
}
6 changes: 6 additions & 0 deletions examples/skipsecuritygroup/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
variable "key" {
type = string
}
variable "key_name" {
type = string
}
17 changes: 17 additions & 0 deletions examples/skipsecuritygroup/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
terraform {
required_version = ">= 1.2.0, < 1.6"
required_providers {
local = {
source = "hashicorp/local"
version = ">= 2.4"
}
aws = {
source = "hashicorp/aws"
version = ">= 5.11"
}
http = {
source = "hashicorp/http"
version = ">= 3.4"
}
}
}
16 changes: 16 additions & 0 deletions examples/skipssh/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
locals {
identifier = "skipssh"
}
# generate vpc, subnet, and security group, skip ssh keypair
module "this" {
source = "../../"
owner = "terraform-ci@suse.com"
vpc_name = "terraform-aws-access-${local.identifier}"
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_name = "terraform-aws-access-${local.identifier}"
subnet_cidr = "10.0.255.224/28" # gives 14 usable addresses from .225 to .238, but AWS reserves .225 to .227 and .238, leaving .227 to .237
availability_zone = "us-west-1b" # check what availability zones are available in your region before setting this
security_group_name = "terraform-aws-access-test-${local.identifier}"
security_group_type = "egress"
skip_ssh = true
}
15 changes: 15 additions & 0 deletions examples/skipssh/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
output "vpc" {
value = module.this.vpc
}

output "subnet" {
value = module.this.subnet
}

output "security_group" {
value = module.this.security_group
}

output "ssh_key" {
value = module.this.ssh_key
}
6 changes: 6 additions & 0 deletions examples/skipssh/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
variable "key" {
type = string
}
variable "key_name" {
type = string
}
17 changes: 17 additions & 0 deletions examples/skipssh/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
terraform {
required_version = ">= 1.2.0, < 1.6"
required_providers {
local = {
source = "hashicorp/local"
version = ">= 2.4"
}
aws = {
source = "hashicorp/aws"
version = ">= 5.11"
}
http = {
source = "hashicorp/http"
version = ">= 3.4"
}
}
}
16 changes: 16 additions & 0 deletions examples/skipsubnet/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
locals {
identifier = "skipsubnet"
}
# generate vpc, security group, and ssh key
module "this" {
source = "../../"
owner = "terraform-ci@suse.com"
vpc_name = "terraform-aws-access-${local.identifier}"
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
skip_subnet = true
security_group_name = "terraform-aws-access-${local.identifier}"
security_group_type = "specific"
security_group_ip = "192.168.0.1"
public_ssh_key = var.key
ssh_key_name = var.key_name
}
15 changes: 15 additions & 0 deletions examples/skipsubnet/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
output "vpc" {
value = module.this.vpc
}

output "subnet" {
value = module.this.subnet
}

output "security_group" {
value = module.this.security_group
}

output "ssh_key" {
value = module.this.ssh_key
}
6 changes: 6 additions & 0 deletions examples/skipsubnet/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
variable "key" {
type = string
}
variable "key_name" {
type = string
}
17 changes: 17 additions & 0 deletions examples/skipsubnet/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
terraform {
required_version = ">= 1.2.0, < 1.6"
required_providers {
local = {
source = "hashicorp/local"
version = ">= 2.4"
}
aws = {
source = "hashicorp/aws"
version = ">= 5.11"
}
http = {
source = "hashicorp/http"
version = ">= 3.4"
}
}
}
10 changes: 10 additions & 0 deletions examples/skipvpc/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# generate ssh key only
module "this" {
source = "../../"
owner = "terraform-ci@suse.com"
skip_vpc = true
skip_subnet = true # without a vpc selected or created subnet can't be created
skip_security_group = true # without a vpc selected of created security group can't be created
public_ssh_key = var.key
ssh_key_name = var.key_name
}
15 changes: 15 additions & 0 deletions examples/skipvpc/outputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
output "vpc" {
value = module.this.vpc
}

output "subnet" {
value = module.this.subnet
}

output "security_group" {
value = module.this.security_group
}

output "ssh_key" {
value = module.this.ssh_key
}
6 changes: 6 additions & 0 deletions examples/skipvpc/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
variable "key" {
type = string
}
variable "key_name" {
type = string
}
17 changes: 17 additions & 0 deletions examples/skipvpc/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
terraform {
required_version = ">= 1.2.0, < 1.6"
required_providers {
local = {
source = "hashicorp/local"
version = ">= 2.4"
}
aws = {
source = "hashicorp/aws"
version = ">= 5.11"
}
http = {
source = "hashicorp/http"
version = ">= 3.4"
}
}
}
21 changes: 9 additions & 12 deletions examples/specifyip/main.tf
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
# this is given for reference, in most cases you will want to set the region using environment variables
# provider "aws" {
# region = "us-west-1"
# }
locals {
identifier = "specifyip"
}

# AWS reserves the first four IP addresses and the last IP address in any CIDR block for its own use (cumulatively)
module "TestBasic" {
module "this" {
source = "../../"
owner = "terraform-ci@suse.com"
vpc_name = "terraform-aws-access-test-basic"
vpc_name = "terraform-aws-access-${local.identifier}"
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_name = "terraform-aws-access-test-basic"
subnet_name = "terraform-aws-access-${local.identifier}"
subnet_cidr = "10.0.255.224/28" # gives 14 usable addresses from .225 to .238, but AWS reserves .225 to .227 and .238, leaving .227 to .237
availability_zone = "us-west-1b" # check what availability zones are available in your region before setting this
security_group_name = "terraform-aws-access-test-basic"
security_group_name = "terraform-aws-access-${local.identifier}"
security_group_type = "egress"
security_group_ip = chomp(var.ip)
public_ssh_key = var.key # I don't normally recommend this, but it allows tests to supply their own key
ssh_key_name = var.key_name # A lot of troubleshooting during critical times can be saved by hard coding variables in root modules
# root modules should be secured properly (including the state), and should represent your running infrastructure
public_ssh_key = var.key
ssh_key_name = var.key_name
}
Loading