You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Go](https://golang.org/doc/install) 1.16+ (to build the provider plugin)
9
9
10
-
Building The Provider
11
-
---------------------
10
+
Using the Provider from Terrafrom registry
11
+
------------------------------------------
12
+
To install the CloudStack provider, copy and paste the below code into your Terraform configuration. Then, run terraform init.
13
+
```sh
14
+
terraform {
15
+
required_providers {
16
+
cloudstack = {
17
+
source = "cloudstack/cloudstack"
18
+
version = "0.4.0"
19
+
}
20
+
}
21
+
}
22
+
23
+
provider "cloudstack" {
24
+
# Configuration options
25
+
}
26
+
```
27
+
For more details on how to install and use the provider, visit https://registry.terraform.io/providers/cloudstack/cloudstack/latest/docs
28
+
29
+
Developing the Provider
30
+
---------------------------
31
+
32
+
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.16+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.
12
33
13
34
Clone repository to: `$GOPATH/src/github.com/apache/cloudstack-terraform-provider`
14
35
@@ -17,25 +38,19 @@ $ mkdir -p $GOPATH/src/github.com/apache; cd $GOPATH/src/github.com/apache
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.8+ is *required*). You'll also need to correctly setup a [GOPATH](http://golang.org/doc/code.html#GOPATH), as well as adding `$GOPATH/bin` to your `$PATH`.
31
-
32
-
To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
33
-
50
+
Once the build is ready, you have to copy the binary into Terraform locally (version appended).
51
+
On Linux this path is at ~/.terraform.d/plugins, and on Windows at %APPDATA%\terraform.d\plugins.
34
52
```sh
35
-
$ make bin
36
-
...
37
-
$ $GOPATH/bin/cloudstack-terraform-provider
38
-
...
53
+
$ ls ~/.terraform.d/plugins/registry.terraform.io/cloudstack/cloudstack/0.4.0/linux_amd64/terraform-provider-cloudstack_v0.4.0
39
54
```
40
55
41
56
Testing the Provider
@@ -50,8 +65,8 @@ $ make test
50
65
In order to run the full suite of Acceptance tests you will need to run the CloudStack Simulator. Please follow these steps to prepare an environment for running the Acceptance tests:
51
66
52
67
```sh
53
-
$ docker pull svanharmelen/simulator:4.12.0.0
54
-
$ docker run -d -p 8080:8080 --name cloudstack svanharmelen/simulator:4.12.0.0
68
+
$ docker pull cloudstack/simulator
69
+
$ docker run --name simulator -p 8080:5050 -d cloudstack/simulator
55
70
```
56
71
57
72
When Docker started the container you can go to http://localhost:8080/client and login to the CloudStack UI as user `admin` with password `password`. It can take a few minutes for the container is fully ready, so you probably need to wait and refresh the page for a few minutes before the login page is shown.
@@ -76,6 +91,36 @@ In order for all the tests to pass, you will need to create a new (empty) projec
76
91
$ make testacc
77
92
```
78
93
94
+
Sample Terraform configuration
95
+
------------------------------
96
+
Below is an example configuration to initialize provider and create a Virtual Machine instance
0 commit comments