https://github.com/orange-cloudfoundry/terraform-provider-cloudstack
Hard fork of hashicorp/terraform-provider-cloudstack as it is archived
https://github.com/orange-cloudfoundry/terraform-provider-cloudstack
Last synced: over 1 year ago
JSON representation
Hard fork of hashicorp/terraform-provider-cloudstack as it is archived
- Host: GitHub
- URL: https://github.com/orange-cloudfoundry/terraform-provider-cloudstack
- Owner: orange-cloudfoundry
- Created: 2021-06-09T09:22:57.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-23T16:24:18.000Z (almost 2 years ago)
- Last Synced: 2024-08-23T18:28:12.141Z (almost 2 years ago)
- Language: Go
- Size: 21.1 MB
- Stars: 3
- Watchers: 8
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Support: .github/SUPPORT.md
Awesome Lists containing this project
README
** :warning: THIS is a hard fork and a temporary home of https://github.com/hashicorp/terraform-provider-cloudstack because this repo is considered as archived by hashicorp, you will find new provider supported by apache cloudstack on https://github.com/apache/cloudstack-terraform-provider when it will be ready :warning: **
Terraform Provider
==================
- Website: https://www.terraform.io
- [](https://gitter.im/hashicorp-terraform/Lobby)
- Mailing list: [Google Groups](http://groups.google.com/group/terraform-tool)

Requirements
------------
- [Terraform](https://www.terraform.io/downloads.html) >= 0.13
- [Go](https://golang.org/doc/install) 1.16 (to build the provider plugin)
## Installations
**Requirements:** You need, of course, terraform (**>=0.13**) which is available here: https://www.terraform.io/downloads.html
Add to your terraform file:
```hcl
terraform {
required_providers {
cfsecurity = {
source = "orange-cloudfoundry/cloudstack"
version = "latest"
}
}
}
```
## Documentation
You can find documentation at https://registry.terraform.io/providers/orange-cloudfoundry/cloudstack/latest/docs
Building The Provider
---------------------
Clone repository to: `$GOPATH/src/github.com/terraform-providers/terraform-provider-cloudstack`
```sh
$ mkdir -p $GOPATH/src/github.com/terraform-providers; cd $GOPATH/src/github.com/terraform-providers
$ git clone git@github.com:terraform-providers/terraform-provider-cloudstack
```
Enter the provider directory and build the provider
```sh
$ cd $GOPATH/src/github.com/terraform-providers/terraform-provider-cloudstack
$ make build
```
Developing the Provider
---------------------------
If you wish to work on the provider, you'll first need [Go](http://www.golang.org) installed on your machine (version 1.14+ 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`.
To compile the provider, run `make build`. This will build the provider and put the provider binary in the `$GOPATH/bin` directory.
```sh
$ make bin
...
$ $GOPATH/bin/terraform-provider-cloudstack
...
```
Testing the Provider
--------------------
In order to test the provider, you can simply run `make test`.
```sh
$ make test
```
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:
```sh
$ docker pull svanharmelen/simulator:4.12.0.0
$ docker run -d -p 8080:8080 --name cloudstack svanharmelen/simulator:4.12.0.0
```
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.
Once the login page is shown and you can login, you need to provision a simulated data-center:
```sh
$ docker exec -ti cloudstack python /root/tools/marvin/marvin/deployDataCenter.py -i /root/setup/dev/advanced.cfg
```
If you refresh the client or login again, you will now get passed the initial welcome screen and be able to go to your account details and retrieve the API key and secret. Export those together with the URL:
```sh
$ export CLOUDSTACK_API_URL=http://localhost:8080/client/api
$ export CLOUDSTACK_API_KEY=r_gszj7e0ttr_C6CP5QU_1IV82EIOtK4o_K9i_AltVztfO68wpXihKs2Tms6tCMDY4HDmbqHc-DtTamG5x112w
$ export CLOUDSTACK_SECRET_KEY=tsfMDShFe94f4JkJfEh6_tZZ--w5jqEW7vGL2tkZGQgcdbnxNoq9fRmwAtU5MEGGXOrDlNA6tfvGK14fk_MB6w
```
In order for all the tests to pass, you will need to create a new (empty) project in the UI called `terraform`. When the project is created you can run the Acceptance tests against the CloudStack Simulator by simply runnning:
```sh
$ make testacc
```