Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.
This repository was archived by the owner on May 1, 2025. It is now read-only.

[jdcloud builder] Builder does not clean up created resources: eip, vpc, subnets, ssh keys #5

@ghost

Description

This issue was originally opened by @hsanjuan as hashicorp/packer#9481. It was migrated here as a result of the Packer plugin split. The original body of the issue is below.


Overview of the Issue

The jdcloud builder does not perform much of a cleanup. It leaves eips, vpc, subnets and ssh keys hanging around.

In the case of eips, they cost money and the user is not warned.

In the case of vpc and subnets, it gives a default "created_by_packer" name which causes next Packer build to fail because they already exist.

Reproduction Steps

  1. Build with jdcloud builder without specifying subnet_id.
  2. Rebuild the same thing
  3. Check the console interface: Created EIP is not cleaned up with the instance.

Packer version

1.6.0

Simplified Packer Buildfile

	{
	    "image_name": "name",
	    "type": "jdcloud",
	    "image_id": "img-xxxx",
	    "region_id": "{{ user `region` }}",
	    "az": "{{ user `az` }}",
	    "instance_name": "somethingunique_{{ timestamp }}",
	    "instance_type": "g.n2.medium",
	    "temporary_key_pair_name": "whatever_new_key_name",
	    "communicator": "ssh",
	    "ssh_username": "root",
	    "ssh_timeout": "120s"
	}

cc. codeowners @XiaohanLiang @remrain

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions