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

InvalidAction: Unavailable Operation for AWS #138

Closed
tcurdt opened this issue Oct 4, 2020 · 3 comments · Fixed by #139
Closed

InvalidAction: Unavailable Operation for AWS #138

tcurdt opened this issue Oct 4, 2020 · 3 comments · Fixed by #139
Assignees
Labels
Provider: AWS Issues related to the AWS Provider Type: Bug Something isn't working

Comments

@tcurdt
Copy link

tcurdt commented Oct 4, 2020

General information:

  • Operating System:

macOS 10.15.6

  • Terracognita version / tag:

v0.5.1

  • Did you build Terracognita from sources or did you use the Docker image:

binary release downloaded from github

Describe the bug:

I was trying to generate the config (especially for SES) but it aborts.
Could this be a permission issue for the given credentials?
Either way - it should not give a stack trace like this.

Log message

$ ./terracognita-darwin-amd64 aws --access-key ".." --secret-key ".." --region eu-central-1
Starting Terracognita with version v0.5.1
Importing with filters: 
	Tags:    [],
	Include: [],
	Exclude: [],
	Targets: [],
Importing aws_vpc [1/1] Done!
Importing aws_key_pair [1/1] Done!
Importing aws_security_group [1/1] Done!
Importing aws_subnet [3/3] Done!
Importing aws_alb_target_group [1/1] Done!
Importing aws_iam_access_key [2/2] Done!
Importing aws_iam_account_alias [1/1] Done!
Importing aws_iam_account_password_policy [1/1] Done!
Importing aws_iam_group [2/2] Done!
Importing aws_iam_group_membership [2/2] Done!
Importing aws_iam_group_policy_attachment [5/5] Done!
Importing aws_iam_policy [1/1] Done!
Importing aws_iam_role [5/5] Done!
Importing aws_iam_role_policy [3/3] Done!
Importing aws_iam_role_policy_attachment [4/4] Done!
Importing aws_iam_user [2/2] Done!
Importing aws_iam_user_policy_attachment [1/1] Done!
Importing aws_route53_resolver_rule_association [1/1] Done!
Error: could not import from AWS: InvalidAction: Unavailable Operation
	status code: 400, request id: e1edbc82-c70d-4184-9852-c1843066ec7a
error while reading from resource "aws_ses_active_receipt_rule_set"
github.com/cycloidio/terracognita/aws.(*aws).Resources
	/tmp/build/6b18b934/code/aws/provider.go:74
github.com/cycloidio/terracognita/provider.Import
	/tmp/build/6b18b934/code/provider/import.go:91
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:203
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1373
github.com/cycloidio/terracognita/provider.Import
	/tmp/build/6b18b934/code/provider/import.go:93
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:203
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1373

Additional context

@tcurdt tcurdt added the Type: Bug Something isn't working label Oct 4, 2020
@tormath1 tormath1 added the Provider: AWS Issues related to the AWS Provider label Oct 5, 2020
@tormath1
Copy link
Contributor

tormath1 commented Oct 5, 2020

Hi @tcurdt,

This error seems to happen when SES is not activated on the region provided to terracognita arguments (eu-central-1).

Example:

$ aws --region eu-west-1 --profile my-profile ses list-receipt-rule-sets | jq -c ".RuleSets"
[{"Name":"default-rule-set","CreatedTimestamp":"2016-05-09T15:06:56.421Z"}]

$ aws --region eu-west-2 --profile my-profile ses list-receipt-rule-sets

An error occurred (InvalidAction) when calling the ListReceiptRuleSets operation: Unavailable Operation

We will work on a way to "ignore" this kind of error in order to continue the import !

@tcurdt
Copy link
Author

tcurdt commented Oct 6, 2020

@tormath1 thanks for the insights - I can reproduce the following:

% aws --region eu-central-1 ses list-receipt-rule-sets
An error occurred (InvalidAction) when calling the ListReceiptRuleSets operation: Unavailable Operation

but I have a functioning SES setup in eu-central-1

% aws --region eu-central-1 ses  get-account-sending-enabled
{
    "Enabled": true
}

ses

@tcurdt
Copy link
Author

tcurdt commented Oct 9, 2020

@tormath1 So IIUC it wasn't really about activated or not activated - it was just about an error failing the whole import?

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: Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants