This repository has been archived by the owner on Aug 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial support for custom Terraform plugins
- Loading branch information
Lucy Davinhart
committed
Nov 3, 2018
1 parent
c05a497
commit 2efa0f5
Showing
8 changed files
with
227 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 0.14.0 | ||
|
||
* Initial support for custom Terraform plugins | ||
|
||
## 0.13.1 | ||
|
||
* Use mapcrafter/mapcrafter:113 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.13.1 | ||
0.14.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
terraform.d | ||
.terraform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
terraform: | ||
plugins: | ||
urls: | ||
- https://github.com/Mastercard/terraform-provider-restapi/releases/download/v1.5.1/terraform-provider-restapi_v1.5.1-linux-amd64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Custom Terraform Plugins | ||
|
||
Here's an example of using a custom Terraform plugin | ||
|
||
Plugin URLs are specified as an array in your local lucli config file, i.e. | ||
|
||
``` | ||
terraform: | ||
plugins: | ||
urls: | ||
- https://example.com/foo/bar | ||
``` | ||
|
||
Plugins are downloaded to the `terraform.d/plugins/linux_amd64` directory as | ||
part of the init function, when running `lucli terraform init`, prior to | ||
starting the Docker container. | ||
|
||
As it happens, the Terraform code in this example directory doesn't work. | ||
|
||
It uses the https://github.com/Mastercard/terraform-provider-restapi, which | ||
makes assumptions about the format of the API you're calling, that do not hold | ||
true for https://whoami.lmhd.me/name | ||
|
||
But you can at least see that the custom plugin works fine. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
provider "restapi" { | ||
uri = "https://whoami.lmhd.me" | ||
debug = true | ||
write_returns_object = true | ||
} | ||
|
||
# This will make information about the user named "John Doe" available by finding him by first name | ||
data "restapi_object" "name" { | ||
path = "/name" | ||
search_key = "" | ||
search_value = "" | ||
results_key = "full_name" | ||
id_attribute = "preferred" | ||
} | ||
|
||
output "name" { | ||
value = "${data.restapi_object.name.api_data.preferred}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters