Skip to main content
Solved

Error import KeyPair: InvalidKeyPair.Duplicate: The keypair already exists

  • Sep 6, 2024 2:11 AM UTC
  • 10 replies
  • 269 views

Forum|alt.badge.img

I am taking the Iac lab.   When i start the SST first time, i was able to launch the controller successfully.  After three day,  when i start from scratch, after gave the controller license, i am getting below error.  I tested three times, same error

in the community also , i dont see this error, so posting. pls assist to complete my iac certfication

=============================

module.aviatrix_controller_aws.module.aviatrix_controller_build.aws_instance.aviatrix_controller: Still creating... [10s elapsed] module.aviatrix_controller_aws.module.aviatrix_controller_build.aws_instance.aviatrix_controller: Creation complete after 12s [id=i-082846b0f48c10f3e] module.aviatrix_controller_aws.module.aviatrix_controller_build.aws_eip_association.eip_assoc: Creating... module.aviatrix_controller_aws.module.aviatrix_controller_build.aws_eip_association.eip_assoc: Creation complete after 2s [id=eipassoc-079ed04b3bf539b67] --> Controller launch failed, aborting.
/root/sandbox_starter_web.sh: line 813: [: too many arguments ╷ │
Error import KeyPair: InvalidKeyPair.Duplicate: The keypair already exists │ status code: 400, request id: c002c553-a270-4217-819b-ecb8b4493f6d │ │ with module.aviatrix_controller_aws.module.aviatrix_controller_build.aws_key_pair.controller_key_pair[0], │ on .terraform/modules/aviatrix_controller_aws/modules/aviatrix-controller-build/main.tf line 61, in resource "aws_key_pair" "controller_key_pair": │ 61: resource "aws_key_pair" "controller_key_pair" { │ ╵ --> Controller launch failed, aborting.

===============

 

Best answer by MohammedBanabila

try to delete all existing or previous resources along with key pair and then try to deploy resources again with new key pair with different name

View original

10 replies

MohammedBanabila
Forum|alt.badge.img+5

try to delete all existing or previous resources along with key pair and then try to deploy resources again with new key pair with different name


Forum|alt.badge.img
  • Author
  • Cadet
  • Sep 6, 2024 3:59 PM UTC

let me test now. 


Forum|alt.badge.img
  • Author
  • Cadet
  • Sep 6, 2024 5:50 PM UTC

Thanks MohammedBanabila.   I am able to install the controller now, let me continue the iac lab.  


MohammedBanabila
Forum|alt.badge.img+5

most welcome @Ismauto 


Forum|alt.badge.img
  • Author
  • Cadet
  • Sep 7, 2024 2:11 AM UTC

In First lab, while execute the Terraform code, I see this error.   Any suggestion / direction.   I will continue this tomorrow again.   

 


MohammedBanabila
Forum|alt.badge.img+5

in azure account, did you create access IAM) with minimum permissions.

https://docs.aviatrix.com/documentation/latest/accounts-and-users/account-azure.html?expand=true 

 


MohammedBanabila
Forum|alt.badge.img+5

check if azure account has proper access control (IAM) permission and be sure that you added right permissions of particular azure account but not to other permissions that will cause mismatched permissions


Forum|alt.badge.img
  • Author
  • Cadet
  • Sep 10, 2024 12:02 AM UTC

I will test and update. 


Forum|alt.badge.img
  • Author
  • Cadet
  • Sep 12, 2024 12:56 AM UTC

MohammedBanabila
Forum|alt.badge.img+5

most welcome @Ismauto