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

Error when planning against an imported existing resource: insufficient items for attribute "domain" #183

Closed
goodspark opened this issue Aug 1, 2019 · 7 comments

Comments

@goodspark
Copy link

goodspark commented Aug 1, 2019

Terraform Version

Terraform v0.12.6
+ provider.fastly v0.8.1

Affected Resource(s)

  • fastly_service_v1

Terraform Configuration Files

provider "fastly" {
  # I have the API key in my env vars
}

resource "fastly_service_v1" "spark_test" {
  name = "spark-test.xxxx.com"

  domain {
    name    = "spark-test.xxxx.com"
    comment = "spark testing"
  }
}

Debug Output

https://gist.github.com/goodspark/d24547bfc067823c5d63f71cf53664a9

Expected Behavior

A plan output with no changes.

Actual Behavior

Error message: insufficient items for attribute "domain"; must have at least 1

Steps to Reproduce

  1. Create a new service manually in Fastly
  2. Add a single domain and nothing else
  3. Import this service into your local terraform state for the above HCL
  4. Run 'terraform plan'

Important Factoids

  • Here's a screenshot of my Fastly service config. It's very minimal - I just wanted to first verify I could import an existing service.
    Screenshot from 2019-08-01 16-34-11

  • If I remove the existing service from my local state and run plan, it's successful.

  • But what I want to do here is import an existing service and start managing it in Terraform

@jlav1n
Copy link
Contributor

jlav1n commented Aug 26, 2019

For the record, I do not see this with:

Terraform v0.11.7
+ provider.fastly v0.8.1

@ikbenale
Copy link

This is possibly related to hashicorp/terraform-provider-aws#9048 and therefore possibly addressed by hashicorp/terraform#22478

@jlav1n
Copy link
Contributor

jlav1n commented Sep 3, 2019

Hmm, using Terraform v.0.12.7 I have the same issue as the original poster. (edit: also with 0.12.9 -- but yeah, the Fastly provider would need to vendor, as currently on 0.12.3)

@ikbenale
Copy link

ikbenale commented Sep 5, 2019

I think hashicorp/terraform#22478 will go into v0.12.8 but either way, terraform-provider-fastly may have to vendor?

@marcpalm
Copy link

The requirements state Terraform 0.10.x. Is it working with 0.12.*?

@jlav1n
Copy link
Contributor

jlav1n commented Oct 15, 2019

This is fixed for me using Fastly provider version 0.11.0

@smaeda-ks
Copy link
Contributor

It looks like this was resolved a while ago. I'm going to close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants