These are Terraform examples to use with OpenStack on the pluscloud open - the data sovereign open source cloud offered by plusserver. They should run on any OpenStack with small adjustments.
Take a look at the image names and instance flavors. They should be available on any SCS compliant CSP, but everywhere else they will likely differ.
They don't claim to be perfect, but they are intended to serve as a good starting point. And you're welcome to provide feedback by opening an issue here on github.
Get a current version of terraform, see developer documention at Hashicorp.
The examples have been tested with version terraform v1.4.6 and openstack provider v1.51.1.
Download your credentials (clouds.yaml) via Horizon and add your password as secure.yaml in your working directory (or in your $HOME/.config/openstack).
You can find documentation on using clouds.yaml on docs.openstack.org.
Example for a project on prod1.
clouds:
openstack:
auth:
auth_url: https://prod1.api.pco.get-cloud.io:5000
username: "u123456-default"
project_id: 980c0d0dcb874244a54a6c149fa6d389
project_name: "p123456-my-project"
user_domain_name: "d123456"
region_name: "prod1"
interface: "public"
identity_api_version: 3
It can be downloaded in the Horizon UI under Project / API Access
or via this link on prod1 for example.
The default "cloud" name is openstack. You can rename it - matching project or CSP and add multiple entries.
To use it with the openstack provider for Terraform you can define it in your Terraform file like your main.tf:
provider "openstack" {
cloud = "pluscloudopen" # cloud defined in cloud.yml file
}
or via environment variable OS_CLOUD.
$ export OS_CLOUD="openstack"
just as you like.
Here is a list of our examples:
- just-one-instance - will spawn a single instance in your project without any extras
- instance-using-cloud-init - will spawn an instance with cloud-init deploying a nginx plus security group needed
- loadbalancer_webservice - will spawn n instances with nginx and a http loadbalancer
You can find additional documentation here: