github.com/minamijoyo/terraform@v0.7.8-0.20161029001309-18b3736ba44b/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) If omitted, the `OS_AUTH_URL` environment 39 variable is used. 40 41 * `user_name` - (Optional; Required for Identity V2) If omitted, the 42 `OS_USERNAME` environment variable is used. 43 44 * `user_id` - (Optional) 45 46 * `password` - (Optional; Required if not using `api_key`) If omitted, the 47 `OS_PASSWORD` environment variable is used. 48 49 * `token` - (Optional; Required if not using `user_name` and `password`) 50 A token is an expiring, temporary means of access issued via the 51 Keystone service. By specifying a token, you do not have to 52 specify a username/password combination, since the token was 53 already created by a username/password out of band of Terraform. 54 If omitted, the `OS_AUTH_TOKEN` environment variable is used. 55 56 * `domain_id` - (Optional) If omitted, the `OS_DOMAIN_ID` environment 57 variable is used. 58 59 * `domain_name` - (Optional) If omitted, the `OS_DOMAIN_NAME` 60 environment variable is used. 61 62 * `tenant_id` - (Optional) 63 64 * `tenant_name` - (Optional) If omitted, the `OS_TENANT_NAME` environment 65 variable is used. 66 67 * `insecure` - (Optional) Explicitly allow the provider to perform 68 "insecure" SSL requests. If omitted, default value is `false` 69 70 * `cacert_file` - (Optional) Specify a custom CA certificate when communicating 71 over SSL. If omitted, the `OS_CACERT` environment variable is used. 72 73 * `cert` - (Optional) Specify client certificate file for SSL client 74 authentication. If omitted the `OS_CERT` environment variable is used. 75 76 * `key` - (Optional) Specify client private key file for SSL client 77 authentication. If omitted the `OS_KEY` environment variable is used. 78 79 * `endpoint_type` - (Optional) Specify which type of endpoint to use from the 80 service catalog. It can be set using the OS_ENDPOINT_TYPE environment 81 variable. If not set, public endpoints is used. 82 83 ## Rackspace Compatibility 84 85 Using this OpenStack provider with Rackspace is not supported and not 86 guaranteed to work; however, users have reported success with the 87 following notes in mind: 88 89 * Interacting with instances has been seen to work. Interacting with 90 all other resources is either untested or known to not work. 91 92 * Use your _password_ instead of your Rackspace API KEY. 93 94 * Explicitly define the public and private networks in your 95 instances as shown below: 96 97 ``` 98 resource "openstack_compute_instance_v2" "my_instance" { 99 name = "my_instance" 100 region = "DFW" 101 image_id = "fabe045f-43f8-4991-9e6c-5cabd617538c" 102 flavor_id = "general1-4" 103 key_pair = "provisioning_key" 104 105 network { 106 uuid = "00000000-0000-0000-0000-000000000000" 107 name = "public" 108 } 109 110 network { 111 uuid = "11111111-1111-1111-1111-111111111111" 112 name = "private" 113 } 114 } 115 ``` 116 117 If you try using this provider with Rackspace and run into bugs, you 118 are welcomed to open a bug report / issue on Github, but please keep 119 in mind that this is unsupported and the reported bug may not be 120 able to be fixed. 121 122 If you have successfully used this provider with Rackspace and can 123 add any additional comments, please let us know. 124 125 ## Testing and Development 126 127 In order to run the Acceptance Tests for development, the following environment 128 variables must also be set: 129 130 * `OS_REGION_NAME` - The region in which to create the server instance. 131 132 * `OS_IMAGE_ID` or `OS_IMAGE_NAME` - a UUID or name of an existing image in 133 Glance. 134 135 * `OS_FLAVOR_ID` or `OS_FLAVOR_NAME` - an ID or name of an existing flavor. 136 137 * `OS_POOL_NAME` - The name of a Floating IP pool. 138 139 * `OS_NETWORK_ID` - The UUID of a network in your test environment. 140 141 * `OS_EXTGW_ID` - The UUID of the external gateway. 142 143 To make development easier, the `builtin/providers/openstack/devstack/deploy.sh` 144 script will assist in installing and configuring a standardized 145 [DevStack](http://docs.openstack.org/developer/devstack/) environment along with 146 Golang, Terraform, and all development dependencies. It will also set the required 147 environment variables in the `devstack/openrc` file. 148 149 Do not run the `deploy.sh` script on your workstation or any type of production 150 server. Instead, run the script within a disposable virtual machine. 151 [Here's](https://github.com/berendt/terraform-configurations) an example of a 152 Terraform configuration that will create an OpenStack instance and then install and 153 configure DevStack inside.