diff --git a/examples/overrides/select_server/README.md b/examples/overrides/select_server/README.md deleted file mode 100644 index 7a770e2..0000000 --- a/examples/overrides/select_server/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Select Only Example - -This is an example of using this module to select an image and server without deploying anything. - -This example has been validated using [Terratest](https://terratest.gruntwork.io/), a Go sdk and test suite for Terraform. -If you would like to test this example go to the ./tests directory and run the test with `go test -v -run TestSelectOnly`. - -WARNING! Server values override image values in outputs. -This means that if you select both an image and a server, and the image is not the one that the server uses, then you will not get the image information you selected. -Accurate server information is the top priority for this module, so it will give you the image information related to the server selected. -That makes this example somewhat useless in practice, but it exercises both paths, so we use it in testing. - -In most use cases you will want to either select only an image and get the image information, or select only a server to get the server information (including the image that the server is using). diff --git a/examples/overrides/select_server/main.tf b/examples/overrides/select_server/main.tf deleted file mode 100644 index a39fe94..0000000 --- a/examples/overrides/select_server/main.tf +++ /dev/null @@ -1,52 +0,0 @@ -locals { - identifier = var.identifier # this is a random unique string that can be used to identify resources in the cloud provider - category = "basic" - example = "basic" - email = "terraform-ci@suse.com" - name = "tf-aws-server-${local.category}-${local.example}-${local.identifier}" - username = "tf-${local.identifier}" - key_name = var.key_name - image = "sles-15" - public_ssh_key = var.key # I don't normally recommend this, but it allows tests to supply their own key - # 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 -} - -# selecting the vpc, subnet, and ssh key pair, generating a security group specific to the runner -module "aws_access" { - source = "rancher/access/aws" - version = "v0.1.1" - owner = local.email - vpc_name = "default" - subnet_name = "default" - security_group_name = local.name - security_group_type = "specific" - ssh_key_name = local.key_name -} - -module "basic" { - depends_on = [ - module.aws_access, - ] - source = "../../../" # change this to "rancher/server/aws" per https://registry.terraform.io/modules/rancher/server/aws/latest - # version = "v0.0.15" # when using this example you will need to set the version - image = local.image - owner = local.email - name = local.name - type = "small" - user = local.username - ssh_key = module.aws_access.ssh_key.public_key - ssh_key_name = local.key_name - subnet_name = "default" - security_group_name = local.name # WARNING: security_group.name isn't the same as security_group->tags->Name -} - -module "TestSelectServer" { - depends_on = [ - module.aws_access, - module.basic, - ] - source = "../../../" - image_id = "ami-09b2a1e33ce552e68" # this must be an image in your region, it should be the image used to create the server_id - id = module.basic.id # this must be an instance in your region -} diff --git a/examples/overrides/select_server/outputs.tf b/examples/overrides/select_server/outputs.tf deleted file mode 100644 index 62c6b01..0000000 --- a/examples/overrides/select_server/outputs.tf +++ /dev/null @@ -1,21 +0,0 @@ -output "private_ip" { - value = module.TestSelectServer.private_ip -} -output "public_ip" { - value = module.TestSelectServer.public_ip -} -output "id" { - value = module.TestSelectServer.id -} -output "ami" { - value = module.TestSelectServer.ami -} -output "ram" { - value = module.TestSelectServer.ram -} -output "cpu" { - value = module.TestSelectServer.cpu -} -output "storage" { - value = module.TestSelectServer.storage -} \ No newline at end of file diff --git a/examples/overrides/select_server/variables.tf b/examples/overrides/select_server/variables.tf deleted file mode 100644 index d125822..0000000 --- a/examples/overrides/select_server/variables.tf +++ /dev/null @@ -1,11 +0,0 @@ -variable "key" { - type = string - -} -variable "key_name" { - type = string - -} -variable "identifier" { - type = string -} diff --git a/examples/overrides/select_server/versions.tf b/examples/overrides/select_server/versions.tf deleted file mode 100644 index 9c6740b..0000000 --- a/examples/overrides/select_server/versions.tf +++ /dev/null @@ -1,19 +0,0 @@ -terraform { - required_version = ">= 1.2.0, < 1.6" - required_providers { - local = { - source = "hashicorp/local" - version = ">= 2.4" - } - aws = { - source = "hashicorp/aws" - version = ">= 5.11" - } - # NOTE: this is only required for the examples - # this is used by the aws_access module - http = { - source = "hashicorp/http" - version = ">= 3.4" - } - } -} \ No newline at end of file