Hi Guys My Pulumi Packages journey continues :slig...
# general
p
Hi Guys My Pulumi Packages journey continues 🙂 I have created a pulumi packages repo, and components written in Go The component gets a structure like this:
Copy code
// GcpPermissionsArgs The set of arguments for creating a GcpPermissions component resource.
type GcpPermissionsArgs struct {
   Project               string   `pulumi:"project"`
   GcpServiceAccountName string   `pulumi:"gcpServiceAccountName"`
   GcpPermissions        []string `pulumi:"gcpPermissions"`
}
GcpPermissions
is an array of strings ([]string). The packages is generating the Typescript code, making the args as follows:
Copy code
/**
 * The set of arguments for constructing a GcpPermissions resource.
 */
export interface GcpPermissionsArgs {
    /**
     * Array of GCP permissions.
     */
    gcpPermissions: pulumi.Input<pulumi.Input<{
        [key: string]: pulumi.Input<string>;
    }>[]>;
    /**
     * Wanted name for the new service account.
     */
    gcpServiceAccountName: pulumi.Input<string>;
    /**
     * Pulumi project's name.
     */
    project: pulumi.Input<string>;
}
Making the
gcpPermissions
argument be an array of key value variables. Actual result should have been something like:
Copy code
gcpPermissions: pulumi.Input<string>[];
What am I doing wrong? how can I solve this?
b
@prehistoric-sandwich-7272 you’d need to make the input type on the struct, an Input<string> see here as an example: https://github.com/jaxxstorm/pulumi-productionapp/blob/main/provider/pkg/provider/productionApp.go#L29
for your specific type, it would
pulumi.StringArrayInput
p
Thanks!!