One of my Pulumi stacks is configured to fetch a h...
# general
One of my Pulumi stacks is configured to fetch a helm chart from a repo. The repo is in an S3 bucket and using the s3 helm plugin. This works great when everything lives in
, the same region as the helm repo. However, when I try to run the stack when AWS_REGION=ap-northeast-1 I get an error while fetching the helm chart:
Copy code
fetch from s3: fetch object from s3: BucketRegionError: incorrect region, the bucket is not in 'ap-northeast-1' region at endpoint ''
On the commandline I can prefix my helm fetch command like this:
Copy code
AWS_REGION=us-west-2 helm fetch...
The pulumi code looks like this:
Copy code
export const splunkForwarder = new k8s.helm.v2.Chart("splunk-forwarder", {
    repo: "my-repo",
    version: "0.2.343",
    chart: "splunk-forwarder",
    namespace: namespaceName,
    values: forwarderValues,
}, { dependsOn: [loggingNamespace, cluster], providers: { kubernetes: cluster.provider } });
How can I tell it to use the
region for the helm fetch and to use the configured
for all other resources?
This may actually not be possible with the current
API. Could you open an issue? Should be possible to add an env arg to Chart. Does the chart have no way to configure the region other than this environment variable (that is kind of unfortunate if so).
I’m still not entirely sure where the region is set. It looks like pulumi is just using the helm repo as it’s configured from the cli before running
Cc @gorgeous-egg-16927 in case he has any more pointers he could suggest.
The pulumi k8s provider isn’t passing that env var through, so it’s likely using whatever the default is for your helm installation. That may be a global config on your system
Pretty sure by default we will inherit parent process env vars. Which also describes the behavior @early-musician-41645 is seeing. I suspect we need an option to pass though env vars explicitly. The thing I don’t understand is what part of Helm reads this and when? Is it actually read during
helm template
I’d expect it’s the
helm fetch
It’s during fetch according to the error. The scenario is that we have a separate region for the helm repo than for the configawsregion that’s in use