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

Insufficient fastly_tls_subscription validation (400 Bad Request "Must provide TLS configuration relationship") #912

Open
nightpool opened this issue Jan 8, 2025 · 0 comments

Comments

@nightpool
Copy link

nightpool commented Jan 8, 2025

Terraform Version

% terraform -v
Terraform v1.10.2
on darwin_arm64

Affected Fastly Terraform Resource(s)

Please list the affected resources, for example:

  • fastly_tls_subscription

Terraform Configuration Files

resource "fastly_tls_subscription" "tls" {
  domains               = nonsensitive(var.service.domain[*].name)
  certificate_authority = "lets-encrypt"
}

Expected Behavior

I should have been aware at the planning stage that the resource required a configuration_id.

Actual Behavior

configuration_id was marked as optional, so there was no way for me to tell that it was required by the API

https://gist.github.com/nightpool/98410f3fcfe4cc27d0c0f5fd8441846a

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids (optional)

It does not appear that we have a default TLS config set for our account:

% fastly tls-config list                                                         
NAME          ID                      BULK  DEFAULT  TLS PROTOCOLS  HTTP PROTOCOLS   DNS RECORDS
<redacted>    CbByLy3Rad5QJge6H7fKKA  false  false     1.0, 1.1, 1.2   http/1.1, http/2  
<redacted>    SHcxcEMSAPhBvrgIrAe3uA  false  false     1.2             http/1.1, http/2  

The provider should be able to detect this and enforce a TLS configuration at plan time.

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

1 participant