github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/website/source/docs/providers/openstack/index.html.markdown (about) 1 --- 2 layout: "openstack" 3 page_title: "Provider: OpenStack" 4 sidebar_current: "docs-openstack-index" 5 description: |- 6 The OpenStack provider is used to interact with the many resources supported by OpenStack. The provider needs to be configured with the proper credentials before it can be used. 7 --- 8 9 # OpenStack Provider 10 11 The OpenStack provider is used to interact with the 12 many resources supported by OpenStack. The provider needs to be configured 13 with the proper credentials before it can be used. 14 15 Use the navigation to the left to read about the available resources. 16 17 ## Example Usage 18 19 ``` 20 # Configure the OpenStack Provider 21 provider "openstack" { 22 user_name = "admin" 23 tenant_name = "admin" 24 password = "pwd" 25 auth_url = "http://myauthurl:5000/v2.0" 26 } 27 28 # Create a web server 29 resource "openstack_compute_instance_v2" "test-server" { 30 # ... 31 } 32 ``` 33 34 ## Configuration Reference 35 36 The following arguments are supported: 37 38 * `auth_url` - (Required) The Identity authentication URL. If omitted, the 39 `OS_AUTH_URL` environment variable is used. 40 41 * `user_name` - (Optional) The Username to login with. If omitted, the 42 `OS_USERNAME` environment variable is used. 43 44 * `user_id` - (Optional) The User ID to login with. If omitted, the 45 `OS_USER_ID` environment variable is used. 46 47 * `tenant_id` - (Optional) The ID of the Tenant (Identity v2) or Project 48 (Identity v3) to login with. If omitted, the `OS_TENANT_ID` or 49 `OS_PROJECT_ID` environment variables are used. 50 51 * `tenant_name` - (Optional) The Name of the Tenant (Identity v2) or Project 52 (Identity v3) to login with. If omitted, the `OS_TENANT_NAME` or 53 `OS_PROJECT_NAME` environment variable are used. 54 55 * `password` - (Optional) The Password to login with. If omitted, the 56 `OS_PASSWORD` environment variable is used. 57 58 * `token` - (Optional; Required if not using `user_name` and `password`) 59 A token is an expiring, temporary means of access issued via the Keystone 60 service. By specifying a token, you do not have to specify a username/password 61 combination, since the token was already created by a username/password out of 62 band of Terraform. If omitted, the `OS_AUTH_TOKEN` environment variable is used. 63 64 * `domain_id` - (Optional) The ID of the Domain to scope to (Identity v3). If 65 If omitted, the following environment variables are checked (in this order): 66 `OS_USER_DOMAIN_ID`, `OS_PROJECT_DOMAIN_ID`, `OS_DOMAIN_ID`. 67 68 * `domain_name` - (Optional) The Name of the Domain to scope to (Identity v3). 69 If omitted, the following environment variables are checked (in this order): 70 `OS_USER_DOMAIN_NAME`, `OS_PROJECT_DOMAIN_NAME`, `OS_DOMAIN_NAME`, 71 `DEFAULT_DOMAIN`. 72 73 * `insecure` - (Optional) Trust self-signed SSL certificates. If omitted, the 74 `OS_INSECURE` environment variable is used. 75 76 * `cacert_file` - (Optional) Specify a custom CA certificate when communicating 77 over SSL. You can specify either a path to the file or the contents of the 78 certificate. If omitted, the `OS_CACERT` environment variable is used. 79 80 * `cert` - (Optional) Specify client certificate file for SSL client 81 authentication. You can specify either a path to the file or the contents of 82 the certificate. If omitted the `OS_CERT` environment variable is used. 83 84 * `key` - (Optional) Specify client private key file for SSL client 85 authentication. You can specify either a path to the file or the contents of 86 the key. If omitted the `OS_KEY` environment variable is used. 87 88 * `endpoint_type` - (Optional) Specify which type of endpoint to use from the 89 service catalog. It can be set using the OS_ENDPOINT_TYPE environment 90 variable. If not set, public endpoints is used. 91 92 * `swauth` - (Optional) Set to `true` to authenticate against Swauth, a 93 Swift-native authentication system. If omitted, the `OS_SWAUTH` environment 94 variable is used. You must also set `username` to the Swauth/Swift username 95 such as `username:project`. Set the `password` to the Swauth/Swift key. 96 Finally, set `auth_url` as the location of the Swift service. Note that this 97 will only work when used with the OpenStack Object Storage resources. 98 99 ## Additional Logging 100 101 This provider has the ability to log all HTTP requests and responses between 102 Terraform and the OpenStack cloud which is useful for troubleshooting and 103 debugging. 104 105 To enable these logs, set the `OS_DEBUG` environment variable to `1` along 106 with the usual `TF_LOG=DEBUG` environment variable: 107 108 ```shell 109 $ OS_DEBUG=1 TF_LOG=DEBUG terraform apply 110 ``` 111 112 If you submit these logs with a bug report, please ensure any sensitive 113 information has been scrubbed first! 114 115 ## Rackspace Compatibility 116 117 Using this OpenStack provider with Rackspace is not supported and not 118 guaranteed to work; however, users have reported success with the 119 following notes in mind: 120 121 * Interacting with instances has been seen to work. Interacting with 122 all other resources is either untested or known to not work. 123 124 * Use your _password_ instead of your Rackspace API KEY. 125 126 * Explicitly define the public and private networks in your 127 instances as shown below: 128 129 ``` 130 resource "openstack_compute_instance_v2" "my_instance" { 131 name = "my_instance" 132 region = "DFW" 133 image_id = "fabe045f-43f8-4991-9e6c-5cabd617538c" 134 flavor_id = "general1-4" 135 key_pair = "provisioning_key" 136 137 network { 138 uuid = "00000000-0000-0000-0000-000000000000" 139 name = "public" 140 } 141 142 network { 143 uuid = "11111111-1111-1111-1111-111111111111" 144 name = "private" 145 } 146 } 147 ``` 148 149 If you try using this provider with Rackspace and run into bugs, you 150 are welcomed to open a bug report / issue on Github, but please keep 151 in mind that this is unsupported and the reported bug may not be 152 able to be fixed. 153 154 If you have successfully used this provider with Rackspace and can 155 add any additional comments, please let us know. 156 157 ## Testing and Development 158 159 In order to run the Acceptance Tests for development, the following environment 160 variables must also be set: 161 162 * `OS_REGION_NAME` - The region in which to create the server instance. 163 164 * `OS_IMAGE_ID` or `OS_IMAGE_NAME` - a UUID or name of an existing image in 165 Glance. 166 167 * `OS_FLAVOR_ID` or `OS_FLAVOR_NAME` - an ID or name of an existing flavor. 168 169 * `OS_POOL_NAME` - The name of a Floating IP pool. 170 171 * `OS_NETWORK_ID` - The UUID of a network in your test environment. 172 173 * `OS_EXTGW_ID` - The UUID of the external gateway. 174 175 You should be able to use any OpenStack environment to develop on as long as the 176 above environment variables are set. 177 178 Most of Terraform's OpenStack support is done in a standardized Packstack 179 all-in-one environment. You can find the scripts to build this environment 180 [here](https://github.com/jtopjian/terraform-devstack/tree/master/packstack-standard). 181 The included `main.tf` file will need to be modified for your specific 182 environment. Once it's up and running, you will have access to a standard, 183 up-to-date OpenStack environment with the latest OpenStack services. 184 185 If you require access to deprecated services, such as Keystone v2 and 186 LBaaS v1, you can use the "legacy" environment 187 [here](https://github.com/jtopjian/terraform-devstack/tree/master/packstack-legacy).