Skip to main content
fix typo
Source Link
cueedee
  • 151
  • 6
$ terraform -version
Terraform v0.12.21
+ provider.aws v2.34.0

Given a terraform configuration for one set of single aws_instance, aws_ebs_volume and aws_volume_attachment resources, each named, say,foo;

How would one terraform destroy -target=aws_instance.foo without terraform also destroying the aws_ebs_volumenaws_ebs_volume.foo as the resulting plan insists that it will?

  • The aws console reports Delete on termination for the volume's block device to be false;
  • I've tried to terraform destroy -target=aws_volume_attachement.foo first;
    ... no-change.
  • I've tried removing the aws_volume_attachment from the configuration, terraform apply it and then terraform destroy -target=aws_instance.foo;
    ... didn't help either

Somehow terraform really wants to destroy the aws_ebs_volume resource together with the aws_instance resource.

I, otoh, would very much like to preserve that aws_ebs_volume for later attachment to a re-created aws_instance...

Can it be done?

$ terraform -version
Terraform v0.12.21
+ provider.aws v2.34.0

Given a terraform configuration for one set of single aws_instance, aws_ebs_volume and aws_volume_attachment resources, each named, say,foo;

How would one terraform destroy -target=aws_instance.foo without terraform also destroying the aws_ebs_volumen.foo as the resulting plan insists that it will?

  • The aws console reports Delete on termination for the volume's block device to be false;
  • I've tried to terraform destroy -target=aws_volume_attachement.foo first;
    ... no-change.
  • I've tried removing the aws_volume_attachment from the configuration, terraform apply it and then terraform destroy -target=aws_instance.foo;
    ... didn't help either

Somehow terraform really wants to destroy the aws_ebs_volume resource together with the aws_instance resource.

I, otoh, would very much like to preserve that aws_ebs_volume for later attachment to a re-created aws_instance...

Can it be done?

$ terraform -version
Terraform v0.12.21
+ provider.aws v2.34.0

Given a terraform configuration for one set of single aws_instance, aws_ebs_volume and aws_volume_attachment resources, each named, say,foo;

How would one terraform destroy -target=aws_instance.foo without terraform also destroying the aws_ebs_volume.foo as the resulting plan insists that it will?

  • The aws console reports Delete on termination for the volume's block device to be false;
  • I've tried to terraform destroy -target=aws_volume_attachement.foo first;
    ... no-change.
  • I've tried removing the aws_volume_attachment from the configuration, terraform apply it and then terraform destroy -target=aws_instance.foo;
    ... didn't help either

Somehow terraform really wants to destroy the aws_ebs_volume resource together with the aws_instance resource.

I, otoh, would very much like to preserve that aws_ebs_volume for later attachment to a re-created aws_instance...

Can it be done?

include more data on the associated volume.
Source Link
cueedee
  • 151
  • 6
$ terraform -version
Terraform v0.12.21
+ provider.aws v2.34.0

Given a terraform configuration for one set of single aws_instance, aws_ebs_volume and aws_volume_attachment resources, each named, say,foo;

How would one terraform destroy -target=aws_instance.foo without terraform also destroying the aws_ebs_volumen.foo as the resulting plan insists that it will?

I've tried to terraform destroy -target=aws_volume_attachement.foo first;

... no-change.

I've tried removing the aws_volume_attachment from the configuration, terraform apply it and then terraform destroy -target=aws_instance.foo;

... didn't help either

  • The aws console reports Delete on termination for the volume's block device to be false;
  • I've tried to terraform destroy -target=aws_volume_attachement.foo first;
    ... no-change.
  • I've tried removing the aws_volume_attachment from the configuration, terraform apply it and then terraform destroy -target=aws_instance.foo;
    ... didn't help either

Somehow terraform really wants to destroy the aws_ebs_volume resource together with the aws_instance resource.

I, otoh, would very much like to preserve that aws_ebs_volume for later attachment to a re-created aws_instance...

Can it be done?

$ terraform -version
Terraform v0.12.21
+ provider.aws v2.34.0

Given a terraform configuration for one set of single aws_instance, aws_ebs_volume and aws_volume_attachment resources, each named, say,foo;

How would one terraform destroy -target=aws_instance.foo without terraform also destroying the aws_ebs_volumen.foo as the resulting plan insists that it will?

I've tried to terraform destroy -target=aws_volume_attachement.foo first;

... no-change.

I've tried removing the aws_volume_attachment from the configuration, terraform apply it and then terraform destroy -target=aws_instance.foo;

... didn't help either

Somehow terraform really wants to destroy the aws_ebs_volume resource together with the aws_instance resource.

I, otoh, would very much like to preserve that aws_ebs_volume for later attachment to a re-created aws_instance...

Can it be done?

$ terraform -version
Terraform v0.12.21
+ provider.aws v2.34.0

Given a terraform configuration for one set of single aws_instance, aws_ebs_volume and aws_volume_attachment resources, each named, say,foo;

How would one terraform destroy -target=aws_instance.foo without terraform also destroying the aws_ebs_volumen.foo as the resulting plan insists that it will?

  • The aws console reports Delete on termination for the volume's block device to be false;
  • I've tried to terraform destroy -target=aws_volume_attachement.foo first;
    ... no-change.
  • I've tried removing the aws_volume_attachment from the configuration, terraform apply it and then terraform destroy -target=aws_instance.foo;
    ... didn't help either

Somehow terraform really wants to destroy the aws_ebs_volume resource together with the aws_instance resource.

I, otoh, would very much like to preserve that aws_ebs_volume for later attachment to a re-created aws_instance...

Can it be done?

include tool versions
Source Link
cueedee
  • 151
  • 6
$ terraform -version
Terraform v0.12.21
+ provider.aws v2.34.0

Given a terraform configuration for one set of single aws_instance, aws_ebs_volume and aws_volume_attachment resources, each named, say,foo;

How would one terraform destroy -target=aws_instance.foo without terraform also destroying the aws_ebs_volumen.foo as the resulting plan insists that it will?

I've tried to terraform destroy -target=aws_volume_attachement.foo first;

... no-change.

I've tried removing the aws_volume_attachment from the configuration, terraform apply it and then terraform destroy -target=aws_instance.foo;

... didn't help either

Somehow terraform really wants to destroy the aws_ebs_volume resource together with the aws_instance resource.

I, otoh, would very much like to preserve that aws_ebs_volume for later attachment to a re-created aws_instance...

Can it be done?

Given a terraform configuration for one set of single aws_instance, aws_ebs_volume and aws_volume_attachment resources, each named, say,foo;

How would one terraform destroy -target=aws_instance.foo without terraform also destroying the aws_ebs_volumen.foo as the resulting plan insists that it will?

I've tried to terraform destroy -target=aws_volume_attachement.foo first;

... no-change.

I've tried removing the aws_volume_attachment from the configuration, terraform apply it and then terraform destroy -target=aws_instance.foo;

... didn't help either

Somehow terraform really wants to destroy the aws_ebs_volume resource together with the aws_instance resource.

I, otoh, would very much like to preserve that aws_ebs_volume for later attachment to a re-created aws_instance...

Can it be done?

$ terraform -version
Terraform v0.12.21
+ provider.aws v2.34.0

Given a terraform configuration for one set of single aws_instance, aws_ebs_volume and aws_volume_attachment resources, each named, say,foo;

How would one terraform destroy -target=aws_instance.foo without terraform also destroying the aws_ebs_volumen.foo as the resulting plan insists that it will?

I've tried to terraform destroy -target=aws_volume_attachement.foo first;

... no-change.

I've tried removing the aws_volume_attachment from the configuration, terraform apply it and then terraform destroy -target=aws_instance.foo;

... didn't help either

Somehow terraform really wants to destroy the aws_ebs_volume resource together with the aws_instance resource.

I, otoh, would very much like to preserve that aws_ebs_volume for later attachment to a re-created aws_instance...

Can it be done?

Source Link
cueedee
  • 151
  • 6
Loading