-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #669 from devinbfergy/master
Adding Support for 4 new cloudflare_teams_* resources and additional README.md Improvements
- Loading branch information
Showing
18 changed files
with
543 additions
and
5 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -247,6 +247,10 @@ Any resources not listed are currently not supported. | |
| [cloudflare_ruleset](https://www.terraform.io/docs/providers/cloudflare/r/ruleset) | Account or Zone | ✅ | ✅ | | ||
| [cloudflare_spectrum_application](https://www.terraform.io/docs/providers/cloudflare/r/spectrum_application) | Zone | ✅ | ✅ | | ||
| [cloudflare_tiered_cache](https://www.terraform.io/docs/providers/cloudflare/r/tiered_cache) | Zone | ✅ | ❌ | | ||
| [cloudflare_teams_list](https://www.terraform.io/docs/providers/cloudflare/r/teams_list) | Account | ✅ | ✅ | | ||
| [cloudflare_teams_location](https://www.terraform.io/docs/providers/cloudflare/r/teams_location) | Account | ✅ | ✅ | | ||
| [cloudflare_teams_proxy_endpoint](https://www.terraform.io/docs/providers/cloudflare/r/teams_proxy_endpoint) | Account | ✅ | ✅ | | ||
| [cloudflare_teams_rule](https://www.terraform.io/docs/providers/cloudflare/r/teams_rule) | Account | ✅ | ✅ | | ||
| [cloudflare_tunnel](https://www.terraform.io/docs/providers/cloudflare/r/tunnel) | Account | ✅ | ✅ | | ||
| [cloudflare_turnstile_widget](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/turnstile_widget) | Account | ✅ | ✅ | | ||
| [cloudflare_url_normalization_settings](https://www.terraform.io/docs/providers/cloudflare/r/url_normalization_settings) | Zone | ✅ | ❌ | | ||
|
@@ -275,6 +279,41 @@ test. The Terraform files then allow us to build what the resource structure is | |
expected to look like and once the tool parses the API response, we can compare | ||
that to the static file. | ||
|
||
Suggested local testing steps: | ||
|
||
1. Create a file with the basic provider configuration (do not commit this file) | ||
|
||
```bash | ||
cat > main.tf <<EOF | ||
terraform { | ||
required_providers { | ||
cloudflare = { | ||
source = "cloudflare/cloudflare" | ||
version = "~> 4" | ||
} | ||
} | ||
} | ||
EOF | ||
``` | ||
|
||
2. Initialize terraform | ||
|
||
```bash | ||
terraform init | ||
``` | ||
|
||
3. Run tests (Cloudflare Install path should be path to repository) | ||
|
||
```bash | ||
make test | ||
``` | ||
|
||
If you want to run a specific test case you can do so with the TESTARGS variable and -run flag | ||
|
||
```bash | ||
TESTARGS="-run '^TestResourceGeneration/cloudflare_teams_list'" make test | ||
``` | ||
|
||
## Updating VCR cassettes | ||
|
||
Periodically, it is a good idea to recreate the VCR cassettes used in our | ||
|
@@ -289,12 +328,12 @@ will need to: | |
(`CLOUDFLARE_EMAIL`, `CLOUDFLARE_KEY`, `CLOUDFLARE_API_TOKEN`) and the test | ||
you want to update. | ||
Example of updating the DNS CAA record test with a zone I own: | ||
```bash | ||
```bash | ||
OVERWRITE_VCR_CASSETTES=true \ | ||
CLOUDFLARE_DOMAIN="terraform.cfapi.net" \ | ||
CLOUDFLARE_EMAIL="[email protected]" \ | ||
CLOUDFLARE_API_KEY="..." \ | ||
TESTARGS="-run '^TestResourceGeneration/cloudflare_record_caa'" \ | ||
make test | ||
``` | ||
``` | ||
- Commit your changes and push them via a Pull Request. |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
Content-Type: | ||
- application/json | ||
url: https://api.cloudflare.com/client/v4/accounts/f037e56e89293a057740de681ac9abbe/gateway/lists | ||
method: GET | ||
response: | ||
body: | | ||
{ | ||
"errors": [], | ||
"messages": [], | ||
"result": [ | ||
{ | ||
"count": 1, | ||
"created_at": "2014-01-01T05:20:00.12345Z", | ||
"description": "we like domains here", | ||
"id": "971fc4e8-388e-4ab9-b377-16430c0fc018", | ||
"name": "STUFF TO DO WITH DOMAINS", | ||
"type": "DOMAIN", | ||
"updated_at": "2014-01-01T05:20:00.12345Z" | ||
} | ||
], | ||
"success": true, | ||
"result_info": { | ||
"count": 1, | ||
"page": 1, | ||
"per_page": 20, | ||
"total_count": 2000 | ||
} | ||
} | ||
headers: | ||
Content-Type: | ||
- application/json | ||
Vary: | ||
- Accept-Encoding | ||
status: 200 OK | ||
code: 200 | ||
duration: "" | ||
- request: | ||
body: "" | ||
form: {} | ||
headers: | ||
Content-Type: | ||
- application/json | ||
url: https://api.cloudflare.com/client/v4/accounts/f037e56e89293a057740de681ac9abbe/gateway/lists/971fc4e8-388e-4ab9-b377-16430c0fc018/items?page=1&per_page=50 | ||
method: GET | ||
response: | ||
body: | | ||
{ | ||
"result": [ | ||
{ | ||
"value": "example.com", | ||
"created_at": "2024-01-11T22:57:26Z" | ||
} | ||
], | ||
"success": true, | ||
"errors": [], | ||
"messages": [], | ||
"result_info": { | ||
"page": 1, | ||
"per_page": 50, | ||
"count": 15, | ||
"total_count": 15, | ||
"total_pages": 1 | ||
} | ||
} | ||
headers: | ||
Content-Type: | ||
- application/json | ||
Vary: | ||
- Accept-Encoding | ||
status: 200 OK | ||
code: 200 | ||
duration: "" |
Oops, something went wrong.