Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2 from hashicorp/update
Browse files Browse the repository at this point in the history
Update Module to official Terraform module spec. Bump Vault and Consul versions.
  • Loading branch information
josh-padnick authored Sep 16, 2017
2 parents 4287a76 + e97f04a commit f3f8321
Show file tree
Hide file tree
Showing 30 changed files with 144 additions and 144 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ We also recommend updating the automated tests *before* updating any code (see [
Development](https://en.wikipedia.org/wiki/Test-driven_development)). That means you add or update a test case,
verify that it's failing with a clear error message, and *then* make the code changes to get that test to pass. This
ensures the tests stay up to date and verify all the functionality in this Blueprint, including whatever new
functionality you're adding in your contribution. Check out the [tests](/tests) folder for instructions on running the
functionality you're adding in your contribution. Check out the [tests](https://github.com/hashicorp/terraform-aws-vault/tree/master/tests) folder for instructions on running the
automated tests.

## Update the code
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
vault-aws-blueprint
terraform-aws-vault
Copyright 2017 Gruntwork, LLC

This product includes software developed at
Expand Down
52 changes: 26 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ secrets. This Blueprint uses [S3](https://aws.amazon.com/s3/) as a [storage
backend](https://www.vaultproject.io/docs/configuration/storage/index.html) and a [Consul](https://www.consul.io)
server cluster as a [high availability backend](https://www.vaultproject.io/docs/concepts/ha.html):

![Vault architecture](/_docs/architecture.png)
![Vault architecture](https://github.com/hashicorp/terraform-aws-vault/blob/master/_docs/architecture.png?raw=true)

This Blueprint includes:

* [install-vault](/modules/install-valut): This module can be used to install Vault. It can be used in a
* [install-vault](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/install-valut): This module can be used to install Vault. It can be used in a
[Packer](https://www.packer.io/) template to create a Vault
[Amazon Machine Image (AMI)](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html).

* [run-vault](/modules/run-vault): This module can be used to configure and run Vault. It can be used in a
* [run-vault](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/run-vault): This module can be used to configure and run Vault. It can be used in a
[User Data](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html#user-data-shell-scripts)
script to fire up Vault while the server is booting.

* [vault-cluster](/modules/vault-cluster): Terraform code to deploy a cluster of Vault servers using an [Auto Scaling
* [vault-cluster](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/vault-cluster): Terraform code to deploy a cluster of Vault servers using an [Auto Scaling
Group](https://aws.amazon.com/autoscaling/).

* [vault-elb](/modules/vault-elb): Configures an [Elastic Load Balancer
* [vault-elb](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/vault-elb): Configures an [Elastic Load Balancer
(ELB)](https://aws.amazon.com/elasticloadbalancing/classicloadbalancer/) in front of Vault if you need to access it
from the public Internet.

* [private-tls-cert](/modules/private-tls-cert): Generate a private TLS certificate for use with a private Vault
* [private-tls-cert](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/private-tls-cert): Generate a private TLS certificate for use with a private Vault
cluster.

* [update-certificate-store](/modules/update-certificate-store): Add a trusted, CA public key to an OS's
* [update-certificate-store](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/update-certificate-store): Add a trusted, CA public key to an OS's
certificate store. This allows you to establish TLS connections to services that use this TLS certs signed by this
CA without getting x509 certificate errors.

Expand Down Expand Up @@ -66,51 +66,51 @@ Gruntwork can help with:

Each Blueprint has the following folder structure:

* [modules](/modules): This folder contains the reusable code for this Blueprint, broken down into one or more modules.
* [examples](/examples): This folder contains examples of how to use the modules.
* [test](/test): Automated tests for the modules and examples.
* [modules](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules): This folder contains the reusable code for this Blueprint, broken down into one or more modules.
* [examples](https://github.com/hashicorp/terraform-aws-vault/tree/master/examples): This folder contains examples of how to use the modules.
* [test](https://github.com/hashicorp/terraform-aws-vault/tree/master/test): Automated tests for the modules and examples.

Click on each of the modules above for more details.

To deploy Vault with this Blueprint, you will need to deploy two separate clusters: one to run
[Consul](https://www.consul.io/) servers (which Vault uses as a [high availability
backend](https://www.vaultproject.io/docs/concepts/ha.html)) and one to run Vault servers.

To deploy the Consul server cluster, use the [Consul AWS Blueprint](https://github.com/gruntwork-io/consul-aws-blueprint).
To deploy the Consul server cluster, use the [Consul AWS Blueprint](https://github.com/hashicorp/terraform-aws-consul).

To deploy the Vault cluster:

1. Create an AMI that has Vault installed (using the [install-vault module](/modules/install-vault)) and the Consul
1. Create an AMI that has Vault installed (using the [install-vault module](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/install-vault)) and the Consul
agent installed (using the [install-consul
module](https://github.com/gruntwork-io/consul-aws-blueprint/tree/master/modules/install-consul)). Here is an
[example Packer template](/examples/vault-consul-ami).
module](https://github.com/hashicorp/terraform-aws-consul/tree/master/modules/install-consul)). Here is an
[example Packer template](https://github.com/hashicorp/terraform-aws-vault/tree/master/examples/vault-consul-ami).

If you are just experimenting with this Blueprint, you may find it more convenient to use one of our official public AMIs:
- [Latest Ubuntu 16 AMIs](/_docs/ubuntu16-ami-list.md).
- [Latest Amazon Linux AMIs](/_docs/amazon-linux-ami-list.md).
- [Latest Ubuntu 16 AMIs](https://github.com/hashicorp/terraform-aws-vault/tree/master/_docs/ubuntu16-ami-list.md).
- [Latest Amazon Linux AMIs](https://github.com/hashicorp/terraform-aws-vault/tree/master/_docs/amazon-linux-ami-list.md).

**WARNING! Do NOT use these AMIs in your production setup. In production, you should build your own AMIs in your
own AWS account.**

1. Deploy that AMI across an Auto Scaling Group in a private subnet using the Terraform [vault-cluster
module](/modules/vault-cluster).
module](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/vault-cluster).

1. Execute the [run-consul script](https://github.com/gruntwork-io/consul-aws-blueprint/tree/master/modules/run-consul)
1. Execute the [run-consul script](https://github.com/hashicorp/terraform-aws-consul/tree/master/modules/run-consul)
with the `--client` flag during boot on each Instance to have the Consul agent connect to the Consul server cluster.

1. Execute the [run-vault](/modules/run-vault) script during boot on each Instance to create the Vault cluster.
1. Execute the [run-vault](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/run-vault) script during boot on each Instance to create the Vault cluster.

1. If you only need to access Vault from inside your AWS account (recommended), run the [install-dnsmasq
module](https://github.com/gruntwork-io/consul-aws-blueprint/tree/master/modules/install-dnsmasq) on each server, and
module](https://github.com/hashicorp/terraform-aws-consul/tree/master/modules/install-dnsmasq) on each server, and
that server will be able to reach Vault using the Consul Server cluster as the DNS resolver (e.g. using an address
like `vault.service.consul`). See the [vault-cluster-private example](/examples/vault-cluster-private) for working
like `vault.service.consul`). See the [vault-cluster-private example](https://github.com/hashicorp/terraform-aws-vault/tree/master/examples/vault-cluster-private) for working
sample code.

1. If you need to access Vault from the public Internet, deploy the [vault-elb module](/modules/vault-elb) in a public
1. If you need to access Vault from the public Internet, deploy the [vault-elb module](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/vault-elb) in a public
subnet and have all requests to Vault go through the ELB. See the [vault-cluster-public
example](/examples/vault-cluster-public) for working sample code.
example](https://github.com/hashicorp/terraform-aws-vault/tree/master/examples/vault-cluster-public) for working sample code.

1. Head over to the [How do you use the Vault cluster?](/modules/vault-cluster#how-do-you-use-the-vault-cluster) guide
1. Head over to the [How do you use the Vault cluster?](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/vault-cluster#how-do-you-use-the-vault-cluster) guide
to learn how to initialize, unseal, and use Vault.


Expand All @@ -120,7 +120,7 @@ To deploy the Vault cluster:

## How do I contribute to this Blueprint?

Contributions are very welcome! Check out the [Contribution Guidelines](/CONTRIBUTING.md) for instructions.
Contributions are very welcome! Check out the [Contribution Guidelines](https://github.com/hashicorp/terraform-aws-vault/tree/master/CONTRIBUTING.md) for instructions.



Expand All @@ -137,6 +137,6 @@ MINOR, and PATCH versions on each release to indicate any incompatibilities.

## License

This code is released under the Apache 2.0 License. Please see [LICENSE](/LICENSE) and [NOTICE](/NOTICE) for more
This code is released under the Apache 2.0 License. Please see [LICENSE](https://github.com/hashicorp/terraform-aws-vault/tree/master/LICENSE) and [NOTICE](https://github.com/hashicorp/terraform-aws-vault/tree/master/NOTICE) for more
details.

4 changes: 2 additions & 2 deletions _ci/publish-amis-in-new-account.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# How to Publish AMIs in a New Account

See the [canonical page](https://github.com/gruntwork-io/consul-aws-blueprint/blob/master/_ci/publish-amis-in-new-account.md)
in the [Consul AWS Blueprint](https://github.com/gruntwork-io/consul-aws-blueprint) repo.
See the [canonical page](https://github.com/hashicorp/terraform-aws-consul/blob/master/_ci/publish-amis-in-new-account.md)
in the [Consul AWS Blueprint](https://github.com/hashicorp/terraform-aws-consul) repo.
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Public Vault Cluster Example

This folder shows an example of Terraform code to deploy a [Vault](https://www.vaultproject.io/) cluster in
[AWS](https://aws.amazon.com/) using the [vault-cluster](/modules/vault-cluster) and [vault-elb](/modules/vault-elb)
[AWS](https://aws.amazon.com/) using the [vault-cluster](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/vault-cluster) and [vault-elb](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/vault-elb)
modules. The Vault cluster uses [Consul](https://www.consul.io/) as a storage backend, so this example also deploys a
separate Consul server cluster using the [consul-cluster
module](https://github.com/gruntwork-io/consul-aws-blueprint/tree/master/modules/consul-cluster) from the Consul AWS
module](https://github.com/hashicorp/terraform-aws-consul/tree/master/modules/consul-cluster) from the Consul AWS
Blueprint.

This example creates a public Vault cluster that is accessible from the public Internet via an [Elastic Load Balancer
(ELB)](https://aws.amazon.com/elasticloadbalancing/classicloadbalancer/). For an example of a private Vault cluster
that is accessible from inside the AWS account, see [vault-cluster-private](/examples/vault-cluster-private).
that is accessible from inside the AWS account, see [vault-cluster-private](https://github.com/hashicorp/terraform-aws-vault/tree/master/examples/vault-cluster-private).

![Vault architecture](/_docs/architecture-elb.png)
![Vault architecture](https://github.com/hashicorp/terraform-aws-vault/blob/master/_docs/architecture-elb.png?raw=true)

You will need to create an [Amazon Machine Image (AMI)](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html)
that has Vault and Consul installed, which you can do using the [vault-consul-ami example](/examples/vault-consul-ami)).
that has Vault and Consul installed, which you can do using the [vault-consul-ami example](https://github.com/hashicorp/terraform-aws-vault/tree/master/examples/vault-consul-ami)).

For more info on how the Vault cluster works, check out the [vault-cluster](/modules/vault-cluster) documentation.
For more info on how the Vault cluster works, check out the [vault-cluster](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/vault-cluster) documentation.

**Note**: To keep this example as simple to deploy and test as possible, it deploys the Vault cluster into your default
VPC and default subnets, all of which are publicly accessible. This is OK for learning and experimenting, but for
Expand All @@ -30,17 +30,17 @@ production usage, we strongly recommend deploying the Vault cluster into the pri
To deploy a Vault Cluster:

1. `git clone` this repo to your computer.
1. Build a Vault and Consul AMI. See the [vault-consul-ami example](/examples/vault-consul-ami) documentation for
1. Build a Vault and Consul AMI. See the [vault-consul-ami example](https://github.com/hashicorp/terraform-aws-vault/tree/master/examples/vault-consul-ami) documentation for
instructions. Make sure to note down the ID of the AMI.
1. Install [Terraform](https://www.terraform.io/).
1. Open `vars.tf`, set the environment variables specified at the top of the file, and fill in any other variables that
don't have a default, including putting your AMI ID into the `ami_id` variable.
1. Run `terraform get`.
1. Run `terraform plan`.
1. If the plan looks good, run `terraform apply`.
1. Run the [vault-examples-helper.sh script](/examples/vault-examples-helper/vault-examples-helper.sh) to
1. Run the [vault-examples-helper.sh script](https://github.com/hashicorp/terraform-aws-vault/tree/master/examples/vault-examples-helper/vault-examples-helper.sh) to
print out the IP addresses of the Vault servers and some example commands you can run to interact with the cluster:
`../vault-examples-helper/vault-examples-helper.sh`.

To see how to connect to the Vault cluster, initialize it, and start reading and writing secrets, head over to the
[How do you use the Vault cluster?](/modules/vault-cluster#how-do-you-use-the-vault-cluster) docs.
[How do you use the Vault cluster?](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/vault-cluster#how-do-you-use-the-vault-cluster) docs.
20 changes: 10 additions & 10 deletions examples/vault-cluster-private/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
# Private Vault Cluster Example

This folder shows an example of Terraform code to deploy a [Vault](https://www.vaultproject.io/) cluster in
[AWS](https://aws.amazon.com/) using the [vault-cluster module](/modules/vault-cluster). The Vault cluster uses
[AWS](https://aws.amazon.com/) using the [vault-cluster module](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/vault-cluster). The Vault cluster uses
[Consul](https://www.consul.io/) as a storage backend, so this example also deploys a separate Consul server cluster
using the [consul-cluster module](https://github.com/gruntwork-io/consul-aws-blueprint/tree/master/modules/consul-cluster)
using the [consul-cluster module](https://github.com/hashicorp/terraform-aws-consul/tree/master/modules/consul-cluster)
from the Consul AWS Blueprint.

This example creates a private Vault cluster that is only accessible from servers within the AWS account. Each of the
servers in this example has [Dnsmasq](http://www.thekelleys.org.uk/dnsmasq/doc.html) installed (via the
[install-dnsmasq module](https://github.com/gruntwork-io/consul-aws-blueprint/tree/master/modules/install-dnsmasq))
[install-dnsmasq module](https://github.com/hashicorp/terraform-aws-consul/tree/master/modules/install-dnsmasq))
which allows it to use the Consul server cluster for service discovery and thereby access Vault via DNS using the
domain name `vault.service.consul`. For an example of a Vault cluster
that is publicly accessible, see [vault-cluster-public](/examples/vault-cluster-public).
that is publicly accessible, see [vault-cluster-public](https://github.com/hashicorp/terraform-aws-vault/tree/master/examples/vault-cluster-public).

![Vault architecture](/_docs/architecture.png)
![Vault architecture](https://github.com/hashicorp/terraform-aws-vault/blob/master/_docs/architecture.png?raw=true)

You will need to create an [Amazon Machine Image (AMI)](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html)
that has Vault and Consul installed, which you can do using the [vault-consul-ami example](/examples/vault-consul-ami)).
that has Vault and Consul installed, which you can do using the [vault-consul-ami example](https://github.com/hashicorp/terraform-aws-vault/tree/master/examples/vault-consul-ami)).

For more info on how the Vault cluster works, check out the [vault-cluster](/modules/vault-cluster) documentation.
For more info on how the Vault cluster works, check out the [vault-cluster](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/vault-cluster) documentation.

**Note**: To keep this example as simple to deploy and test as possible, it deploys the Vault cluster into your default
VPC and default subnets, all of which are publicly accessible. This is OK for learning and experimenting, but for
Expand All @@ -32,17 +32,17 @@ production usage, we strongly recommend deploying the Vault cluster into the pri
To deploy a Vault Cluster:

1. `git clone` this repo to your computer.
1. Build a Vault and Consul AMI. See the [vault-consul-ami example](/examples/vault-consul-ami) documentation for
1. Build a Vault and Consul AMI. See the [vault-consul-ami example](https://github.com/hashicorp/terraform-aws-vault/tree/master/examples/vault-consul-ami) documentation for
instructions. Make sure to note down the ID of the AMI.
1. Install [Terraform](https://www.terraform.io/).
1. Open `vars.tf`, set the environment variables specified at the top of the file, and fill in any other variables that
don't have a default, including putting your AMI ID into the `ami_id` variable.
1. Run `terraform get`.
1. Run `terraform plan`.
1. If the plan looks good, run `terraform apply`.
1. Run the [vault-examples-helper.sh script](/examples/vault-examples-helper/vault-examples-helper.sh) to
1. Run the [vault-examples-helper.sh script](https://github.com/hashicorp/terraform-aws-vault/tree/master/examples/vault-examples-helper/vault-examples-helper.sh) to
print out the IP addresses of the Vault servers and some example commands you can run to interact with the cluster:
`../vault-examples-helper/vault-examples-helper.sh`.

To see how to connect to the Vault cluster, initialize it, and start reading and writing secrets, head over to the
[How do you use the Vault cluster?](/modules/vault-cluster#how-do-you-use-the-vault-cluster) docs.
[How do you use the Vault cluster?](https://github.com/hashicorp/terraform-aws-vault/tree/master/modules/vault-cluster#how-do-you-use-the-vault-cluster) docs.
Loading

0 comments on commit f3f8321

Please sign in to comment.