sparse-intern-71089
12/06/2022, 3:29 PMlittle-soccer-5693
12/06/2022, 6:54 PMlittle-soccer-5693
12/06/2022, 6:58 PMpermissionArgs := &lambda.PermissionArgs{
Action: pulumi.String("lambda:InvokeFunction"),
Function: lambdaFunc.Arn,
Principal: pulumi.String("<http://apigateway.amazonaws.com|apigateway.amazonaws.com>"),
SourceArn: pulumi.Sprintf("arn:aws:execute-api:%v:%v:%v/*",
region, accountId, apiGw.ID()),
}
_, err = lambda.NewPermission(ctx, "lambda-perm", permissionArgs)
if err != nil {
return err
}
where lambdaFunc and apiGw were outputs from earlier pulumi operations.fierce-ability-58936
12/06/2022, 8:17 PMpulumi.StringArrayOutput
The pulumi.ToStringArray
requires plain strings, yes, but there's also an Output version of it that expects an array of StringOutput.
So this should work:
...
PolicyArns: pulumi.ToStringArrayOutput(
[]pulumi.StringOutput{acmeDNS01Policy.Arn}),
}
...
thousands-train-46386
12/07/2022, 1:51 PMerror: an unhandled error occurred: waiting for RPCs: rpc error: code = Unknown desc = setting args: copying input "role": expected destination type to implement pulumi.Input or pulumi.Output, got utils.RoleArgs
I’ve attempt to change my code according to what the error is reporting:
_, err = piam.NewAssumableRoleWithOIDC(ctx, eksID+"-cert-manager", &piam.AssumableRoleWithOIDCArgs{
Role: piam.RolePtr(
&piam.RoleArgs{
Name: pulumi.String(eksID + "-cert-manager"),
PolicyArns: pulumi.ToStringArrayOutput([]pulumi.StringOutput{acmeDNS01Policy.Arn}),
}),
ProviderUrls: pulumi.ToStringArrayOutput([]pulumi.StringOutput{oidcPolicyURL}),
Tags: pulumi.StringMap{
"Owner": pulumi.String(event.User),
"EKS cluster": pulumi.String(eksID),
},
}, pulumi.DependsOn([]pulumi.Resource{eksCluster}))
I’m really struggling with this resource and have not been able to find an other examples other than what is provided in the resource docsfierce-ability-58936
12/07/2022, 7:33 PMRole: iam.RoleArgs{
Name: pulumi.String("oidc-role"),
PolicyArns: pulumi.ToStringArray([]string{"arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy"}),
},
So there's no extra RolePtr, maybe that causes the issue.thousands-train-46386
12/07/2022, 8:29 PMRolePtr
because I was getting that error. FWIW, I get the same error both ways 🤷