Documentation ¶
Index ¶
- Variables
- func DumpState(s *terraform.State) error
- func LoadTestCase(filename string, parameters ...interface{}) string
- func SharedClient() *cloudflare.Client
- func SharedV1Client() (*cfv1.API, error)
- func TestAccPreCheck(t *testing.T)
- func TestAccPreCheck_APIKey(t *testing.T)
- func TestAccPreCheck_APIToken(t *testing.T)
- func TestAccPreCheck_AccountID(t *testing.T)
- func TestAccPreCheck_AlternateDomain(t *testing.T)
- func TestAccPreCheck_AlternateZoneID(t *testing.T)
- func TestAccPreCheck_BYOIPPrefix(t *testing.T)
- func TestAccPreCheck_Credentials(t *testing.T)
- func TestAccPreCheck_Domain(t *testing.T)
- func TestAccPreCheck_Email(t *testing.T)
- func TestAccPreCheck_Hyperdrive(t *testing.T)
- func TestAccPreCheck_HyperdriveWithAccess(t *testing.T)
- func TestAccPreCheck_LogpushToken(t *testing.T)
- func TestAccPreCheck_Pages(t *testing.T)
- func TestAccPreCheck_WorkspaceOne(t *testing.T)
- func TestAccPreCheck_ZoneID(t *testing.T)
- func TestAccSkipForDefaultAccount(t *testing.T, reason string)
- func TestAccSkipForDefaultZone(t *testing.T, reason string)
Constants ¶
This section is empty.
Variables ¶
var ( // Integration test account ID. TestAccCloudflareAccountID string = "f037e56e89293a057740de681ac9abbe" // Integration test account zone ID. TestAccCloudflareZoneID string = "0da42c8d2132a9ddaf714f9e7c920711" // Integration test account zone name. TestAccCloudflareZoneName string = "terraform.cfapi.net" // Integration test account alternate zone ID. TestAccCloudflareAltZoneID string = "b72110c08e3382597095c29ba7e661ea" // Integration test account alternate zone name. TestAccCloudflareAltZoneName string = "terraform2.cfapi.net" )
var TestAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){ "cloudflare-extended": func() (tfprotov6.ProviderServer, error) { return providerserver.NewProtocol6(provider.New("dev")())(), nil }, }
Functions ¶
func DumpState ¶
DumpState returns the state representation of the resource for inspection inside of a `resource.TestCase`.
Example:
resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.TestAccPreCheck(t) }, ProtoV6ProviderFactories: acctest.TestAccProtoV6ProviderFactories, Steps: []resource.TestStep{ { Config: myConfig(), Check: resource.ComposeTestCheckFunc( acctest.DumpState, resource.TestCheckResourceAttr(resourceID, consts.ZoneIDSchemaKey, zoneID), ), }, }, })
Returns the resource, identifier and attributes all keyed to the value.
cloudflare_foo.bar.id = 4dd549e6d9b22cdac402b33af89d57ab cloudflare_foo.bar.other_thing = true cloudflare_foo.bar.zone_id = 0da42c8d2132a9ddaf714f9e7c920711 cloudflare_foo.bar.% = 12
func LoadTestCase ¶
LoadTestCase takes a filename and variadic parameters to build test case output.
Example: If you have a "basic" test case that for `r2_bucket` resource, inside of the `testdata` directory, you need to have a `basic.tf` file.
$ tree internal/services/r2_bucket/ ├── ... ├── schema.go └── testdata └── basic.tf
The invocation would be `LoadTestCase("basic.tf", rnd, acountID)`.
func SharedClient ¶
func SharedClient() *cloudflare.Client
SharedClient returns a common Cloudflare V2 client setup needed for the sweeper functions.
func SharedV1Client ¶
SharedV1Client returns a common Cloudflare V1 client setup needed for the sweeper functions.
func TestAccPreCheck ¶
func TestAccPreCheck_APIKey ¶
Test helper method checking `CLOUDFLARE_API_KEY` is present.
func TestAccPreCheck_APIToken ¶
Test helper method checking `CLOUDFLARE_API_TOKEN` is present.
func TestAccPreCheck_AccountID ¶
Test helper method checking `CLOUDFLARE_ACCOUNT_ID` is present.
func TestAccPreCheck_AlternateDomain ¶
Test helper method checking `CLOUDFLARE_ALT_DOMAIN` is present.
func TestAccPreCheck_AlternateZoneID ¶
Test helper method checking `CLOUDFLARE_ALT_ZONE_ID` is present.
func TestAccPreCheck_BYOIPPrefix ¶
Test helper method checking `CLOUDFLARE_BYO_IP_PREFIX_ID` is present.
func TestAccPreCheck_Domain ¶
Test helper method checking `CLOUDFLARE_DOMAIN` is present.
func TestAccPreCheck_Email ¶
Test helper method checking `CLOUDFLARE_EMAIL` is present.
func TestAccPreCheck_Hyperdrive ¶
Test helper method checking all required Hyperdrive configurations are present.
func TestAccPreCheck_LogpushToken ¶
Test helper method checking `CLOUDFLARE_LOGPUSH_OWNERSHIP_TOKEN` is present.
func TestAccPreCheck_Pages ¶
Test helper method checking the required environment variables for Cloudflare Pages are present.
func TestAccPreCheck_WorkspaceOne ¶
Test helper method checking the Workspace One environment variables are present.
func TestAccPreCheck_ZoneID ¶
Test helper method checking `CLOUDFLARE_ZONE_ID` is present.
func TestAccSkipForDefaultAccount ¶
TestAccSkipForDefaultAccount is used for skipping over tests that are not run by default on usual acceptance test suite account.
func TestAccSkipForDefaultZone ¶
TestAccSkipForDefaultZone is used for skipping over tests that are not run by default on usual acceptance test suite account.
Types ¶
This section is empty.