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

Managed TLS Subscriptions Resources #365

Merged
merged 13 commits into from
Feb 18, 2021
Merged

Conversation

bengesoff
Copy link
Contributor

2 new resources:

  • fastly_tls_subscription
  • fastly_tls_subscription_validation

3 new data sources:

  • fastly_tls_domain
  • fastly_tls_subscription
  • fastly_tls_subscription_ids

This PR depends on #364.

Does not include support for PATCH endpoint yet, will add in a separate PR.

* Tweak test function name TLs -> TLS

* Add Fastly TLS Subscription resource

* Add create, read, and delete functions to TLS subscription

* Add TLS subscription test sweeper

* Add more attributes to TLS subscription resource and add test checks

* Add TLS Subscription Import

* PR feedback fixes

* TLS Subscription resource docs

* Update go-fastly reference

* Update go-fastly reference to merged PR

Delete TLS activations in TLS Subscription Delete function

The subscription silently creates an activation when it reaches "issued" state. This prevents the subscription from being deleted directly, as it complains about the subscription having "enabled TLS domains". To prevent this, before deleting the subscription, I have added a query to find all TLS activations on the TLS domain associated with the subscription and delete those first. In testing, this allowed deletion of the subscription even after the domain validation succeeded.
…iption

It seemed like the recommended/most common option so making it a separate Map object, with no filtering/looping required, made the most sense for ease of use. Leaving the other options in a set allows the user to specify their own filters in line with their requirements.
Previously was always effectively "force destroying" by unconditionally
deleting all associated TLS activations. I have been introduced to the
"force" flag in the API which is a more elegant way to do the same
thing. Having added that to the go-fastly SDK, I am taking advantage of
that here, and also making it optional behaviour so that the user has to
choose to take the risk of disabling production traffic.
Needed to pass provider validation checks. Will be removed when PATCH
endpoint used as there will be an Update function and it'll be happy.
@bengesoff bengesoff marked this pull request as ready for review February 17, 2021 11:34
Copy link
Collaborator

@Integralist Integralist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bengesoff Thanks for the PR! Just a couple of minor comments/questions. Otherwise approved.

docs/resources/tls_subscription.md Outdated Show resolved Hide resolved
docs/resources/tls_subscription.md Outdated Show resolved Hide resolved
docs/resources/tls_subscription.md Outdated Show resolved Hide resolved
fastly/resource_fastly_tls_subscription.go Show resolved Hide resolved
docs/resources/tls_subscription_validation.md Outdated Show resolved Hide resolved
fastly/data_source_fastly_tls_domain.go Outdated Show resolved Hide resolved
fastly/data_source_fastly_tls_domain.go Outdated Show resolved Hide resolved
fastly/data_source_fastly_tls_domain.go Outdated Show resolved Hide resolved
@Integralist Integralist added the enhancement New feature or request label Feb 18, 2021
@Integralist Integralist merged commit 2b5be77 into fastly:master Feb 18, 2021
@trentrosenbaum trentrosenbaum deleted the tls-managed branch March 15, 2021 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants