square-winter-77440
01/21/2024, 8:41 AMsquare-winter-77440
01/21/2024, 8:44 AMname: project-xxxx-staging
secretsprovider: xxxx
encryptedkey: xxxx
environment:
- staging
config:
gcp:project: xxxx-staging
project-xxxx:API_KEY:
secure: xxxx
I created an environment in our org called staging
and have set the following, note that I've removed the gcp
configuration for readability purposes, but I don't suspect that to be the issue as esc open xxxx/staging
works with no issue.
❯ esc open xxxx/staging -f yaml
config:
API_BASE_URL: xxxx
project-xxxx-staging:API_BASE_URL: xxxx
project-xxxx:API_BASE_URL: xxxx
In our IaC Go code we have the following function (simplified for triaging)...
func (i *Infra) baseEnvVars() pulumi.StringMap { // *Infra is a custom type that has a config field of *config.Config (not exported)
return pulumi.StringMap{
// Backend API
"API_BASE_URL": i.config.RequireSecret("API_BASE_URL"),
}
}
Now when I run
esc run xxxx/staging -- pulumi preview -s staging
I get a panic with the following message...
Diagnostics:
pulumi:pulumi:Stack (project-xxxx-staging):
panic: Missing required configuration variable 'project-xxxx:API_BASE_URL'
please set a value using the command `pulumi config set project-xxxx:API_BASE_URL <value>`
What is unclear to me is how we're supposed to set/reference config values from ESC... the docs don't see to cover this from what I've been able to find.
I've tried the Pulumi AI route, it wasn't very helpful.. Can anyone help point me in the right direction, be it code or docs? I am probably misunderstanding something simple. :)
Thank you!red-match-15116
01/21/2024, 7:49 PMred-match-15116
01/21/2024, 7:53 PMred-match-15116
01/21/2024, 7:54 PMsquare-winter-77440
01/21/2024, 9:47 PMsquare-winter-77440
01/21/2024, 10:01 PMred-match-15116
01/21/2024, 10:20 PM