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"
}nameDefines the label in Exoscale to define the keykeyThe 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"
}nameDefines 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
}
}nameSecurity Group name as it will be referenced in the instancesingressRulesOne or more rules to describe which ports will be permitted inboundcidrA network address range to reflect who would be impactedprotocolIndicate the type to look for TCP, UDP, or ICMPportFor TCP/UDP the port number of the service impactedicmptypeICMP message typeicmpcodeICMP message codeegressRulesOne or more rules to describe which ports will be permitted outboundcidrA network address range to reflect who would be impactedprotocolIndicate the type to look for TCP, UDP, or ICMPportFor TCP/UDP the port number of the service impactedicmptypeICMP message typeicmpcodeICMP 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 = ""
}nameThe compute resource hostnametemplateThe template to use for the specified resourcesizeDefines the instance configuration size:- Micro
- Tiny
- Small
- Medium
- Large
- Extra-Large
- Huge
diskSizeDefine the size of the root disk: 10GB, 50GB, 100GB, 200GB, 400GBzoneOne of the two datacenters: CH-DK-2 and CH-GVA-2keypairThe SSH key used for root access to the hostaffinitygroupsCollection of anti-affinity groups the host will belong tosecuritygroupsCollection of security groups to indicate which rules will applyuserdataFree 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"
}
}nameThe domain name to be managedrecordCollection of records to be included as a part of the namenameThe host name to define the recordtypeThe DNS entry type such as the CNAME, MX, or AcontentThe requisite component for the corresponding record name and typettlOptional time to live for the recordprioOptional 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"
}bucketThe bucket name that will be referenced in all object referencesaclPermission 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"
}bucketThe bucket the object will be contained underaclPermission type for the bucket and its contents based off the AWS S3 implementationkeyA directory/file path used to reference the object as its keytypeA mime type to indicate the type of filecontentSomething that can be injected directly into the bucket at the keysourceThe 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