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

pecdm::provision fails to reprovision a deleted VM in aws #114

Open
jessereynolds opened this issue Nov 22, 2023 · 0 comments
Open

pecdm::provision fails to reprovision a deleted VM in aws #114

jessereynolds opened this issue Nov 22, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@jessereynolds
Copy link

Describe the Bug

pecdm::provision should handle the case where a VM has been deleted but other resources are still instantiated such as the EC2 Key Pair. Currently the terraform::apply task errors as follows:

Failed on localhost:

  Error: importing EC2 Key Pair (pe_adm_a7d5bf): InvalidKeyPair.Duplicate: The keypair already exists
  	status code: 400, request id: 2d8e22fe-9472-4999-8367-3714c3987298

    with module.instances.aws_key_pair.pe_adm,
    on modules/instances/main.tf line 54, in resource "aws_key_pair" "pe_adm":
    54: resource "aws_key_pair" "pe_adm" {


  Error: creating EC2 VPC: operation error EC2: CreateVpc, https response error StatusCode: 400, RequestID: 305d4e97-817c-4a45-810f-e65afd880897, api error VpcLimitExceeded: The maximum number of VPCs has been reached.

    with module.networking.aws_vpc.pe[0],
    on modules/networking/main.tf line 23, in resource "aws_vpc" "pe":
    23: resource "aws_vpc" "pe" {

Failed on 1 target: localhost

Expected Behavior

Existing resources already present should not cause (re)provisioning failure

Steps to Reproduce

  • Create a standard pecdm infra on aws
  • Terminate the PE Primary server ec2 instance
  • Attempt to run the provision again

Environment

git show
commit f13a5abcc781804b77e4165f6079b2f194d2fee4 (HEAD -> main, origin/main, origin/HEAD)
Merge: 48bb621 82838da
Author: David Sandilands <[email protected]>
Date:   Tue Oct 17 16:02:01 2023 +0100

terraform puppet module version from Puppetfile:

mod 'puppetlabs-terraform',
    git: 'https://github.com/puppetlabs/puppetlabs-terraform.git',
    ref: 'ce7b0070e7d7ec3b683df7dffb7fce745eca06e6'

Additional Context

N/A

@jessereynolds jessereynolds added the bug Something isn't working label Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant