tall-orange-51528
05/24/2023, 3:21 PMtall-orange-51528
05/24/2023, 3:22 PMmysterious-exabyte-66602
05/25/2023, 2:13 PMpulumi_aws
and also pulumi_awsx
. There pulumi_aws.iam
and also pulumi_aws_iam
. Many other examples. Is there a simple way to think about this -- which libraries should we prefer? Can they all be mixed and matched?big-jordan-24260
05/25/2023, 10:22 PMicy-controller-6092
05/26/2023, 10:14 PMnumerous-solstice-19110
05/29/2023, 4:16 PMpulumi config set azure:clientid <value>
The config looks like this:
config:
azure:clientid: <the value>
then I read the config
var config = new Pulumi.Config();
var clientId = config.Require("azure:clientId");
Run pulumi up
and then it complain that "IaCazureclientId" does not exist.
and if I do like this: (add a config value with up command)
pulumi config set azure:clientid <value>
pulumi up -c SERVICE_ID=22442
it make the file look like:
config:
IaC:SERVICE_ID: 22422
azure:clientid: the value
it adds a prefix to my SERVICE_ID
and if I ask for the SERVICE_ID like this
var clientId = config.Require(SERVICE_ID");
it will find that one, but can't still find:
var clientId = config.Require("azure:clientId");
but if I remove the azure: and just do:
pulumi config set clientid <value>
it gives me:
config:
IaC:clientid: the value
in the file.
and:
var clientId = config.Require("clientId");
works.
Why can't I just use other namespaceing like azure:something and retrieve the data without it say it does not exist and try to look for "IaCazuresomething"
The IaC seams to come from pulumi.yaml name: IaC filed like a prefix.
I expect:
pulumi config set azure:clientid <value>
to give me as it is:
config:
azure:clientid: the value
but not complain about it missing and try to look for IaCazureclientId
what am I doing wrong? so lost, read the documentation and I can't get this... a bug or am I just stupid? :Dbroad-lifeguard-10744
05/30/2023, 3:05 PMsome-airplane-33254
05/31/2023, 9:29 PMpulumi up
I get an error from aws:ec2/getVpc "no matching EC2 VPC found".
Should I expect the template to yield a deployable starting point?dry-kangaroo-89921
06/01/2023, 8:39 AMbig-jordan-24260
06/03/2023, 5:15 PMpulumi config set aws:region us-west-2
.
By the way, already tested all the sets for the config available and ensured that aws cli is operational.
Those anyone else is facing this issue?
pulumi version
v3.69.0. (also happening with v3.68.0)better-dentist-3207
06/03/2023, 9:28 PMbetter-dentist-3207
06/03/2023, 10:12 PMpulumi stack ls
under any projectbig-jordan-24260
06/04/2023, 9:09 PMpulumi config set base-infra:aws:region <value>
error: an unhandled error occurred: program exited with non-zero exit code: 1
Thanks aheadplain-mechanic-14459
06/07/2023, 12:43 PMgitlab_runner_token = gitlab_config.require_secret("token")
contains an Input
.
Eventually, in my code, this input gets implicitly converted to a string:
t = Template(open(f"{getcwd()}/modules/aws_asg/user_data.tpl.sh").read())
templated_user_data = t.substitute({
'gitlab_runner_token' : gitlab_runner_token,
})
I would expect the secret value in the template, but instead it printed this: Calling __str__ on an Output[T] is not supported. To get the value of an Output[T] as an Output[str] consider: 1. o.apply(lambda v: f"prefix{v}suffix") See <https://pulumi.io/help/outputs> for more details.
.
Firstly I don't understand why we're now talking about an Output
instead of an Input
, but that aside.
I've followed the error message and googled this many times and most of the time the solution seems to be to use the .apply()
function as it says. However I haven't found a working solution using the .apply()
function. Mostly it just prints the same error whatever I try. For example, I would expect the following to unwrap the output into a string given the error message but it prints the same error:
t = Template(open(f"{getcwd()}/modules/aws_asg/user_data.tpl.sh").read())
templated_user_data = t.substitute({
'gitlab_runner_token' : gitlab_runner_token.apply(lambda v: f"{v}"),
})
My hunch here is that the apply function which takes an Output
does not return a string, but an Output
. https://www.pulumi.com/docs/reference/pkg/python/pulumi/#pulumi.Output.apply I don't understand why this would ever be useful. 😄
I kind of understand why this is the behavior, it's never converted to a string until somewhere deep in the pulumi code to protect it being a secret, but this makes it totally unusable in many cases where you want the secret before Pulumi starts its templating magic.
So how does the apply function really work? Can Outputs ever be converted to strings to be used in templating scripts? Am I better off not using Pulumi secrets for this use case or is it possible?
Thanks a lot!
Benswift-petabyte-875
06/08/2023, 1:20 AMname: utils-apps
description: Application deployment for utils
runtime: nodejs
config:
github:owner: adriangroch
adrian.default:image.registry: <http://google.com|google.com>
adrian.default:image.tag: latest
and then my Pulumi.dev.yaml:
config:
echo-trigger:image.name: echo-trigger
echo-trigger:image.tag: 1.2.3
And my function:
export function createContainerImageForApplication(appName: string) {
const defaultConfig = new pulumi.Config('adrian.default')
const config = new pulumi.Config(appName)
const registry = config.get('image.registry') ?? defaultConfig.require('image.registry')
const name = config.require('image.name')
const tag = config.get('image.tag') ?? defaultConfig.require('image.tag')
return `${registry}/${name}@${tag}`
}
calling createContainerImageForApplication("echo-trigger")
throws:
error: Missing required configuration variable 'adrian.default:image.registry'
Diagnostics:
pulumi:pulumi:Stack (utils-apps-dev):
error: Missing required configuration variable 'adrian.default:image.registry'
please set a value using the command `pulumi config set adrian.default:image.registry <value>`
Any suggestions?sparse-apartment-74036
06/08/2023, 5:31 AMsparse-teacher-52109
06/08/2023, 9:29 AMboundless-garage-56731
06/08/2023, 3:21 PMbillowy-army-68599
gray-ocean-21618
06/10/2023, 6:34 PMcolossal-kilobyte-61996
06/11/2023, 9:56 PMif/else
the creation of resources based on the current stack, etc, but I wonder if that’s a good pattern to follow? Or it would be much simpler to just have 1 stack and that’s it.
I wonder if we are approaching the problem right, or we should find a better way.
Thanks in advancesalmon-account-74572
06/12/2023, 6:23 PMchilly-morning-11796
06/13/2023, 7:40 AMfresh-scientist-56300
06/13/2023, 6:05 PMhappy-advantage-79856
06/13/2023, 11:36 PMaws.lambda.CallbackFunction
does not seem to work with the s3 bucket for state, I think because it cannot be serialized into json. Is this correct or do I just have it configured wrong?
Changing everything into zip files for the lambda functions is difficult because, the way that the backend deployment code is written it will be very difficult to figure out which dependencies to package for functions. Especially since most lambda functions are created programatically in a big loop with many different objects and functions involved.rough-jordan-15935
06/14/2023, 7:46 AMelegant-gigabyte-8733
06/14/2023, 5:40 PMelegant-gigabyte-8733
06/14/2023, 10:20 PMswift-architect-6677
06/15/2023, 2:56 PMrhythmic-france-96553
06/15/2023, 11:41 PMenable_autopilot=True
throws an error (specifically googleapi: Error 400: Max pods constraint on node pools for Autopilot clusters should be 32.
), but setting the default_max_pods_per_node
to 32 leads to the error Conflicting configuration arguments: "default_max_pods_per_node": conflicts with enable_autopilot. Examine values at 'platform-cluster-silver.defaultMaxPodsPerNode'.
.
My next step was to manually create the cluster and try to import it but I ran into syntax trouble with no obvious docs to help sort it out. The command I landed on that failed was pulumi import gcp:container/cluster:Cluster cluster-name-on-gcp cluster-name-in-pulumi
and that didn’t get me anywhere.
So any pointers either towards successfully creating an autopilot cluster, or importing one? Thanks all!