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

Automatically import resource on errors like Resource already exists #1061

Open
eistrati opened this issue Jan 15, 2021 · 5 comments
Open

Automatically import resource on errors like Resource already exists #1061

eistrati opened this issue Jan 15, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@eistrati
Copy link
Contributor

Feature Report

Describe the Feature

Automatically import resource on errors like Resource already exists

Expected Behavior

Execute terrahub run --auto-import and when an error is thrown by terraform related to an existing resource (something link resource already exists), re-run terraform import and again terraform plan (or terraform apply)

@eistrati
Copy link
Contributor Author

eistrati commented Jan 17, 2021

Additionally, let's make an effort to decouple and consolidate terraform errors that are caught and processed by terrahub:

reference: #1060 (comment)

@eistrati eistrati added the enhancement New feature or request label Jan 18, 2021
@eistrati
Copy link
Contributor Author

eistrati commented Feb 12, 2021

Another error to catch and retry using exponential backoff method:

💡 [iam_policy] terraform plan -no-color -var-file='/Users/eugene/Projects/controltower-customizations/terraform/iam_policy/default.tfvars' -out=/Users/eugene/Projects/controltower-customizations/terraform/iam_policy/terraform.tfplan -input=false

❌ [iam_policy] Error: rpc error: code = Unavailable desc = transport is closing

❌ [Local distributor]: Error: rpc error: code = Unavailable desc = transport is closing

@eistrati
Copy link
Contributor Author

Another error to catch and retry using exponential backoff method:

💡 [cloudtrail] terraform plan -no-color -var-file='/Users/eugene/Projects/controltower-customizations/terraform/cloudtrail/default.tfvars' -out=/Users/eugene/Projects/controltower-customizations/terraform/cloudtrail/terraform.tfplan -input=false

❌ [cloudtrail] Error: Unrecognized remote plugin message: 

This usually means that the plugin is either invalid or simply
needs to be recompiled to support the latest protocol.

@eistrati
Copy link
Contributor Author

eistrati commented Feb 12, 2021

Another error to catch and retry using exponential backoff method:

💡 [datapipeline] terraform plan -no-color -var-file='/Users/eugene/Projects/controltower-customizations/terraform/datapipeline/default.tfvars' -out=/Users/eugene/Projects/controltower-customizations/terraform/datapipeline/terraform.tfplan -input=false

❌ [devops_pipeline] 
Error: Could not load plugin

Plugin reinitialization required. Please run "terraform init".

@eistrati
Copy link
Contributor Author

Another error to catch and retry using exponential backoff method:

💡 [iam_user] terraform plan -no-color -var-file='/Users/eugene/Projects/controltower-customizations/terraform/iam_user/default.tfvars' -out=/Users/eugene/Projects/controltower-customizations/terraform/iam_user/terraform.tfplan -input=false

❌ [iam_policy] Error: rpc error: code = Canceled desc = context canceled

❌ [Local distributor]: Error: rpc code = Canceled desc = context canceled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants