github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/website/source/docs/providers/fastly/index.html.markdown (about) 1 --- 2 layout: "fastly" 3 page_title: "Provider: Fastly" 4 sidebar_current: "docs-fastly-index" 5 description: |- 6 Fastly 7 --- 8 9 # Fastly Provider 10 11 The Fastly provider is used to interact with the content delivery network (CDN) 12 provided by Fastly. 13 14 In order to use this Provider, you must have an active account with Fastly. 15 Pricing and signup information can be found at https://www.fastly.com/signup 16 17 Use the navigation to the left to read about the available resources. 18 19 ## Example Usage 20 21 ``` 22 # Configure the Fastly Provider 23 provider "fastly" { 24 api_key = "test" 25 } 26 27 # Create a Service 28 resource "fastly_service_v1" "myservice" { 29 name = "myawesometestservice" 30 31 # ... 32 } 33 ``` 34 35 ## Authentication 36 37 The Fastly provider offers an API key based method of providing credentials for 38 authentication. The following methods are supported, in this order, and 39 explained below: 40 41 - Static API key 42 - Environment variables 43 44 45 ### Static API Key ### 46 47 Static credentials can be provided by adding a `api_key` in-line in the 48 Fastly provider block: 49 50 Usage: 51 52 ``` 53 provider "fastly" { 54 api_key = "test" 55 } 56 57 resource "fastly_service_v1" "myservice" { 58 # ... 59 } 60 ``` 61 62 The API key for an account can be found on the Account page: https://app.fastly.com/#account 63 64 ###Environment variables 65 66 You can provide your API key via `FASTLY_API_KEY` environment variable, 67 representing your Fastly API key. When using this method, you may omit the 68 Fastly `provider` block entirely: 69 70 ``` 71 resource "fastly_service_v1" "myservice" { 72 # ... 73 } 74 ``` 75 76 Usage: 77 78 ``` 79 $ export FASTLY_API_KEY="afastlyapikey" 80 $ terraform plan 81 ``` 82 83 ## Argument Reference 84 85 The following arguments are supported in the `provider` block: 86 87 * `api_key` - (Optional) This is the API key. It must be provided, but 88 it can also be sourced from the `FASTLY_API_KEY` environment variable