github.com/pmcatominey/terraform@v0.7.0-rc2.0.20160708105029-1401a52a5cc5/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 ## Authentication 35 36 The Fastly provider offers an API key based method of providing credentials for 37 authentication. The following methods are supported, in this order, and 38 explained below: 39 40 - Static API key 41 - Environment variables 42 43 44 ### Static API Key ### 45 46 Static credentials can be provided by adding a `api_key` in-line in the 47 Fastly provider block: 48 49 Usage: 50 51 ``` 52 provider "fastly" { 53 api_key = "test" 54 } 55 56 resource "fastly_service_v1" "myservice" { 57 ... 58 } 59 ``` 60 61 The API key for an account can be found on the Account page: https://app.fastly.com/#account 62 63 ###Environment variables 64 65 You can provide your API key via `FASTLY_API_KEY` environment variable, 66 representing your Fastly API key. When using this method, you may omit the 67 Fastly `provider` block entirely: 68 69 ``` 70 resource "fastly_service_v1" "myservice" { 71 ... 72 } 73 ``` 74 75 Usage: 76 77 ``` 78 $ export FASTLY_API_KEY="afastlyapikey" 79 $ terraform plan 80 ``` 81 82 ## Argument Reference 83 84 The following arguments are supported in the `provider` block: 85 86 * `api_key` - (Optional) This is the API key. It must be provided, but 87 it can also be sourced from the `FASTLY_API_KEY` environment variable