You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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).
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
The text was updated successfully, but these errors were encountered: