This message was deleted.
# general
s
This message was deleted.
a
Something like this should work for the conversion:
Copy code
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";

const group1 = new gitlab.Group("group1", {
    path: "path1",
});

// Convert Output<string> to Output<number>
const parentIdNum = group1.id.apply(string => parseInt(string));

const group2 = new gitlab.Group("group2", {
    path: "path2",
    parentId: parentIdNum
});
If you expect to be doing this a lot, you could also wrap the apply bit as a function like so:
Copy code
// Usage: stringToNumber(group.id)
function stringToNumber(stringOut: pulumi.Output<string>): pulumi.Output<number>{
    return stringOut.apply(string => parseInt(string));
}
That way you don't have to repeat the apply part every time.
l
I also filed this as an issue: https://github.com/pulumi/pulumi-gitlab/issues/28 The answer there is probably the shortest possible:
parentId: something.id.apply(id => +id)
👍 1