2014-12-10 22:20:52 +01:00
---
layout: "cloudstack"
page_title: "Provider: CloudStack"
sidebar_current: "docs-cloudstack-index"
description: |-
2015-01-03 19:31:53 +01:00
The CloudStack provider is used to interact with the many resources supported by CloudStack. The provider needs to be configured with a URL pointing to a running CloudStack API and the proper credentials before it can be used.
2014-12-10 22:20:52 +01:00
---
# CloudStack Provider
The CloudStack provider is used to interact with the many resources
supported by CloudStack. The provider needs to be configured with a
2015-01-03 19:31:53 +01:00
URL pointing to a running CloudStack API and the proper credentials
2014-12-10 22:20:52 +01:00
before it can be used.
2017-05-26 17:58:10 +02:00
In order to provide the required configuration options you can either
supply values for the `api_url` , `api_key` and `secret_key` fields, or
for the `config` and `profile` fields. A combination of both is not
allowed and will not work.
2014-12-10 22:20:52 +01:00
Use the navigation to the left to read about the available resources.
## Example Usage
2017-04-10 18:15:08 +02:00
```hcl
2014-12-10 22:20:52 +01:00
# Configure the CloudStack Provider
provider "cloudstack" {
2017-02-18 23:48:50 +01:00
api_url = "${var.cloudstack_api_url}"
api_key = "${var.cloudstack_api_key}"
secret_key = "${var.cloudstack_secret_key}"
2014-12-10 22:20:52 +01:00
}
# Create a web server
resource "cloudstack_instance" "web" {
2017-02-18 23:48:50 +01:00
# ...
2014-12-10 22:20:52 +01:00
}
```
## Argument Reference
The following arguments are supported:
2017-05-26 17:58:10 +02:00
* `api_url` - (Optional) This is the CloudStack API URL. It can also be sourced
from the `CLOUDSTACK_API_URL` environment variable.
* `api_key` - (Optional) This is the CloudStack API key. It can also be sourced
from the `CLOUDSTACK_API_KEY` environment variable.
* `secret_key` - (Optional) This is the CloudStack secret key. It can also be
sourced from the `CLOUDSTACK_SECRET_KEY` environment variable.
2014-12-10 22:20:52 +01:00
2017-05-26 17:58:10 +02:00
* `config` - (Optional) The path to a `CloudMonkey` config file. If set the API
URL, key and secret will be retrieved from this file.
2014-12-10 22:20:52 +01:00
2017-05-26 17:58:10 +02:00
* `profile` - (Optional) Used together with the `config` option. Specifies which
`CloudMonkey` profile in the config file to use.
2015-06-03 12:40:53 +02:00
2015-07-16 17:40:04 +02:00
* `http_get_only` - (Optional) Some cloud providers only allow HTTP GET calls to
their CloudStack API. If using such a provider, you need to set this to `true`
in order for the provider to only make GET calls and no POST calls. It can also
be sourced from the `CLOUDSTACK_HTTP_GET_ONLY` environment variable.
* `timeout` - (Optional) A value in seconds. This is the time allowed for Cloudstack
2015-06-03 12:40:53 +02:00
to complete each asynchronous job triggered. If unset, this can be sourced from the
2015-07-16 17:40:04 +02:00
`CLOUDSTACK_TIMEOUT` environment variable. Otherwise, this will default to 300
2015-06-03 12:40:53 +02:00
seconds.