Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group: id and parentId are of different types #28

Open
ringods opened this issue Jan 15, 2020 · 2 comments
Open

Group: id and parentId are of different types #28

ringods opened this issue Jan 15, 2020 · 2 comments
Labels
kind/enhancement Improvements or new features

Comments

@ringods
Copy link
Member

ringods commented Jan 15, 2020

In Gitlab, you can nest groups. You first create a parent group. Then, you should be able to pass the id of the parent group as the value of the parentId property for the child group.

At the moment, the types of these two properties are different:
id: Output<ID> and type ID = string;
https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/gitlab/#Group-id

parentId: number | Promise<number> | OutputInstance<number> | undefined
https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/gitlab/#Group-parentId

So I can not directly pass the id as the value for parentId. Can this be fixed by tweaking and regenerating the Pulumi wrapper around the TF provider?

@lukehoban
Copy link
Member

The issue appears to just be the difference between ID=string and number. That appears to be a schematization error in the upstream Terraform provider which doesn't in practice get caught by Terraform users because TF does silent type conversions.

You can work around this by doing parentId: something.id.apply(id => +id) which will convert a string id to a number id.

We should most likely contribute a fix to the Terraform provider.

@skycaptain
Copy link

ProjectJobTokenScope has the same issue. While project is a str, target_project_id is expected to be int

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

5 participants