forked from cloudflare/terraform-provider-cloudflare
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource/cloudfare_api_token: allow empty conditions
In the initial PR for adding API token support to Terraform (cloudflare#862), an assumption was made that empty `condition` blocks would allow all traffic; this is incorrect and puts the end user in a state where no traffic is allowed. To address this, we need to conditionally build the API token based on what fields are non-zero values. This requires a bit of a rewrite as this assumption ran deep into the methods and the structure of the code itself. While this increases the test coverage, we do now have a restriction in the API itself whereby if you create an API token with IP restrictions and then wish to remove them, you cannot -- you must recreate the token. This issue is outside the scope of this work so I'll leave it as a known factor for now. Closes cloudflare#897
- Loading branch information
1 parent
999d226
commit f03b14f
Showing
2 changed files
with
159 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters