Terraform Version
Terraform v0.12.6
+ provider.fastly v0.8.1
Affected Resource(s)
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
- Create a new service manually in Fastly
- Add a single domain and nothing else
- Import this service into your local terraform state for the above HCL
- 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.

-
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
Terraform Version
Affected Resource(s)
Terraform Configuration Files
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 1Steps to Reproduce
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.

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