broad-translator-40115
06/09/2022, 6:37 AMlet cachedValue = '';
exports.handler = async () => {
if (cachedValue) {
return cachedValue;
}
const newValue = await getSomeNewValue();
cachedValue = newValue;
return newValue;
}
But this doesn't seem to work with Pulumi 😬
We have a callback defined like:
let cachedValue = '';
export const handler: aws.lambda.Callback<Event, unknown> = async (event, context, callback) => {
// ...
}
And we're using it as an AppSync resolver:
const cbFunction = new aws.lambda.CallbackFunction('cb', {
runtime: 'nodejs14.x',
callback: handler,
}
const dataSource = new aws.appsync.DataSource('some-data-source', {
...
lambdaConfig: {
functionArn: cbFunction.arn,
},
});
But we cannot make this mechanism work.
The cachedValue
is refreshed on each invocation.
I know Pulumi does function serialization, which is a concept I'm still trying to wrap my head around.
Any quick tips on how to access the execution environment in a lambda like this?
(Also, yes, I'm aware it's not a reliable way to do caching, lambdas are supposed to be stateless, data is not safe, etc etc). We do have a use case for this, though. Any help would be appreciated 😁crooked-cat-6983
06/09/2022, 12:29 PMaws:iam:Policy (cloud-discovery):
error: unable to validate AWS AccessKeyID and/or SecretAccessKey - see <https://pulumi.io/install/aws.html> for details on configuration
Exited with code exit status 255
I am able to use these credentials to create resources manually so I don't really understand what's the issue with creating them with pulumi.
I'm also not able to find any info on this error online.
my code:
const podRolePolicy = new aws.iam.Policy(appName, {
name: appName,
policy: {
Version: '2012-10-17',
Statement: [
{
Effect: 'Allow',
Action: 'sts:AssumeRole',
Resource: '*',
},
{
Effect: 'Allow',
Resource: '*',
Action: 'secretsmanager:GetSecretValue',
Condition: {
StringEquals: {
'aws:ResourceTag/APPLICATION': 'APP',
},
},
},
],
},
})
If some can supply some info on this error it would be very much appriciated.quick-wolf-8403
06/09/2022, 12:47 PMjolly-church-88521
06/09/2022, 2:25 PMnarrow-translator-93508
06/09/2022, 4:40 PMPulumi K8S operator
, especially this error message No permalink found
, I'm using a GCS backend FYInarrow-translator-93508
06/09/2022, 4:40 PM{
"level": "error",
"ts": "2022-06-09T16:33:51.377Z",
"logger": "controller_stack",
"msg": "No permalink found.",
"Request.Namespace": "default",
"Request.Name": "hello-stack-6c5ede73",
"Namespace": "default",
"error": "failed to get permalink",
"errorVerbose": "failed to get permalink\<http://ngithub.com/pulumi/pulumi/sdk/v3/go/auto.init\n\t/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.30.0/go/auto/stack.go:694\nruntime.doInit\n\t/opt/hostedtoolcache/go/1.17.8/x64/src/runtime/proc.go:6498\nruntime.doInit\n\t/opt/hostedtoolcache/go/1.17.8/x64/src/runtime/proc.go:6475\nruntime.doInit\n\t/opt/hostedtoolcache/go/1.17.8/x64/src/runtime/proc.go:6475\nruntime.doInit\n\t/opt/hostedtoolcache/go/1.17.8/x64/src/runtime/proc.go:6475\nruntime.doInit\n\t/opt/hostedtoolcache/go/1.17.8/x64/src/runtime/proc.go:6475\nruntime.main\n\t/opt/hostedtoolcache/go/1.17.8/x64/src/runtime/proc.go:238\nruntime.goexit\n\t/opt/hostedtoolcache/go/1.17.8/x64/src/runtime/asm_amd64.s:1581|ngithub.com/pulumi/pulumi/sdk/v3/go/auto.init\n\t/home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.30.0/go/auto/stack.go:694\nruntime.doInit\n\t/opt/hostedtoolcache/go/1.17.8/x64/src/runtime/proc.go:6498\nruntime.doInit\n\t/opt/hostedtoolcache/go/1.17.8/x64/src/runtime/proc.go:6475\nruntime.doInit\n\t/opt/hostedtoolcache/go/1.17.8/x64/src/runtime/proc.go:6475\nruntime.doInit\n\t/opt/hostedtoolcache/go/1.17.8/x64/src/runtime/proc.go:6475\nruntime.doInit\n\t/opt/hostedtoolcache/go/1.17.8/x64/src/runtime/proc.go:6475\nruntime.main\n\t/opt/hostedtoolcache/go/1.17.8/x64/src/runtime/proc.go:238\nruntime.goexit\n\t/opt/hostedtoolcache/go/1.17.8/x64/src/runtime/asm_amd64.s:1581>",
"stacktrace": "<http://github.com/pulumi/pulumi-kubernetes-operator/pkg/controller/stack.(*ReconcileStack).Reconcile\n\t/home/runner/work/pulumi-kubernetes-operator/pulumi-kubernetes-operator/pkg/controller/stack/stack_controller.go:319\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.0/pkg/internal/controller/controller.go:298\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.0/pkg/internal/controller/controller.go:253\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.0/pkg/internal/controller/controller.go:214|github.com/pulumi/pulumi-kubernetes-operator/pkg/controller/stack.(*ReconcileStack).Reconcile\n\t/home/runner/work/pulumi-kubernetes-operator/pulumi-kubernetes-operator/pkg/controller/stack/stack_controller.go:319\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.0/pkg/internal/controller/controller.go:298\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.0/pkg/internal/controller/controller.go:253\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/home/runner/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.9.0/pkg/internal/controller/controller.go:214>"
}
flaky-area-92692
06/09/2022, 5:49 PMswift-battery-95026
06/09/2022, 6:12 PMCannot find module '.pnpm/...'
errors. Seems like this isn't documented but is a known issue (found here in Pulumi Slack and here in PNPM Discord). Anyone have any experience here / workarounds? Or can I just not use anything involving function serialization in my monorepo?billowy-oxygen-65892
06/09/2022, 10:28 PMbillowy-oxygen-65892
06/09/2022, 10:28 PMerror: unable to validate AWS AccessKeyID and/or SecretAccessKey
blue-tailor-71836
06/10/2022, 3:50 AM// create provider
const gkeStack = new pulumi.StackReference(`{stack-name}/${pulumi.getStack()}`);
const provider = new k8s.Provider("k8s", { kubeconfig: gkeStack.getOutput("kubeconfig"), namespace: "{namespace}" });
Default provider for 'pulumi:pulumi:StackReference' disabled. 'pulumi:pulumi:StackReference' must use an explicit provider
brief-carpenter-29515
06/10/2022, 7:23 AMerror: post-step event returned an error: failed to save snapshot: renewing lease: [403] The provided update token has expired.
all the troubleshooting tells me to do is delete the resource and presumably try again.... But the database call takes too long and the token expires?bulky-agent-73210
06/10/2022, 7:27 AMdry-salesmen-32588
06/10/2022, 10:54 AMlittle-apartment-30401
06/10/2022, 11:01 AMnarrow-translator-93508
06/10/2022, 5:33 PMGithub Actions
[CI] + Pulumi Operator
[CD]?
How do I tell the pulumi k8s operator
which revision to pull from docker registry
?billions-hospital-77217
06/10/2022, 7:15 PMusing Pulumi;
using Pulumi.Aws.S3;
using System.Collections.Generic;
await Deployment.RunAsync(() =>
{
// Create an AWS resource (S3 Bucket)
var bucket = new Bucket("my-bucket");
// Export the name of the bucket
return new Dictionary<string, object?>
{
["bucketName"] = bucket.Id
};
});
Where before it was:
using System.Threading.Tasks;
using Pulumi;
class Program
{
static Task<int> Main() => Deployment.RunAsync<MyStack>();
}
proud-cricket-86351
06/10/2022, 7:25 PMblue-leather-96987
06/10/2022, 8:27 PMbreezy-laptop-42679
06/11/2022, 2:40 PMagreeable-notebook-99278
06/12/2022, 1:00 AMstaticSite
to get to them? I.e. first I tried .all([staticSite]).apply([{id, name, defaultHostname}])
-> errorable-dentist-35553
06/13/2022, 4:04 AMfamous-leather-72830
06/13/2022, 10:01 AMStackReference
? I am following the micro-service methodology, and keeping my eks cluster (created with @pulumi/eks
in a separate project from the apps that will run on it. My goal is to make each project create their own AWS Managed Node Group, however it requires to provide a direct eks.Cluster
object, and upon viewing the logic of creation, aws.eks.Cluster.get
doesn't provide sufficient properties. Any help would be appreciated, as it's a massive blocker for me.gentle-camera-53119
06/13/2022, 1:43 PMerror CS0234: The type or namespace name 'AzureAD' does not exist in the namespace 'Pulumi' (are you missing an assembly reference?) [/Users/XXXXX/XXX/pulumi/cazure/cazure.csproj
millions-account-72180
06/13/2022, 1:54 PMwonderful-painting-69130
06/13/2022, 2:51 PMable-train-72108
06/13/2022, 3:27 PMquiet-wolf-18467
06/13/2022, 3:28 PMhigh-kilobyte-58002
06/13/2022, 4:10 PMeager-lawyer-9843
06/13/2022, 4:43 PMpulumi up
not being able to find the AWS credentials
Error: invocation of aws:ec2/getVpc:getVpc returned an error: unable to validate AWS AccessKeyID and/or SecretAccessKey - see https://pulumi.io/install/aws.html for details on configurationI have a profile setup in my aws credentials file and I can view the config when using the CLI but cannot get it to work with the pulumi. I had it working before but for some reason it has stopped working and I cannot find any changes that would have caused it, at least through git. FYI, I am using a monorepo for all my services and using symlinks to pull in the
package.json
and node_modules
(though even removing that has not helped). My Pulumi.stack.yaml
in each service directory has the aws:profile
and aws:region
seteager-lawyer-9843
06/13/2022, 4:43 PMpulumi up
not being able to find the AWS credentials
Error: invocation of aws:ec2/getVpc:getVpc returned an error: unable to validate AWS AccessKeyID and/or SecretAccessKey - see https://pulumi.io/install/aws.html for details on configurationI have a profile setup in my aws credentials file and I can view the config when using the CLI but cannot get it to work with the pulumi. I had it working before but for some reason it has stopped working and I cannot find any changes that would have caused it, at least through git. FYI, I am using a monorepo for all my services and using symlinks to pull in the
package.json
and node_modules
(though even removing that has not helped). My Pulumi.stack.yaml
in each service directory has the aws:profile
and aws:region
setbillowy-army-68599
06/13/2022, 4:45 PMpulumi about
?eager-lawyer-9843
06/13/2022, 4:45 PMCLI
Version 3.34.1
Go Version go1.18.3
Go Compiler gc
Plugins
NAME VERSION
nodejs unknown
Host
OS darwin
Version 12.4
Arch x86_64
This project is written in nodejs: executable='/usr/local/bin/node' version='v16.14.0'
Backend
Name <http://pulumi.com|pulumi.com>
URL <https://app.pulumi.com/rfab>
User rfab
Organizations rfab, rivet
Pulumi locates its logs in /var/folders/gt/8l3t_j7n1bg4wx8d_rfyg6v00000gn/T/ by default
warning: Failed to get information about the Pulumi program's plugins: Could not find either /Users/ryanfabela/development/work/dpb/main/infrastructure/yarn.lock or /Users/ryanfabela/development/work/dpb/main/infrastructure/package-lock.json
warning: Failed to get information about the current stack: No current stack
CLI
Version 3.34.1
Go Version go1.18.3
Go Compiler gc
Plugins
NAME VERSION
aws 5.7.2
docker 3.2.0
nodejs unknown
Host
OS darwin
Version 12.4
Arch x86_64
This project is written in nodejs: executable='/usr/local/bin/node' version='v16.14.0'
Backend
Name <http://pulumi.com|pulumi.com>
URL <https://app.pulumi.com/rfab>
User rfab
Organizations rfab, rivet
Dependencies:
NAME VERSION
@pulumi/pulumi 3.34.0
@pulumi/aws 5.7.2
@pulumi/awsx 0.40.0
@types/node 14.18.21
Pulumi locates its logs in /var/folders/gt/8l3t_j7n1bg4wx8d_rfyg6v00000gn/T/ by default
warning: Failed to get information about the current stack: No current stack
billowy-army-68599
06/13/2022, 5:19 PM5.8.0
broad-dog-22463
06/13/2022, 5:19 PMaws:skipCredentialsValidation true
and it should work for youeager-lawyer-9843
06/13/2022, 5:23 PMbroad-dog-22463
06/13/2022, 5:24 PMeager-lawyer-9843
06/13/2022, 5:25 PMbroad-dog-22463
06/13/2022, 5:26 PM