This message was deleted.
# aws
s
This message was deleted.
b
Happening locally with
pulumi up
as well
b
can you share your code?
b
@billowy-army-68599 ^
b
hrm, I think we'll need to have an issue opened for this, I don't see any immediate issues there
b
okie thank you! will open a GitHub issue
l
Aside: I'm interested in how the
environment
and
vpcConfig
args work. You've not provided a property name on the LHS. Is that a typescript feature, where it figures out the property name from the variable name? I've never seen it before.
b
yup just simple TypeScript params so that I don’t have to manually add typings for environment / vpc config (found in pulumi-aws typescript definitions):
Copy code
interface FunctionEnvironment {
        /**
         * Map of environment variables that are accessible from the function code during execution.
         */
        variables?: pulumi.Input<{
            [key: string]: pulumi.Input<string>;
        }>;
    }

    interface FunctionVpcConfig {
        /**
         * List of security group IDs associated with the Lambda function.
         */
        securityGroupIds: pulumi.Input<pulumi.Input<string>[]>;
        /**
         * List of subnet IDs associated with the Lambda function.
         */
        subnetIds: pulumi.Input<pulumi.Input<string>[]>;
        vpcId?: pulumi.Input<string>;
    }
l
Yes I'm ok with the types, I'm fascinated by the fact you have
Copy code
...
  handler: "index.handler",
  environment,
  vpcConfig,
});
I expect this:
Copy code
...
  handler: "index.handler",
  environment: environment,
  vpcConfig: vpcConfig,
});
b
ohhhh yea that’s ESLint convention I like to use https://eslint.org/docs/rules/object-shorthand
r
Definitely one of my favorite ES6 features ^ @little-cartoon-10569 not just a TS thing: https://www.geeksforgeeks.org/shorthand-syntax-for-object-property-value-in-es6/
The panic, while unclear, looks like you’re using an array somewhere you should be using an object.
b
hmm looks like Pulumi examples use JSON.stringify for the policy object https://www.pulumi.com/docs/reference/pkg/aws/iam/policy/ i’ll try that
r
You might be able to get more information about where exactly the issue is by using
--logtostderr -v=9
https://www.pulumi.com/docs/troubleshooting/#verbose-logging
You shouldn’t need to use
JSON.stringify
in that specific case because it has a
PolicyDocument
type which means that it gets converted to json string under the hood.
q
@brainy-helmet-80249 Please post a link to the ticket once it’s created. I just got that error for the first time. I’d like to follow the progress.
r
@quick-apartment-308 please debug the issue yourself using verbose logging. This is more likely a user issue than a problem on the pulumi side.
👀 2
e
We've just experienced this error after upgrading our installed version of pulumi from 3.12.0 to 3.14.0
Ours seems to be happening when trying to update a lambda function
Using @red-match-15116's logging suggestion, I see:
Copy code
I1008 15:53:58.673933   34391 rpc.go:74] Marshaling property for RPC[Provider[aws, 0xc0018d6c00].Update(<<redacted>>,urn:pulumi:dev::<<redacted>>::aws:ec2/securityGroup:SecurityGroup$aws:iam/role:Role$aws:lambda/function:Function::<<redacted>>).news]: subnetIds={[{<<redacted>>} {<<redacted>>}]}
I1008 15:53:58.680811   34391 eventsink.go:59] Locking "aws_lambda_function"
I1008 15:53:58.680826   34391 eventsink.go:62] eventSink::Debug(<{%reset%}>Locking "aws_lambda_function"<{%reset%}>)
I1008 15:53:58.681017   34391 eventsink.go:59] Locked "aws_lambda_function"
I1008 15:53:58.681029   34391 eventsink.go:62] eventSink::Debug(<{%reset%}>Locked "aws_lambda_function"<{%reset%}>)
I1008 15:53:58.681373   34391 eventsink.go:59] Unlocking "aws_lambda_function"
I1008 15:53:58.681386   34391 eventsink.go:62] eventSink::Debug(<{%reset%}>Unlocking "aws_lambda_function"<{%reset%}>)
I1008 15:53:58.681559   34391 eventsink.go:59] Unlocked "aws_lambda_function"
I1008 15:53:58.681568   34391 eventsink.go:62] eventSink::Debug(<{%reset%}>Unlocked "aws_lambda_function"<{%reset%}>)
I1008 15:53:58.681568   34391 eventsink.go:62] eventSink::Debug(<{%reset%}>Unlocked "aws_lambda_function"<{%reset%}>)
I1008 15:53:58.684201   34391 eventsink.go:78] eventSink::Infoerr(<{%reset%}>panic: interface conversion: interface {} is []interface {}, not *schema.Set
(where
<<redacted>>
are our names/ ids)
b
@enough-leather-70274 @quick-apartment-308 I converted all our magic lambda functions to actual lambda functions (using
*new* aws.lambda.Function
) and made sure to pass in a role's name (instead of the role) when defining RolePolicyAttachments. Those two steps got our build working again on 3.14.0.
Copy code
new aws.iam.RolePolicyAttachment(
    `${functionName}-lambda-execute-role-policy-attachment-${stack}`,
    {
      role: lambdaRole.name, // Pass in the name here, instead of lambdaRole
      policyArn: aws.iam.ManagedPolicy.AWSLambdaExecute,
    }
  );
e
We're on python - not using magic lambdas but rather actual lambda functions and we use the id for the role when defining RolePolicyAttachments. Switching them to name doesn't seem to have any impact.
b
Hi folks - what version of the AWS provider are you using?
If it's
4.22.2
(the latest) then try downgrading to `4.22.1`: https://github.com/pulumi/pulumi-aws/issues/1651
It seems to be an issue across languages