Skip to content

Commit

Permalink
chore: initial commit of vault agent example
Browse files Browse the repository at this point in the history
Signed-off-by: Bruce Becker <brucellino@protonmail.com>
  • Loading branch information
brucellino committed Oct 31, 2023
1 parent e3406cf commit 9da461b
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ These examples show how to use the module in your project, and are also use for

| Name | Version |
|------|---------|
| <a name="provider_digitalocean"></a> [digitalocean](#provider\_digitalocean) | >=2.21.0 |
| <a name="provider_http"></a> [http](#provider\_http) | >=3.0.1 |
| <a name="provider_random"></a> [random](#provider\_random) | >=3.3.2 |
| <a name="provider_vault"></a> [vault](#provider\_vault) | >=3.8.0 |
| <a name="provider_digitalocean"></a> [digitalocean](#provider\_digitalocean) | 2.26.0 |
| <a name="provider_http"></a> [http](#provider\_http) | 3.2.1 |
| <a name="provider_random"></a> [random](#provider\_random) | 3.4.3 |
| <a name="provider_vault"></a> [vault](#provider\_vault) | 3.13.0 |

## Modules

Expand Down
55 changes: 55 additions & 0 deletions examples/vault-agent/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
terraform {
required_providers {
vault = {
source = "hashicorp/vault"
version = "~> 3"
}
digitalocean = {
source = "digitalocean/digitalocean"
version = "~> 2"
}
}
backend "consul" {
path = "terraform/modules/tfmod-digitalocean-vpc/vault-agent"
}
}

provider "vault" {
# Configuration options
}

data "vault_generic_secret" "do" {
path = "digitalocean/tokens"
}

provider "digitalocean" {
token = data.vault_generic_secret.do.data["terraform"]
}

variable "consul_version" {
type = string
default = "1.16.3"
}

module "vpc" {
source = "brucellino/vpc/digitalocean"
version = "1.0.3"
vpc_name = "consultest-${var.consul_version}"
project = {
description = "Consul v${var.consul_version} Test Project"
environment = "development"
name = "consulTest_v${var.consul_version}"
purpose = "Personal"
}
}

module "consul" {
depends_on = [module.vpc]
source = "../../"
servers = 1
agents = 1
vpc_name = "consultest-${var.consul_version}"
project_name = "consulTest_v${var.consul_version}"
consul_version = var.consul_version
ssh_inbound_source_cidrs = []
}

0 comments on commit 9da461b

Please sign in to comment.