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

Crashes when processing empty list of groups for a IAM user. #104

Closed
rquadling opened this issue May 28, 2020 · 2 comments · Fixed by #107
Closed

Crashes when processing empty list of groups for a IAM user. #104

rquadling opened this issue May 28, 2020 · 2 comments · Fixed by #107
Assignees
Labels
Type: Bug Something isn't working

Comments

@rquadling
Copy link

General information:

  • Operating System: MacOS Catalina 10.15.4
  • Terracognita version / tag: 0.4.0 but shows as 0.3.0
  • Did you build Terracognita from sources or did you use the Docker image: from 0.4.0 binary

Describe the bug:

Could not read aws_iam_user_group_membership. User in question has no groups.

Log message

ts=2020-05-28T14:37:40.501085Z caller=import.go:102 func=provider.Import resource=aws_instance resource=aws_vpc resource=aws_vpc_peering_connection resource=aws_key_pair resource=aws_security_group resource=aws_subnet resource=aws_ebs_volume resource=aws_elasticache_cluster resource=aws_elb resource=aws_alb resource=aws_alb_listener resource=aws_alb_listener_rule resource=aws_alb_listener_certificate resource=aws_alb_target_group resource=aws_db_instance resource=aws_db_parameter_group resource=aws_db_subnet_group resource=aws_s3_bucket resource=aws_cloudfront_distribution resource=aws_cloudfront_origin_access_identity resource=aws_cloudfront_public_key resource=aws_cloudwatch_metric_alarm resource=aws_iam_access_key resource=aws_iam_account_alias resource=aws_iam_account_password_policy resource=aws_iam_group resource=aws_iam_group_membership resource=aws_iam_group_policy resource=aws_iam_group_policy_attachment resource=aws_iam_instance_profile resource=aws_iam_openid_connect_provider resource=aws_iam_policy resource=aws_iam_role resource=aws_iam_role_policy resource=aws_iam_role_policy_attachment resource=aws_iam_saml_provider resource=aws_iam_server_certificate resource=aws_iam_user resource=aws_iam_user_group_membership id=Terraformer total=1 current=1 msg="reading from TF"
Error: could not import from AWS: unexpected format of ID ("Terraformer"), expected <user-name>/<group-name1>/...
could not import resource aws_iam_user_group_membership with id Terraformer
github.com/cycloidio/terracognita/provider.(*resource).ImportState
	/tmp/build/6b18b934/code/provider/resource.go:194
github.com/cycloidio/terracognita/provider.Import
	/tmp/build/6b18b934/code/provider/import.go:103
github.com/cycloidio/terracognita/cmd.glob..func2
	/tmp/build/6b18b934/code/cmd/aws.go:86
github.com/spf13/cobra.(*Command).execute
	/tmp/build/6b18b934/go/pkg/mod/github.com/spf13/[email protected]/command.go:826
github.com/spf13/cobra.(*Command).ExecuteC
	/tmp/build/6b18b934/go/pkg/mod/github.com/spf13/[email protected]/command.go:914
github.com/spf13/cobra.(*Command).Execute
	/tmp/build/6b18b934/go/pkg/mod/github.com/spf13/[email protected]/command.go:864
main.main
	/tmp/build/6b18b934/code/main.go:11
runtime.main
	/usr/local/go/src/runtime/proc.go:200
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1337

Additional context

Add any other context about the problem here.

Using the following, demonstrates no groups or groups for specific user.

$ aws --profile management iam list-groups-for-user --user Terraformer
{
    "Groups": []
}
$ aws --profile management iam list-groups
{
    "Groups": []
}
@xescugc
Copy link
Member

xescugc commented May 29, 2020

Thanks for the Issue :). Already opened the PR to solve the issue #107

@xescugc
Copy link
Member

xescugc commented Jun 3, 2020

This issue is solved now on master, we'll prepare a release soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
2 participants