Set GOPATH
to this directory, and then run make
Ensure that the PATH is set to include the resulting bin directory, and then you can run the terraform command that will produce the exoscale plugin.
Once built, you can install the terraform-provider-exoscale plugin by copying the resulting binary file into the location where the remaining Terraform program and plugins reside.
What follows below is the usage instructions for fully utilizing the Exoscale resource plugin. Additional documentation can be found in the examples directory.
provider "exoscale" {
token = ""
secret = ""
}
You are required to provide at least the OAuth API token and secret key in order to make use of the remaining Terraform resources.
You can specify the environment variables for these using EXOSCALE_API_SECRET
or EXOSCALE_API_KEY
. You can also use the cloudstack environment variables
CLOUDSTACK_(API|SECRET)_KEY
.
Declare an ssh key that will be used for any current/future instances
resource "exoscale_ssh" "keylabel" {
name = "keyname"
key = "keycontents"
}
name
Defines the label in Exoscale to define the keykey
The ssh public key that will be copied into instances declared
Define an affinity group that can be used to group various instances together
resource "exoscale_affinity" "affinitylabel" {
name = "affinity name"
}
name
Defines the affinity label that will be used by other declared instances
Provide a named grouping of firewall rules that would be applicable for each instance.
resource "exoscale_securitygroup" "sglabel" {
name = "sgname"
ingressRules = {
cidr = "0.0.0.0/0"
protocol = "TCP"
port = 22
}
egressRules = {
cider = "192.168.1.0/24"
protocol = "TCP"
port = 22
}
egressRules = {
cidr = "192.168.1.0/24"
protocol = "ICMP"
icmptype = 0
icmpcode = 0
}
}
name
Security Group name as it will be referenced in the instancesingressRules
One or more rules to describe which ports will be permitted inboundcidr
A network address range to reflect who would be impactedprotocol
Indicate the type to look for TCP, UDP, or ICMPport
For TCP/UDP the port number of the service impactedicmptype
ICMP message typeicmpcode
ICMP message codeegressRules
One or more rules to describe which ports will be permitted outboundcidr
A network address range to reflect who would be impactedprotocol
Indicate the type to look for TCP, UDP, or ICMPport
For TCP/UDP the port number of the service impactedicmptype
ICMP message typeicmpcode
ICMP message code
Define a new compute resource.
resource "exoscale_compute" "computelabel" {
name = "testname"
template = "ubuntu-16.04"
zone = "ch-gva-2"
size = "Micro"
diskSize = 10
keypair = "terraformKey"
affinitygroups = ["terraformag"]
securitygroups = ["sshgroup"]
userdata = ""
}
name
The compute resource hostnametemplate
The template to use for the specified resourcesize
Defines the instance configuration size:- Micro
- Tiny
- Small
- Medium
- Large
- Extra-Large
- Huge
diskSize
Define the size of the root disk: 10GB, 50GB, 100GB, 200GB, 400GBzone
One of the two datacenters: CH-DK-2 and CH-GVA-2keypair
The SSH key used for root access to the hostaffinitygroups
Collection of anti-affinity groups the host will belong tosecuritygroups
Collection of security groups to indicate which rules will applyuserdata
Free form statements used for configuring the instance
If the user has an active DNS subscription with Exoscale, allow them the ability to manage their DNS information.
resource "exoscale_dns" "testdomain" {
name = "testdomain.ch"
record = {
name = "test1"
type = "A"
content = "192.168.1.1"
}
record = {
name = "test2"
type = "CNAME"
content = "test1"
}
}
name
The domain name to be managedrecord
Collection of records to be included as a part of the namename
The host name to define the recordtype
The DNS entry type such as the CNAME, MX, or Acontent
The requisite component for the corresponding record name and typettl
Optional time to live for the recordprio
Optional record priority
There are two resources that define the S3 interaction: buckets for the creation/management of the bucket name, and objects for the contents of said buckets.
resource "exoscale_s3bucket" "testbucket" {
bucket = "tftest"
acl = "private"
}
bucket
The bucket name that will be referenced in all object referencesacl
Permission type for the bucket and its contents based off the AWS S3 implementation
resource "exoscale_s3object" "testobj" {
bucket = "tftest"
acl = "private"
key "test/path.txt"
type = "text/plain"
content = "hello world"
}
resource "exoscale_s3object" "testobj" {
bucket = "tftest"
acl = "private"
key "test/path2.txt"
type = "text/plain"
source = "/tmp/test.txt"
}
bucket
The bucket the object will be contained underacl
Permission type for the bucket and its contents based off the AWS S3 implementationkey
A directory/file path used to reference the object as its keytype
A mime type to indicate the type of filecontent
Something that can be injected directly into the bucket at the keysource
The path to a file that will be uploaded into the bucket at the key
While content and source are mutually exclusive, one of them is required for the operation to succeed.
- Support single port declaration as well as starting/ending port ranges
- Due to the AWS library in use, CORS is not supported
- Due to the AWS library in use, per-object K/V pairs are not supported