admin管理员组文章数量:1315812
I'm trying to use the Pact Terraform Provider with Pulumi using the Terraform Provider for Pulumi. Setup worked fine, but as soon as I'm configuring anything else than the Provider, I'm getting an error that the 'host' field is missing:
Previewing update (broker):
@ previewing update.......
pulumi:providers:pact default_0_10_0 error: rpc error: code = Unknown desc = "host": required field is not set:
pulumi:pulumi:Stack pact-broker-broker
pulumi:providers:pact default_0_10_0 1 error
Diagnostics:
pulumi:providers:pact (default_0_10_0):
error: rpc error: code = Unknown desc = "host": required field is not set:
I've enabled maximum verbosity in logging, but the closest I get to what is actually passed to the provider is
eventsink.go:59] RegisterResource RPC finished: resource:Pact Broker[pulumi:providers:pact]; err: null, resp: urn:pulumi:broker::pact-broker::pulumi:providers:pact::Pact Broker,04da6b54-80e4-46f7-96ec-b56ff0331ba9,host,,,,version,,,0.10.0,,
which looks fine to me.
Somewhere else in the logs I've found that rpc logging is hidden by default and haven't found any way to enable that. TF_LOG=DEBUG hasn't helped anything either.
My Pulumi Script looks like this.
import * as pact from "@pulumi/pact";
const host = process.env["PACT_BROKER_BASE_URL"]!!
if (!host) {
throw new Error("Host needs to be set")
}
new pact.Provider("Pact Broker", {
host: host,
basicAuthUsername: process.env["PACT_BROKER_USERNAME"],
basicAuthPassword: process.env["PACT_BROKER_PASSWORD"]
})
new pact.Environment("Test Environment", {
displayName: "Test Environment"
})
I'm trying to use the Pact Terraform Provider with Pulumi using the Terraform Provider for Pulumi. Setup worked fine, but as soon as I'm configuring anything else than the Provider, I'm getting an error that the 'host' field is missing:
Previewing update (broker):
@ previewing update.......
pulumi:providers:pact default_0_10_0 error: rpc error: code = Unknown desc = "host": required field is not set:
pulumi:pulumi:Stack pact-broker-broker
pulumi:providers:pact default_0_10_0 1 error
Diagnostics:
pulumi:providers:pact (default_0_10_0):
error: rpc error: code = Unknown desc = "host": required field is not set:
I've enabled maximum verbosity in logging, but the closest I get to what is actually passed to the provider is
eventsink.go:59] RegisterResource RPC finished: resource:Pact Broker[pulumi:providers:pact]; err: null, resp: urn:pulumi:broker::pact-broker::pulumi:providers:pact::Pact Broker,04da6b54-80e4-46f7-96ec-b56ff0331ba9,host,,,https://the-broker-url,version,,,0.10.0,,
which looks fine to me.
Somewhere else in the logs I've found that rpc logging is hidden by default and haven't found any way to enable that. TF_LOG=DEBUG hasn't helped anything either.
My Pulumi Script looks like this.
import * as pact from "@pulumi/pact";
const host = process.env["PACT_BROKER_BASE_URL"]!!
if (!host) {
throw new Error("Host needs to be set")
}
new pact.Provider("Pact Broker", {
host: host,
basicAuthUsername: process.env["PACT_BROKER_USERNAME"],
basicAuthPassword: process.env["PACT_BROKER_PASSWORD"]
})
new pact.Environment("Test Environment", {
displayName: "Test Environment"
})
Share
Improve this question
asked Jan 30 at 13:33
Tim VahlbrockTim Vahlbrock
11310 bronze badges
1 Answer
Reset to default 0Duh. Looked to close at the terraform example that was provided. Pulumi creates a default provider automatically, which I can configure using the command line, like pulumi config set pact:host "http://the-broker.url"
. However there doesn't seem to be a good way of reading configuration values from environment variables. Alternatively the programmatically created provider can be passed to the ressource, if the default provider shouldn't be used.
const provider = new pact.Provider("Pact Broker", { // <-- store the provider in a constant
host: host,
basicAuthUsername: process.env["PACT_BROKER_USERNAME"],
basicAuthPassword: process.env["PACT_BROKER_PASSWORD"]
})
new pact.Environment("Test Environment", {
displayName: "Test Environment"
}, { provider }) // <-- added the provider as a pulumi argument here
To enforce that this provider is used, the default provider can be disabled by adding the provider id to the pulumi:disable-default-providers
to the config
section in the stacks configuration file.
版权声明:本文标题:pact - Pulumi Terraform Provider reports required field missing that is definetely passed on - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741962327a2407351.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论