website: Using demo.consul.io requires scheme = "https"
Following the examples as they were previously would cause errors accessing demo.consul.io. Now we consistently set the scheme to https for all examples that use demo.consul.io. This also includes some other updates to the URLs, since the Consul demo has been rebuilt with a different based configuration, and some general formatting and copyediting changes in the Consul example.
This commit is contained in:
parent
fa5d9cc2ca
commit
e2373c8073
|
@ -18,6 +18,7 @@ Below, we show a complete example configuring the "consul" backend:
|
||||||
terraform {
|
terraform {
|
||||||
backend "consul" {
|
backend "consul" {
|
||||||
address = "demo.consul.io"
|
address = "demo.consul.io"
|
||||||
|
scheme = "https"
|
||||||
path = "example_app/terraform_state"
|
path = "example_app/terraform_state"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,6 +103,7 @@ or `backend` block:
|
||||||
```hcl
|
```hcl
|
||||||
address = "demo.consul.io"
|
address = "demo.consul.io"
|
||||||
path = "example_app/terraform_state"
|
path = "example_app/terraform_state"
|
||||||
|
scheme = "https"
|
||||||
```
|
```
|
||||||
|
|
||||||
The same settings can alternatively be specified on the command line as
|
The same settings can alternatively be specified on the command line as
|
||||||
|
@ -110,7 +112,8 @@ follows:
|
||||||
```
|
```
|
||||||
$ terraform init \
|
$ terraform init \
|
||||||
-backend-config="address=demo.consul.io" \
|
-backend-config="address=demo.consul.io" \
|
||||||
-backend-config="path=example_app/terraform_state"
|
-backend-config="path=example_app/terraform_state" \
|
||||||
|
-backend-config="scheme=https"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Changing Configuration
|
## Changing Configuration
|
||||||
|
|
|
@ -20,6 +20,7 @@ This backend supports [state locking](/docs/state/locking.html).
|
||||||
terraform {
|
terraform {
|
||||||
backend "consul" {
|
backend "consul" {
|
||||||
address = "demo.consul.io"
|
address = "demo.consul.io"
|
||||||
|
scheme = "https"
|
||||||
path = "full/path"
|
path = "full/path"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,32 +18,31 @@ to process requests.
|
||||||
Terraform provides a [Consul provider](/docs/providers/consul/index.html) which
|
Terraform provides a [Consul provider](/docs/providers/consul/index.html) which
|
||||||
can be used to interface with Consul from inside a Terraform configuration.
|
can be used to interface with Consul from inside a Terraform configuration.
|
||||||
|
|
||||||
For our example, we use the [Consul demo cluster](http://demo.consul.io)
|
For our example, we use the [Consul demo cluster](https://demo.consul.io/)
|
||||||
to both read configuration and store information about a newly created EC2 instance.
|
to both read configuration and store information about a newly created EC2 instance.
|
||||||
The size of the EC2 instance will be determined by the `tf\_test/size` key in Consul,
|
The size of the EC2 instance will be determined by the `tf_test/size` key in Consul,
|
||||||
and will default to `m1.small` if that key does not exist. Once the instance is created
|
and will default to `m1.small` if that key does not exist. Once the instance is created
|
||||||
the `tf\_test/id` and `tf\_test/public\_dns` keys will be set with the computed
|
the `tf_test/id` and `tf_test/public_dns` keys will be set with the computed
|
||||||
values for the instance.
|
values for the instance.
|
||||||
|
|
||||||
Before we run the example, use the [Web UI](http://demo.consul.io/ui/#/nyc3/kv/)
|
Before we run the example, use the [Web UI](https://demo.consul.io/ui/dc1/kv/)
|
||||||
to set the `tf\_test/size` key to `t1.micro`. Once that is done,
|
to set the `tf_test/size` key to `t1.micro`. Once that is done,
|
||||||
copy the configuration into a configuration file (`consul.tf` works fine).
|
copy the configuration into a configuration file (`consul.tf` works fine).
|
||||||
Either provide the AWS credentials as a default value in the configuration
|
Either provide the AWS credentials as a default value in the configuration
|
||||||
or invoke `apply` with the appropriate variables set.
|
or invoke `apply` with the appropriate variables set.
|
||||||
|
|
||||||
Once the `apply` has completed, we can see the keys in Consul by
|
Once the `apply` has completed, we can see the keys in Consul by
|
||||||
visiting the [Web UI](http://demo.consul.io/ui/#/nyc3/kv/). We can see
|
visiting the [Web UI](https://demo.consul.io/ui/dc1/kv/). We can see
|
||||||
that the "tf\_test/id" and "tf\_test/public\_dns" values have been
|
that the `tf_test/id` and `tf_test/public_dns` values have been
|
||||||
set.
|
set.
|
||||||
|
|
||||||
We can now teardown the infrastructure following the
|
You can now [tear down the infrastructure](/intro/getting-started/destroy.html)
|
||||||
[instructions here](/intro/getting-started/destroy.html). Because
|
Because we set the `delete` property of two of the Consul keys, Terraform
|
||||||
we set the `delete` property of two of the Consul keys, Terraform
|
will clean up those keys on destroy. We can verify this by using
|
||||||
will cleanup those keys on destroy. We can verify this by using
|
|
||||||
the Web UI.
|
the Web UI.
|
||||||
|
|
||||||
The point of this example is to show that Consul can be used with
|
This example has shown that Consul can be used with Terraform both to read
|
||||||
Terraform both to enable dynamic inputs, but to also store outputs.
|
existing values and to store generated results.
|
||||||
|
|
||||||
Inputs like AMI name, security groups, Puppet roles, bootstrap scripts,
|
Inputs like AMI name, security groups, Puppet roles, bootstrap scripts,
|
||||||
etc can all be loaded from Consul. This allows the specifics of an
|
etc can all be loaded from Consul. This allows the specifics of an
|
||||||
|
|
|
@ -55,6 +55,7 @@ terraform {
|
||||||
address = "demo.consul.io"
|
address = "demo.consul.io"
|
||||||
path = "getting-started-RANDOMSTRING"
|
path = "getting-started-RANDOMSTRING"
|
||||||
lock = false
|
lock = false
|
||||||
|
scheme = "https"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -41,6 +41,7 @@ terraform {
|
||||||
address = "demo.consul.io"
|
address = "demo.consul.io"
|
||||||
datacenter = "nyc3"
|
datacenter = "nyc3"
|
||||||
path = "tfdemo"
|
path = "tfdemo"
|
||||||
|
scheme = "https"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue