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

terraform import on project only imports 20 environments #154

Closed
Yakimych opened this issue Jul 16, 2023 · 2 comments
Closed

terraform import on project only imports 20 environments #154

Yakimych opened this issue Jul 16, 2023 · 2 comments

Comments

@Yakimych
Copy link

We have 28 environments in our LD project. After running terraform import ... on this project I observe in the updated state file that the length of project.instances.attributes.environments is 20. The expected value is 28.

My guess is that the issue is that the environments are not paginated after fetching the first batch (via the project?expand=environment REST API call):

return client.ld.ProjectsApi.GetProject(client.ctx, projectKey).Expand("environments").Execute()

Here are the links to the LD REST API docs for reference:
https://apidocs.launchdarkly.com/tag/Projects#operation/getProject
https://apidocs.launchdarkly.com/tag/Environments

The default page size is indeed 20 items.

@ldhenry
Copy link
Collaborator

ldhenry commented Jul 17, 2023

Hey @Yakimych,

Thanks for bringing this to our attention. This does seem to be related to a pagination bug. Our team will look into getting a fix out soon.

Thanks,
Henry

@ldhenry
Copy link
Collaborator

ldhenry commented Jul 26, 2023

Hey @Yakimych,

We just released v2.13.3 which includes a fix for this issue. Please feel free to reopen this issue if you are still experiencing issues after upgrading.

Thanks,
Henry

@ldhenry ldhenry closed this as completed Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants