Skip to content

Ordering issue when deleting resources #1141

@dmumpuu

Description

@dmumpuu

Provider version

tried with 8.3.2 and 8.4.0

Affected Fastly Terraform Resource(s)

  • fastly_service_vcl
  • fastly_domain_v1
  • fastly_tls_subscription

Expected Behavior

Running terraform destroy or deleting these resources from the Terraform configuration should result in their removal from Fastly.

Actual Behavior

Errors:

Error: 400 - Bad Request:
Title:  Invalid value for subscriptions
Detail: This domain is linked to the following Fastly-managed TLS subscription(s): <subscription_id>. Remove the subscription(s) before deleting this domain.
Error: 400 - Bad Request:
Title:  Can't delete subscription
Detail: Subscription has active domains

Even if you try to remove them one-by-one using terraform destroy --target=fastly_tls_subscription.test and terraform destroy --target=fastly_domain_v1.test

Configuration example:

resource "fastly_domain_v1" "test" {
  fqdn       = "test.example.com"
  service_id = fastly_service_vcl.test.id
}

resource "fastly_tls_subscription" "test" {
  certificate_authority = "lets-encrypt"
  domains               = ["test.example.com"]
}

resource "fastly_service_vcl" "test" {
  name = "test"

  backend {
    name              = "fos-origin"
    address           = "eu-central.object.fastlystorage.app"
    override_host     = "eu-central.object.fastlystorage.app"
    ssl_cert_hostname = "eu-central.object.fastlystorage.app"
    ssl_sni_hostname  = "eu-central.object.fastlystorage.app"
    port              = 443
    use_ssl           = true
    ssl_check_cert    = true
  }

  force_destroy = true
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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