Add Access application and policy support #145
Merged
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 introduces two new resources for Cloudflare Access:
cloudflare_access_application
: An Access Application that covers theURL and a friendly name.
cloudflare_access_policy
: An Access Policy that enforcesauthorisation on aforementioned Application.
Initially I considered introducing a single resource
(
cloudflare_access_application
) however running over our existingAccess configuration showed that we would end up with quite a bit of
duplication if the policy was embedded in the resource. For example:
While it looks sensible here, it gets a bit messy with multiple policies
for a single application.
(Yes, this could be collapsed into a single policy block but bear with
me for the sake of the example)
Now, I'm not totally opposed to this approach however I was swayed away
from it since there are dedicated endpoints for the Application and
Policies and I thought this may cause some confusion if I coupled them
in the Terraform provider. If others think it should be embedded though,
I'm happy to update.
In it's current form, you'd need to create the two resources to
actually have a useful implementation. Example:
Screenshots
Access Application: https://shares.jacobbednarz.com/dfs98jdsf.png
Access Policy: https://shares.jacobbednarz.com/dfgsgdwf.png
Depends on cloudflare/cloudflare-go#244
Closes #100
cc @AustinCorridor