feat: allow custom domains to be associated with a deployment #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds a new attribute
domain_ids
todeno_deployment
resource.This attribute is optional. So only when it's present, the resource will make an API call to associate the domain(s) with the deployment.
Also, when a resource is deleted, it will disassociate the domain(s) from the deployment, although the deployment itself will remain untouched since it's immutable.
Closes #12
Initially I thought I would create a new resource like
deno_domain_deployment_association
that manages the association between domain and deployment, but decided not to do that, because this interface might bring a misunderstanding that we can do N to N mapping between deployments and domains; in fact one deployment can have multiple custom domains, but the opposite is not allowed.To avoid this confusion,
deno_deployment
resource can take a list of domain IDs, which clearly reflects the fact that one deployment can have multiple custom domains.One thing that may be concerning is that the domain doesn't get disassociated from the deployment in the scenario like:
deno_deployment
resource, with a custom domain applied (1stterraform apply
here)domain_ids
attribute in the config file (2ndterraform apply
here)In order to address this issue we probably would like to get "get_deployment" API to return the domain IDs associated with the deployment, so that we can figure out what domains are deleted from the config.