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

Removed the table aws_organizations_organizational_unit Closes # 2057 #2058

Merged
merged 3 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aws/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ func Plugin(ctx context.Context) *plugin.Plugin {
"aws_oam_sink": tableAwsOAMSink(ctx),
"aws_opensearch_domain": tableAwsOpenSearchDomain(ctx),
"aws_organizations_account": tableAwsOrganizationsAccount(ctx),
"aws_organizations_organizational_unit": tableAwsOrganizationsOrganizationalUnit(ctx),
// "aws_organizations_organizational_unit": tableAwsOrganizationsOrganizationalUnit(ctx),
"aws_organizations_policy": tableAwsOrganizationsPolicy(ctx),
"aws_organizations_policy_target": tableAwsOrganizationsPolicyTarget(ctx),
"aws_organizations_root": tableAwsOrganizationsRoot(ctx),
Expand Down
8 changes: 3 additions & 5 deletions aws/table_aws_organizations_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@ func listOrganizationsAccounts(ctx context.Context, d *plugin.QueryData, _ *plug
return nil, err
}

// The maximum number for MaxResults parameter is not defined by the API
// We have set the MaxResults to 1000 based on our test
maxItems := int32(1000)
// Limit the result
maxItems := int32(20)

// Reduce the basic request limit down if the user has only requested a small number of rows
if d.QueryContext.Limit != nil {
Expand All @@ -142,8 +141,7 @@ func listOrganizationsAccounts(ctx context.Context, d *plugin.QueryData, _ *plug
// If you specify the root, you get a list of all the accounts that aren't in any OU.
// If you specify an OU, you get a list of all the accounts in only that OU and not in any child OUs.
if parentId != "" {
maxItem := int32(20) // TODO for limit value in where clause
op, err := listOrganizationsAccountsForParent(ctx, d, svc, maxItem, &organizations.ListAccountsForParentInput{
op, err := listOrganizationsAccountsForParent(ctx, d, svc, maxItems, &organizations.ListAccountsForParentInput{
ParentId: &parentId,
MaxResults: &maxItems,
})
Expand Down
Loading