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

AWS: Support pagination #13

Closed
xescugc opened this issue Jun 6, 2019 · 1 comment · Fixed by #101
Closed

AWS: Support pagination #13

xescugc opened this issue Jun 6, 2019 · 1 comment · Fixed by #101
Assignees
Labels
Provider: AWS Issues related to the AWS Provider Type: Enhancement Provide a new feature or improve an existing one

Comments

@xescugc
Copy link
Member

xescugc commented Jun 6, 2019

Right now we do not iterate over the results from AWS, we just use the first page, we should read all the pages of each resource to have the full list of services for that resource.

Related: #52

@xescugc xescugc added the Type: Enhancement Provide a new feature or improve an existing one label Jun 6, 2019
@xescugc xescugc self-assigned this Jan 3, 2020
@xescugc xescugc added Status: In progress Provider: AWS Issues related to the AWS Provider labels Jan 3, 2020
@xescugc
Copy link
Member Author

xescugc commented Jan 3, 2020

Now that we have moved the Reader of AWS into Terracognita we can start doing this.

The idea would be to change the generated code to directly return the full list of results by automatically iterating over them.

We'll keep the signature we have Get*(ctx, input) but the return will be different, it'll be a slice of the results, so at the end for the GetVpcs would be:

Before
GetVpcs(ctx context.Context, input *ec2.DescribeVpcsInput) (*ec2.DescribeVpcsOutput, error)
After
GetVpcs(ctx context.Context, input *ec2.DescribeVpcsInput) ([]*ec2.Vpc, error)

It'll also require a modification on the generation function, to know which is the attribute to iterate over and the type so we can access it and put it on the signature. Potential names would be AttributeList and ListType but just if it's different than the Entity (for Vpcs the AttributeList is the Entity and the ListType is the singular of the Entity).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Provider: AWS Issues related to the AWS Provider Type: Enhancement Provide a new feature or improve an existing one
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants