ashald / terraform-provider-yaml Goto Github PK
View Code? Open in Web Editor NEWTerraform data source that can consume YAML input
License: The Unlicense
Terraform data source that can consume YAML input
License: The Unlicense
The terraform can't install YAML provider after download link was changed (here)
Error: Provider "yaml" not available for installation.
How to reproduce:
main.tf:
terraform {
required_version = "0.11.14"
}
data "yaml_map_of_strings" "rhs_values" {
input = "${file("<path_to_yaml_file")}"
}
bash:
wget "https://github.com/ashald/terraform-provider-yaml/releases/download/v2.1.0/terraform-provider-yaml_v2.1.0_$(uname -s | tr '[:upper:]' '[:lower:]')_amd64"
chmod +x ./terraform-provider-yaml*
terraform init
Hi!
I'm trying to work with a nested structure that looks like this:
---
name: samples
dependencies:
- type: database
name: mongo
version: 3.2
test: true
- type: database
name: mysql
schema: core
test: true
- type: database
name: cassandra
test: true
- type: database
name: zookeeper
version: 3.4
- type: database
name: rabbitmq
- type: database
name: memcached
capabilities:
- api
- worker
- consumer
Here is my terraform plan:
variable "stashusr" {
}
variable "stashpw" {
}
data "http" "service_spec" {
url = "https://${var.stashusr}:${var.stashpw}@example.com/config.yml"
}
data "yaml_map_of_strings" "service_spec" {
input = "${data.http.service_spec.body}"
depends_on = ["data.http.service_spec"]
}
data "yaml_list_of_strings" "service_spec" {
input = "${data.yaml_map_of_strings.service_spec.output["dependencies"]}"
depends_on = ["data.yaml_map_of_strings.service_spec"]
}
output "service_spec" {
value = "${data.yaml_map_of_strings.service_spec.output}"
}
output "capabilities" {
value = "${data.yaml_map_of_strings.service_spec.output["capabilities"]}"
}
output "dependencies" {
value = "${data.yaml_map_of_strings.service_spec.output["dependencies"]}"
}
output "name" {
value = "${data.yaml_map_of_strings.service_spec.output["name"]}"
}
But I'm getting errors:
Error: Error applying plan:
1 error(s) occurred:
* data.yaml_list_of_strings.service_spec: data.yaml_list_of_strings.service_spec: yaml: unmarshal errors:
line 1: cannot unmarshal !!map into string
line 1: cannot unmarshal !!map into string
line 1: cannot unmarshal !!map into string
line 1: cannot unmarshal !!map into string
line 1: cannot unmarshal !!map into string
line 1: cannot unmarshal !!map into string
Am I doing something wrong or is the provider not able to handle this?
a windows build would be really nice.
$ terraform plan
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
data.yaml_map_of_strings.normal: Refreshing state...
Error: Error refreshing state: 1 error(s) occurred:
* data.yaml_map_of_strings.normal: 1 error(s) occurred:
* data.yaml_map_of_strings.normal: data.yaml_map_of_strings.normal: unexpected EOF
panic: reflect: call of reflect.Value.Interface on zero Value
2019-04-23T09:02:46.531-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64:
2019-04-23T09:02:46.531-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: goroutine 82 [running]:
2019-04-23T09:02:46.531-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: reflect.valueInterface(0x0, 0x0, 0x0, 0xc42035e501, 0xc42044b600, 0xc42044b600)
2019-04-23T09:02:46.531-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: /Users/ashald/.goenv/versions/1.10.3/src/reflect/value.go:953 +0x1a3
2019-04-23T09:02:46.531-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: reflect.Value.Interface(0x0, 0x0, 0x0, 0x0, 0x0)
2019-04-23T09:02:46.531-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: /Users/ashald/.goenv/versions/1.10.3/src/reflect/value.go:948 +0x44
2019-04-23T09:02:46.531-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: github.com/ashald/terraform-provider-yaml/yaml.serializeToFlowStyleYaml(0x0, 0x0, 0xc420362af0, 0xf, 0xc4203fb608, 0x0)
2019-04-23T09:02:46.531-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: /Users/ashald/workspace/go/src/github.com/ashald/terraform-provider-yaml/yaml/common.go:32 +0x126
2019-04-23T09:02:46.531-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: github.com/ashald/terraform-provider-yaml/yaml.readYamlMap(0xc4200ea230, 0x0, 0x0, 0xc4200ea230, 0x0)
2019-04-23T09:02:46.531-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: /Users/ashald/workspace/go/src/github.com/ashald/terraform-provider-yaml/yaml/data_source_yaml_map_of_strings.go:56 +0x424
2019-04-23T09:02:46.532-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: github.com/ashald/terraform-provider-yaml/vendor/github.com/hashicorp/terraform/helper/schema.(*Resource).ReadDataApply(0xc420430310, 0xc42015cca0, 0x0, 0x0, 0xc420452b18, 0x10bce01, 0x1883060)
2019-04-23T09:02:46.532-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: /Users/ashald/workspace/go/src/github.com/ashald/terraform-provider-yaml/vendor/github.com/hashicorp/terraform/helper/schema/resource.go:290 +0x88
2019-04-23T09:02:46.532-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: github.com/ashald/terraform-provider-yaml/vendor/github.com/hashicorp/terraform/helper/schema.(*Provider).ReadDataApply(0xc4204303f0, 0xc42035c140, 0xc42015cca0, 0x18, 0x18, 0xc42015cce0)
2019-04-23T09:02:46.532-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: /Users/ashald/workspace/go/src/github.com/ashald/terraform-provider-yaml/vendor/github.com/hashicorp/terraform/helper/schema/provider.go:426 +0x9a
2019-04-23T09:02:46.532-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: github.com/ashald/terraform-provider-yaml/vendor/github.com/hashicorp/terraform/plugin.(*ResourceProviderServer).ReadDataApply(0xc42042c4e0, 0xc4200c62d0, 0xc4200c71b0, 0x0, 0x0)
2019-04-23T09:02:46.532-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: /Users/ashald/workspace/go/src/github.com/ashald/terraform-provider-yaml/vendor/github.com/hashicorp/terraform/plugin/resource_provider.go:604 +0x4e
2019-04-23T09:02:46.532-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: reflect.Value.call(0xc420350b40, 0xc42035e398, 0x13, 0x1a2627a, 0x4, 0xc4203a6f18, 0x3, 0x3, 0xc4200d2080, 0x0, ...)
2019-04-23T09:02:46.532-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: /Users/ashald/.goenv/versions/1.10.3/src/reflect/value.go:447 +0x969
2019-04-23T09:02:46.532-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: reflect.Value.Call(0xc420350b40, 0xc42035e398, 0x13, 0xc4204de718, 0x3, 0x3, 0x0, 0x0, 0x0)
2019-04-23T09:02:46.532-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: /Users/ashald/.goenv/versions/1.10.3/src/reflect/value.go:308 +0xa4
2019-04-23T09:02:46.532-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: net/rpc.(*service).call(0xc420368700, 0xc42035c2d0, 0xc420362368, 0xc420362380, 0xc420364e00, 0xc420360ba0, 0x1883020, 0xc4200c62d0, 0x16, 0x1883060, ...)
2019-04-23T09:02:46.532-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: /Users/ashald/.goenv/versions/1.10.3/src/net/rpc/server.go:384 +0x14e
2019-04-23T09:02:46.532-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: created by net/rpc.(*Server).ServeCodec
2019-04-23T09:02:46.532-0600 [DEBUG] plugin.terraform-provider-yaml_v2.0.0-darwin-amd64: /Users/ashald/.goenv/versions/1.10.3/src/net/rpc/server.go:480 +0x43a
2019/04/23 09:02:46 [ERROR] root: eval: *terraform.EvalReadDataApply, err: data.yaml_map_of_strings.normal: unexpected EOF
2019/04/23 09:02:46 [ERROR] root: eval: *terraform.EvalSequence, err: data.yaml_map_of_strings.normal: unexpected EOF
2019/04/23 09:02:46 [TRACE] [walkRefresh] Exiting eval tree: data.yaml_map_of_strings.normal
2019/04/23 09:02:46 [TRACE] dag/walk: upstream errored, not walking "output.normal"
2019/04/23 09:02:46 [TRACE] dag/walk: upstream errored, not walking "provider.yaml (close)"
2019/04/23 09:02:46 [TRACE] dag/walk: upstream errored, not walking "root"
2019-04-23T09:02:46.535-0600 [DEBUG] plugin: plugin process exited: path=/Users/markbordas/.terraform.d/plugins/terraform-provider-yaml_v2.0.0-darwin-amd64
2019/04/23 09:02:46 [DEBUG] plugin: waiting for all plugin processes to complete...
2019-04-23T09:02:46.535-0600 [WARN ] plugin: error closing client during Kill: err="connection is shut down"
!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
Terraform crashed! This is always indicative of a bug within Terraform.
A crash log has been placed at "crash.log" relative to your current
working directory. It would be immensely helpful if you could please
report the crash with Terraform[1] so that we can fix this.
When reporting bugs, please include your terraform version. That
information is available on the first line of crash.log. You can also
get it by running 'terraform --version' on the command line.
[1]: https://github.com/hashicorp/terraform/issues
!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.