-
Notifications
You must be signed in to change notification settings - Fork 170
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 resource: aws_iam_group_membership
and resource.SetImporter
#116
Conversation
2ac2ef6
to
a400b95
Compare
a400b95
to
28bc83f
Compare
Can you rebase this branch with the latest |
28bc83f
to
6f1241f
Compare
6f1241f
to
cdad5b9
Compare
CI is still failing and for what I see you did not rebase with |
Didn't had time to check the ci yet (this is why I set the in progress label). But the rebase have been done. |
cdad5b9
to
29780b5
Compare
@@ -1083,6 +1110,10 @@ func iamUsers(ctx context.Context, a *aws, resourceType string, filters *filter. | |||
} | |||
|
|||
func iamUserGroupMemberships(ctx context.Context, a *aws, resourceType string, filters *filter.Filter) ([]provider.Resource, error) { | |||
// if both aws_iam_group_membership and aws_iam_user_group_membership defined, keep only aws_iam_group_membership | |||
if filters.IsIncluded("aws_iam_group_membership") && (!filters.IsExcluded("aws_iam_group_membership")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition is weird ?
We check if the aws_iam_group_membership
is included and if it's not excluded (so included) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well this is something that I could check in the IsIncluded function.
But currently this function only check if all or a dedicated resource is included, not if the resource is not in exclude.
So we need to check if a user set include aws_iam_group_membership
and exclude aws_iam_group_membership
. If both are set, the resource will not be imported
I commented to @talset to write a TODO for that specific case and open an issue to track the actual issue opened on the TF provider. So we can rely on it and remove this logic once the TF provider supports it. |
29780b5
to
10233d0
Compare
10233d0
to
5d12588
Compare
provider resource: implement SetImporter to set schema.Resource.Importer when resource is not importable.
aws resource:
aws_iam_group_membership