fastly / Terraform Provider Fastly
Programming Languages
Projects that are alternatives of or similar to Terraform Provider Fastly
Fastly Terraform Provider
- Website: https://www.terraform.io
- Documentation: https://registry.terraform.io/providers/fastly/fastly/latest/docs
- Mailing list: http://groups.google.com/group/terraform-tool
Requirements
NOTE: the last version of the Fastly provider to support Terraform 0.11.x and below was v0.26.0
Building The Provider
Clone repository to: $GOPATH/src/github.com/fastly/terraform-provider-fastly
$ mkdir -p $GOPATH/src/github.com/fastly; cd $GOPATH/src/github.com/fastly
$ git clone [email protected]:fastly/terraform-provider-fastly
Enter the provider directory and build the provider
$ cd $GOPATH/src/github.com/fastly/terraform-provider-fastly
$ make build
Developing the Provider
If you wish to work on the provider, you'll first need Go installed on your machine (version 1.14+ is required).
To compile the provider, run make build
. This will build the provider and put the provider binary in a local bin
directory.
$ make build
...
Alongside the newly built binary a file called developer_overrides.tfrc
will be created. The make build
target will communicate
back details for setting the TF_CLI_CONFIG_FILE
environment variable that will enable Terraform to use your locally built provider binary.
- HashiCorp - Development Overrides for Provider developers.
Testing
In order to test the provider, you can simply run make test
.
$ make test
In order to run the full suite of Acceptance tests, run make testacc
.
Note: Acceptance tests create real resources, and often cost money to run. You should expect that the full acceptance test suite will take hours to run.
$ make testacc
In order to run an individual acceptance test, the '-run' flag can be used together with a regular expression. The following example uses a regular expression matching single test called 'TestAccFastlyServiceV1_basic'.
$ make testacc TESTARGS='-run=TestAccFastlyServiceV1_basic'
The following example uses a regular expression to execute a grouping of basic acceptance tests.
$ make testacc TESTARGS='-run=TestAccFastlyServiceV1_.*_basic'
In order to run the tests with extra debugging context, prefix the make
command with TF_LOG
(see the terraform documentation for details).
$ TF_LOG=trace make testacc
By default, the tests run with a parallelism of 4.
This can be reduced if some tests are failing due to network-related issues, or increased if possible, to reduce the running time of the tests.
Prefix the make
command with TEST_PARALLELISM
, as in the following example, to configure this.
$ TEST_PARALLELISM=8 make testacc
Depending on the Fastly account used, some features may not be enabled (e.g. Platform TLS).
This may result in some tests failing, potentially with 403 Unauthorised
errors, when the full test suite is being run.
Check the Fastly API documentation to confirm if the failing tests use features in Limited Availability or only available to certain customers.
If this is the case, either use the TESTARGS
regular expressions described above, or temporarily add t.SkipNow()
to the top of any tests that should be excluded.
Building The Documentation
The documentation is built from components (go templates) stored in the templates
folder.
Building the documentation copies the full markdown into the docs
folder, ready for deployment to Hashicorp.
NOTE: you'll need the
tfplugindocs
tool for generating the Markdown to be deployed to Hashicorp. For more information on generating documentation, refer to https://www.terraform.io/docs/registry/providers/docs.html
- To validate the
/template
directory structure:
make validate-docs
- To build the
/docs
documentation Markdown files:
make generate-docs
- To view the documentation:
Paste
/docs
Markdown file content into https://registry.terraform.io/tools/doc-preview
Contributing
Refer to CONTRIBUTING.md