Bastion API for Terraform¶
Bastion API documentation for Terraform.
Modules¶
-
GET
/terraform/repositories
¶ Get the list of Terraform repositories.
Response JSON Object: - repositories[key].url (string) – A URL fetchable with go-getter. (https://github.com/hashicorp/go-getter)
Example response:
{ "repositories": { "cluster": { "url": "file:///C:/genvid/gv-version/bastion-services/terraform/modules/cluster" }, "game": { "url": "file:///C:/genvid/gv-version/bastion-services/terraform/modules/game" }, "genvid": { "url": "file:///C:/genvid/gv-version/bastion-services/terraform/modules/genvid" } } }
-
PUT
/terraform/repositories
¶ Update all the Terraform repositories.
-
GET
/terraform/repository/{repositoryID}
¶ Get the body of a Terraform repository.
Parameters: - repositoryID – The name of a Terraform repository. Must be a valid folder name using only lowercase letters.
Request JSON Object: - url (string) – A URL fetchable with go-getter. (https://github.com/hashicorp/go-getter)
Response JSON Object: - repository.url (string) – A URL fetchable with go-getter. (https://github.com/hashicorp/go-getter)
Example query:
{ "url": "" }
Example response:
{ "repository": { "url": "file:///C:/genvid/gv-version/bastion-services/terraform/modules/cluster" } }
-
POST
/terraform/repository/{repositoryID}
¶ Set the URL for a Terraform repository and update it.
Parameters: - repositoryID – The name of a Terraform repository. Must be a valid folder name using only lowercase letters.
Request JSON Object: - url (string) – A URL fetchable with go-getter. (https://github.com/hashicorp/go-getter)
Response JSON Object: - repository.url (string) – A URL fetchable with go-getter. (https://github.com/hashicorp/go-getter)
Example query:
{ "url": "" }
Example response:
{ "repository": { "url": "file:///C:/genvid/gv-version/bastion-services/terraform/modules/cluster" } }
-
PUT
/terraform/repository/{repositoryID}
¶ If a body is given, update the repository definition. In all cases, update the repository.
Parameters: - repositoryID – The name of a Terraform repository. Must be a valid folder name using only lowercase letters.
Request JSON Object: - url (string) – A URL fetchable with go-getter. (https://github.com/hashicorp/go-getter)
Response JSON Object: - repository.url (string) – A URL fetchable with go-getter. (https://github.com/hashicorp/go-getter)
Example query:
{ "url": "" }
Example response:
{ "repository": { "url": "file:///C:/genvid/gv-version/bastion-services/terraform/modules/cluster" } }
-
DELETE
/terraform/repository/{repositoryID}
¶ Remove a Terraform repository.
Parameters: - repositoryID – The name of a Terraform repository. Must be a valid folder name using only lowercase letters.
Response JSON Object: - repository.url (string) – A URL fetchable with go-getter. (https://github.com/hashicorp/go-getter)
Example response:
{ "repository": { "url": "file:///C:/genvid/gv-version/bastion-services/terraform/modules/cluster" } }
-
GET
/terraform/modules
¶ Get the list of modules available. Only returns valid modules.
Response JSON Object: - modules[] (object) – A list of Terraform modules.
- modules[].repository (string) – The Terraform repository containing this module.
- modules[].path (string) – The relative path from the bastion root modules of this module.
- modules[].capabilities[] (string) – Array of capabilities.
Example response:
{ "modules": [ { "repository": "cluster", "path": "cluster/default", "capabilities": [ "cluster-api" ] } ] }
-
GET
/terraform/modules/{prefix}
¶ Get the list of modules available under the provided prefix. Only returns valid modules.
Parameters: - prefix – The prefix to filter with. Only returns modules inside this prefix. Doesn’t return partial matches.
Response JSON Object: - modules[] (object) – A list of Terraform modules.
- modules[].repository (string) – The Terraform repository containing this module.
- modules[].path (string) – The relative path from the bastion root modules of this module.
- modules[].capabilities[] (string) – Array of capabilities.
Example response:
{ "modules": [ { "repository": "cluster", "path": "cluster/default", "capabilities": [ "cluster-api" ] } ] }
-
GET
/terraform/module/{module}
¶ Get the description of a Terraform module.
Parameters: - module – The relative path of a module.
Response JSON Object: - module.path (string) – The relative path from the bastion root modules of this module.
- module.variable[key].type (string) – The type of the variable.
- module.variable[key].description (string) – A description of the variable.
- module.variable[key].default – A default value for the variable. Type can be any of string,array,object,null.
- module.output[key].value – The value of the output. Type can be any of string,array,object,null.
- module.output[key].description (string) – A description of the output
- module.output[key].sensitive (boolean) – If the output value is sensitive
- module.output[key].depends_on[] (string) – Explicit dependencies of the output value.
Example response:
{ "module": { "path": "cluster/default", "variable": { "game_az": { "description": "AWS Availability Zone where the game instance is to be created.\n", "default": "a" }, "game_count": { "description": "Number of game instance to spawn", "default": 1 } }, "output": { "game_private_ips": { "value": "${module.game.private_ips}" }, "game_public_ips": { "value": "${module.game.public_ips}" } } } }
Terraform¶
-
GET
/terraform/instances
¶ Get all Terraform instances.
Response JSON Object: - [] (object) –
- [].instanceID (string) –
- [].modulePath (string) –
- [].destination (string) –
- [].bastionID (string) –
- [].clusterID (string) –
- [].serverIPs (string) –
- [].static.isStatic (boolean) – If the cluster is static or not
- [].static.output[key] (undefined) –
- [].backendName (string) –
- [].tfvars[key] – Type can be any of boolean,integer,number,object,string,null.
- [].backendConfig.id (string) – The backend ID.
- [].backendConfig.type (string) – The backend type.
- [].backendConfig.config[key].id (string) – The variable ID.
- [].backendConfig.config[key].editable (boolean) – If the variable is editable of not.
- [].backendConfig.config[key].asArgument (boolean) – If the variable is passed as argument to Terraform or in a configuration file.
- [].backendConfig.config[key].protected (boolean) – If the variable is shown as a password in the GUI.
- [].backendConfig.config[key].value (string) – The variable value.
- [].rootModule (string) –
- [].bastionVersion (string) –
Example response:
[ { "instanceID": "my-cluster", "modulePath": "SDK-1.16.0/basic/basic_cluster", "destination": "C:\\Users\\myuser\\.genvid\\terraform\\workdir\\my-cluster\\tf", "clusterID": "my-cluster", "static": { "isStatic": false, "output": null }, "backendName": "default", "tfvars": { "admin_password": "1genvid6", "ami_prefix": "default", "ami_version": "1.17.0", "datacenter": "default", "force_az": "none", "instance_encoding_count": 1, "instance_encoding_type": "c5.2xlarge", "instance_game_count": 1, "instance_game_type": "g2.2xlarge", "instance_internal_count": 1, "instance_internal_type": "t2.small", "instance_public_count": 1, "instance_public_type": "t2.small", "instance_server_count": 1, "instance_server_type": "t2.small", "namespace": "deployment", "region": "us-east-1", "stage": "dev", "toolbox_location": "", "trusted_cidrs": [], "trusted_security_groups": [], "vpc_cidr_block": "10.0.0.0/16" }, "backendConfig": { "id": "default", "type": "consul", "config": { "address": { "id": "address", "editable": false, "asArgument": false, "protected": false, "value": "127.0.0.1:8500" }, "path": { "id": "path", "editable": false, "asArgument": false, "protected": false, "value": "bastion/terraform/states/my-cluster/tfstate" } } }, "rootModule": "{\n \"module\": {\n \"cluster\": {\n \"admin_password\": \"${var.admin_password}\",\n \"ami_prefix\": \"${var.ami_prefix}\",\n \"ami_version\": \"${var.ami_version}\",\n \"cluster\": \"${var.cluster}\",\n \"datacenter\": \"${var.datacenter}\",\n \"force_az\": \"${var.force_az}\",\n \"instance_encoding_count\": \"${var.instance_encoding_count}\",\n \"instance_encoding_type\": \"${var.instance_encoding_type}\",\n \"instance_game_count\": \"${var.instance_game_count}\",\n \"instance_game_type\": \"${var.instance_game_type}\",\n \"instance_internal_count\": \"${var.instance_internal_count}\",\n \"instance_internal_type\": \"${var.instance_internal_type}\",\n \"instance_public_count\": \"${var.instance_public_count}\",\n \"instance_public_type\": \"${var.instance_public_type}\",\n \"instance_server_count\": \"${var.instance_server_count}\",\n \"instance_server_type\": \"${var.instance_server_type}\",\n \"namespace\": \"${var.namespace}\",\n \"region\": \"${var.region}\",\n \"source\": \"..\\\\..\\\\..\\\\modules\\\\SDK-1.16.0\\\\basic\\\\basic_cluster\",\n \"stage\": \"${var.stage}\",\n \"toolbox_location\": \"${var.toolbox_location}\",\n \"trusted_cidr\": \"${var.trusted_cidr}\",\n \"trusted_cidrs\": \"${var.trusted_cidrs}\",\n \"trusted_security_groups\": \"${var.trusted_security_groups}\",\n \"vpc_cidr_block\": \"${var.vpc_cidr_block}\"\n }\n },\n \"output\": {\n \"azs_available\": {\n \"value\": \"${module.cluster.azs_available}\"\n },\n \"azs_selected\": {\n \"value\": \"${module.cluster.azs_selected}\"\n },\n \"cluster\": {\n \"value\": \"${module.cluster.cluster}\"\n },\n \"encoding_worker_private_ips\": {\n \"value\": \"${module.cluster.encoding_worker_private_ips}\"\n },\n \"encoding_worker_public_ips\": {\n \"value\": \"${module.cluster.encoding_worker_public_ips}\"\n },\n \"game_private_ips\": {\n \"value\": \"${module.cluster.game_private_ips}\"\n },\n \"game_public_ips\": {\n \"value\": \"${module.cluster.game_public_ips}\"\n },\n \"iam_policy_name_game\": {\n \"value\": \"${module.cluster.iam_policy_name_game}\"\n },\n \"iam_policy_name_server\": {\n \"value\": \"${module.cluster.iam_policy_name_server}\"\n },\n \"internal_worker_private_ips\": {\n \"value\": \"${module.cluster.internal_worker_private_ips}\"\n },\n \"internal_worker_public_ips\": {\n \"value\": \"${module.cluster.internal_worker_public_ips}\"\n },\n \"private_key_pem\": {\n \"value\": \"${module.cluster.private_key_pem}\"\n },\n \"public_key\": {\n \"value\": \"${module.cluster.public_key}\"\n },\n \"public_worker_private_ips\": {\n \"value\": \"${module.cluster.public_worker_private_ips}\"\n },\n \"public_worker_public_ips\": {\n \"value\": \"${module.cluster.public_worker_public_ips}\"\n },\n \"region\": {\n \"value\": \"${module.cluster.region}\"\n },\n \"server_private_ips\": {\n \"value\": \"${module.cluster.server_private_ips}\"\n },\n \"server_public_ips\": {\n \"value\": \"${module.cluster.server_public_ips}\"\n },\n \"subnet_selected\": {\n \"value\": \"${module.cluster.subnet_selected}\"\n },\n \"toolbox_checksum\": {\n \"value\": \"${module.cluster.toolbox_checksum}\"\n },\n \"vpc_id_selected\": {\n \"value\": \"${module.cluster.vpc_id_selected}\"\n }\n },\n \"variable\": {\n \"admin_password\": {\n \"description\": \"Administrative password for the game machine.\\n\",\n \"default\": \"1genvid6\"\n },\n \"ami_prefix\": {\n \"description\": \"Prefix of the game AMI.\",\n \"default\": \"default\"\n },\n \"ami_version\": {\n \"description\": \"Version of the AMIs (both game and genvid) to use.\",\n \"default\": \"1.17.0\"\n },\n \"cluster\": {\n \"type\": \"string\",\n \"description\": \"Name of your cluster\"\n },\n \"datacenter\": {\n \"description\": \"Consul/Nomad datacenter\",\n \"default\": \"default\"\n },\n \"force_az\": {\n \"type\": \"string\",\n \"description\": \"Force Subnet placement in specified Availability Zone (us-east-1a)\",\n \"default\": \"none\"\n },\n \"instance_encoding_count\": {\n \"description\": \"Number of internal workers to spawn\",\n \"default\": 1\n },\n \"instance_encoding_type\": {\n \"type\": \"string\",\n \"description\": \"Type of EC2 instance to use for encoding servers\",\n \"default\": \"c5.2xlarge\"\n },\n \"instance_game_count\": {\n \"description\": \"Number of game instances to spawn\",\n \"default\": 1\n },\n \"instance_game_type\": {\n \"type\": \"string\",\n \"description\": \"Type of EC2 instance to use for game servers\",\n \"default\": \"g2.2xlarge\"\n },\n \"instance_internal_count\": {\n \"description\": \"Number of internal workers to spawn\",\n \"default\": 1\n },\n \"instance_internal_type\": {\n \"type\": \"string\",\n \"description\": \"Type of EC2 instance to use for internal servers\",\n \"default\": \"t2.small\"\n },\n \"instance_public_count\": {\n \"description\": \"Number of public workers to spawn\",\n \"default\": 1\n },\n \"instance_public_type\": {\n \"type\": \"string\",\n \"description\": \"Type of EC2 instance to use for public servers\",\n \"default\": \"t2.small\"\n },\n \"instance_server_count\": {\n \"description\": \"The number of supervisor servers. Must be an odd number.\\nIt is usually 3 for production deployment.\\n\",\n \"default\": 1\n },\n \"instance_server_type\": {\n \"type\": \"string\",\n \"description\": \"Type of EC2 instance to use for admin servers\",\n \"default\": \"t2.small\"\n },\n \"namespace\": {\n \"type\": \"string\",\n \"description\": \"Deployment namespace that will regroup the clusters\",\n \"default\": \"deployment\"\n },\n \"region\": {\n \"description\": \"AWS deployment region\",\n \"default\": \"us-east-1\"\n },\n \"stage\": {\n \"type\": \"string\",\n \"description\": \"Deployment stage\",\n \"default\": \"dev\"\n },\n \"toolbox_location\": {\n \"description\": \"Genvid Toolbox Wheel file.\\n\\nOnly required if you need to update the one from the AMI.\\nAn empty value indicates to not install the toolbox.\\n\",\n \"default\": \"\"\n },\n \"trusted_cidr\": {\n \"type\": \"string\",\n \"description\": \"CIDR to be trusted. This should at least contains the external IP for\\nthe local machine. Elsewhere, the provision and access to\\nconsul/nomad will fail.\\n\"\n },\n \"trusted_cidrs\": {\n \"type\": \"list\",\n \"description\": \"A list of CIDR to be trusted.\\n\",\n \"default\": []\n },\n \"trusted_security_groups\": {\n \"type\": \"list\",\n \"description\": \"A list of security groups to be trusted.\\n\",\n \"default\": []\n },\n \"vpc_cidr_block\": {\n \"type\": \"string\",\n \"description\": \"VPC IP Address Space\",\n \"default\": \"10.0.0.0/16\"\n }\n }\n}", "bastionVersion": "1.18" } ]
-
GET
/terraform/instance/{instanceID}
¶ Get the specified Terraform instance.
Parameters: - instanceID – The instance ID. An opaque string.
Response JSON Object: - instanceID (string) –
- modulePath (string) –
- destination (string) –
- bastionID (string) –
- clusterID (string) –
- serverIPs (string) –
- static.isStatic (boolean) – If the cluster is static or not
- static.output[key] (undefined) –
- backendName (string) –
- tfvars[key] – Type can be any of boolean,integer,number,object,string,null.
- backendConfig.id (string) – The backend ID.
- backendConfig.type (string) – The backend type.
- backendConfig.config[key].id (string) – The variable ID.
- backendConfig.config[key].editable (boolean) – If the variable is editable of not.
- backendConfig.config[key].asArgument (boolean) – If the variable is passed as argument to Terraform or in a configuration file.
- backendConfig.config[key].protected (boolean) – If the variable is shown as a password in the GUI.
- backendConfig.config[key].value (string) – The variable value.
- rootModule (string) –
- bastionVersion (string) –
Example response:
{ "instanceID": "my-cluster", "modulePath": "SDK-1.16.0/basic/basic_cluster", "destination": "C:\\Users\\myuser\\.genvid\\terraform\\workdir\\my-cluster\\tf", "clusterID": "my-cluster", "static": { "isStatic": false, "output": null }, "backendName": "default", "tfvars": { "admin_password": "1genvid6", "ami_prefix": "default", "ami_version": "1.17.0", "datacenter": "default", "force_az": "none", "instance_encoding_count": 1, "instance_encoding_type": "c5.2xlarge", "instance_game_count": 1, "instance_game_type": "g2.2xlarge", "instance_internal_count": 1, "instance_internal_type": "t2.small", "instance_public_count": 1, "instance_public_type": "t2.small", "instance_server_count": 1, "instance_server_type": "t2.small", "namespace": "deployment", "region": "us-east-1", "stage": "dev", "toolbox_location": "", "trusted_cidrs": [], "trusted_security_groups": [], "vpc_cidr_block": "10.0.0.0/16" }, "backendConfig": { "id": "default", "type": "consul", "config": { "address": { "id": "address", "editable": false, "asArgument": false, "protected": false, "value": "127.0.0.1:8500" }, "path": { "id": "path", "editable": false, "asArgument": false, "protected": false, "value": "bastion/terraform/states/my-cluster/tfstate" } } }, "rootModule": "{\n \"module\": {\n \"cluster\": {\n \"admin_password\": \"${var.admin_password}\",\n \"ami_prefix\": \"${var.ami_prefix}\",\n \"ami_version\": \"${var.ami_version}\",\n \"cluster\": \"${var.cluster}\",\n \"datacenter\": \"${var.datacenter}\",\n \"force_az\": \"${var.force_az}\",\n \"instance_encoding_count\": \"${var.instance_encoding_count}\",\n \"instance_encoding_type\": \"${var.instance_encoding_type}\",\n \"instance_game_count\": \"${var.instance_game_count}\",\n \"instance_game_type\": \"${var.instance_game_type}\",\n \"instance_internal_count\": \"${var.instance_internal_count}\",\n \"instance_internal_type\": \"${var.instance_internal_type}\",\n \"instance_public_count\": \"${var.instance_public_count}\",\n \"instance_public_type\": \"${var.instance_public_type}\",\n \"instance_server_count\": \"${var.instance_server_count}\",\n \"instance_server_type\": \"${var.instance_server_type}\",\n \"namespace\": \"${var.namespace}\",\n \"region\": \"${var.region}\",\n \"source\": \"..\\\\..\\\\..\\\\modules\\\\SDK-1.16.0\\\\basic\\\\basic_cluster\",\n \"stage\": \"${var.stage}\",\n \"toolbox_location\": \"${var.toolbox_location}\",\n \"trusted_cidr\": \"${var.trusted_cidr}\",\n \"trusted_cidrs\": \"${var.trusted_cidrs}\",\n \"trusted_security_groups\": \"${var.trusted_security_groups}\",\n \"vpc_cidr_block\": \"${var.vpc_cidr_block}\"\n }\n },\n \"output\": {\n \"azs_available\": {\n \"value\": \"${module.cluster.azs_available}\"\n },\n \"azs_selected\": {\n \"value\": \"${module.cluster.azs_selected}\"\n },\n \"cluster\": {\n \"value\": \"${module.cluster.cluster}\"\n },\n \"encoding_worker_private_ips\": {\n \"value\": \"${module.cluster.encoding_worker_private_ips}\"\n },\n \"encoding_worker_public_ips\": {\n \"value\": \"${module.cluster.encoding_worker_public_ips}\"\n },\n \"game_private_ips\": {\n \"value\": \"${module.cluster.game_private_ips}\"\n },\n \"game_public_ips\": {\n \"value\": \"${module.cluster.game_public_ips}\"\n },\n \"iam_policy_name_game\": {\n \"value\": \"${module.cluster.iam_policy_name_game}\"\n },\n \"iam_policy_name_server\": {\n \"value\": \"${module.cluster.iam_policy_name_server}\"\n },\n \"internal_worker_private_ips\": {\n \"value\": \"${module.cluster.internal_worker_private_ips}\"\n },\n \"internal_worker_public_ips\": {\n \"value\": \"${module.cluster.internal_worker_public_ips}\"\n },\n \"private_key_pem\": {\n \"value\": \"${module.cluster.private_key_pem}\"\n },\n \"public_key\": {\n \"value\": \"${module.cluster.public_key}\"\n },\n \"public_worker_private_ips\": {\n \"value\": \"${module.cluster.public_worker_private_ips}\"\n },\n \"public_worker_public_ips\": {\n \"value\": \"${module.cluster.public_worker_public_ips}\"\n },\n \"region\": {\n \"value\": \"${module.cluster.region}\"\n },\n \"server_private_ips\": {\n \"value\": \"${module.cluster.server_private_ips}\"\n },\n \"server_public_ips\": {\n \"value\": \"${module.cluster.server_public_ips}\"\n },\n \"subnet_selected\": {\n \"value\": \"${module.cluster.subnet_selected}\"\n },\n \"toolbox_checksum\": {\n \"value\": \"${module.cluster.toolbox_checksum}\"\n },\n \"vpc_id_selected\": {\n \"value\": \"${module.cluster.vpc_id_selected}\"\n }\n },\n \"variable\": {\n \"admin_password\": {\n \"description\": \"Administrative password for the game machine.\\n\",\n \"default\": \"1genvid6\"\n },\n \"ami_prefix\": {\n \"description\": \"Prefix of the game AMI.\",\n \"default\": \"default\"\n },\n \"ami_version\": {\n \"description\": \"Version of the AMIs (both game and genvid) to use.\",\n \"default\": \"1.17.0\"\n },\n \"cluster\": {\n \"type\": \"string\",\n \"description\": \"Name of your cluster\"\n },\n \"datacenter\": {\n \"description\": \"Consul/Nomad datacenter\",\n \"default\": \"default\"\n },\n \"force_az\": {\n \"type\": \"string\",\n \"description\": \"Force Subnet placement in specified Availability Zone (us-east-1a)\",\n \"default\": \"none\"\n },\n \"instance_encoding_count\": {\n \"description\": \"Number of internal workers to spawn\",\n \"default\": 1\n },\n \"instance_encoding_type\": {\n \"type\": \"string\",\n \"description\": \"Type of EC2 instance to use for encoding servers\",\n \"default\": \"c5.2xlarge\"\n },\n \"instance_game_count\": {\n \"description\": \"Number of game instances to spawn\",\n \"default\": 1\n },\n \"instance_game_type\": {\n \"type\": \"string\",\n \"description\": \"Type of EC2 instance to use for game servers\",\n \"default\": \"g2.2xlarge\"\n },\n \"instance_internal_count\": {\n \"description\": \"Number of internal workers to spawn\",\n \"default\": 1\n },\n \"instance_internal_type\": {\n \"type\": \"string\",\n \"description\": \"Type of EC2 instance to use for internal servers\",\n \"default\": \"t2.small\"\n },\n \"instance_public_count\": {\n \"description\": \"Number of public workers to spawn\",\n \"default\": 1\n },\n \"instance_public_type\": {\n \"type\": \"string\",\n \"description\": \"Type of EC2 instance to use for public servers\",\n \"default\": \"t2.small\"\n },\n \"instance_server_count\": {\n \"description\": \"The number of supervisor servers. Must be an odd number.\\nIt is usually 3 for production deployment.\\n\",\n \"default\": 1\n },\n \"instance_server_type\": {\n \"type\": \"string\",\n \"description\": \"Type of EC2 instance to use for admin servers\",\n \"default\": \"t2.small\"\n },\n \"namespace\": {\n \"type\": \"string\",\n \"description\": \"Deployment namespace that will regroup the clusters\",\n \"default\": \"deployment\"\n },\n \"region\": {\n \"description\": \"AWS deployment region\",\n \"default\": \"us-east-1\"\n },\n \"stage\": {\n \"type\": \"string\",\n \"description\": \"Deployment stage\",\n \"default\": \"dev\"\n },\n \"toolbox_location\": {\n \"description\": \"Genvid Toolbox Wheel file.\\n\\nOnly required if you need to update the one from the AMI.\\nAn empty value indicates to not install the toolbox.\\n\",\n \"default\": \"\"\n },\n \"trusted_cidr\": {\n \"type\": \"string\",\n \"description\": \"CIDR to be trusted. This should at least contains the external IP for\\nthe local machine. Elsewhere, the provision and access to\\nconsul/nomad will fail.\\n\"\n },\n \"trusted_cidrs\": {\n \"type\": \"list\",\n \"description\": \"A list of CIDR to be trusted.\\n\",\n \"default\": []\n },\n \"trusted_security_groups\": {\n \"type\": \"list\",\n \"description\": \"A list of security groups to be trusted.\\n\",\n \"default\": []\n },\n \"vpc_cidr_block\": {\n \"type\": \"string\",\n \"description\": \"VPC IP Address Space\",\n \"default\": \"10.0.0.0/16\"\n }\n }\n}", "bastionVersion": "1.18" }
-
GET
/terraform/instance/{instanceID}/status
¶ Get the status of the instance.
Parameters: - instanceID – The instance ID. An opaque string.
Response JSON Object: - status (string) –
The status of the cluster.
- VOID: The cluster doesn’t exist.
- EMPTY: The cluster is not initialized.
- DOWN: The cluster has no resource instantiated.
- UP: The cluter has some resources instantiated.
- BUSY: The cluster is currently running a command.
- ERROR: An error occured while retrieving the status.
- INVALID: The current status is unknown or invalid.
Example response:
{ "status": "VOID" }
-
POST
/terraform/instance/{instanceID}/regenerate
¶ Regenerate the Terraform workdir with the data stored in Consul.
Parameters: - instanceID – The instance ID. An opaque string.
-
GET
/terraform/instance/{instanceID}/tfvars/default
¶ The default Terraform variables use the default values in the module, but are overriden by any Global Variables with the same name.
Parameters: - instanceID – The instance ID. An opaque string.
Response JSON Object: - [key] – Type can be any of boolean,integer,number,object,string,null.
Example response:
{ "ami_prefix": "internal", "ami_version": "1.20.0", "trusted_cidrs": [], "trusted_security_groups": [] }
-
GET
/terraform/instance/{instanceID}/tfvars
¶ Get the Terraform variables. This is the content of the ‘terraform.tfvars’ file.
Parameters: - instanceID – The instance ID. An opaque string.
Response JSON Object: - [key] – Type can be any of boolean,integer,number,object,string,null.
Example response:
{ "ami_prefix": "internal", "ami_version": "1.20.0", "trusted_cidrs": [], "trusted_security_groups": [] }
-
POST
/terraform/instance/{instanceID}/tfvars
¶ Set the Terraform variables. This is the content of the ‘terraform.tfvars’ file.
Parameters: - instanceID – The instance ID. An opaque string.
Request JSON Object: - [key] – Type can be any of boolean,integer,number,object,string,null.
Example query:
{ "ami_prefix": "internal", "ami_version": "1.20.0", "trusted_cidrs": [], "trusted_security_groups": [] }
-
GET
/terraform/instance/{instanceID}/providers
¶ Get all known Terraform providers and their configuration. This information is retrieved from Consul.
Parameters: - instanceID – The instance ID. An opaque string.
Response JSON Object: - [] (object) –
- [].name (string) – Provider name.
- [].meta.alias (string) – An optional provider alias.
- [].meta.version (string) – Version constraint following Terraform’s syntax.
- [].arguments[key] – Type can be any of boolean,integer,number,object,string,null.
Example response:
[ { "name": "aws", "meta": { "alias": null, "version": "~> 2.2.0" }, "arguments": { "region": "us-east-1" } } ]
-
PUT
/terraform/instance/{instanceID}/providers
¶ Override the providers configuration. This information is also stored in Consul.
Parameters: - instanceID – The instance ID. An opaque string.
Request JSON Object: - [] (object) –
- [].name (string) – Provider name.
- [].meta.alias (string) – An optional provider alias.
- [].meta.version (string) – Version constraint following Terraform’s syntax.
- [].arguments[key] – Type can be any of boolean,integer,number,object,string,null.
Example query:
[ { "name": "aws", "meta": { "alias": null, "version": "~> 2.2.0" }, "arguments": { "region": "us-east-1" } } ]
-
DELETE
/terraform/instance/{instanceID}/providers
¶ Remove all known Terraform providers and their configuration. This information is wiped from Consul.
Parameters: - instanceID – The instance ID. An opaque string.
-
PUT
/terraform/instance/{instanceID}/provider
¶ Add or override a provider. This information is stored in Consul.
Parameters: - instanceID – The instance ID. An opaque string.
Request JSON Object: - name (string) – Provider name.
- meta.alias (string) – An optional provider alias.
- meta.version (string) – Version constraint following Terraform’s syntax.
- arguments[key] – Type can be any of boolean,integer,number,object,string,null.
Example query:
{ "name": "aws", "meta": { "alias": null, "version": "~> 2.2.0" }, "arguments": { "region": "us-east-1" } }
-
GET
/terraform/instance/{instanceID}/provider/{providerName}
¶ Get the Terraform arguments (unaliased provider). This information is retrieved from Consul.
Parameters: - instanceID – The instance ID. An opaque string.
- providerName – A Terraform provider name.
Response JSON Object: - name (string) – Provider name.
- meta.alias (string) – An optional provider alias.
- meta.version (string) – Version constraint following Terraform’s syntax.
- arguments[key] – Type can be any of boolean,integer,number,object,string,null.
Example response:
{ "name": "aws", "meta": { "alias": null, "version": "~> 2.2.0" }, "arguments": { "region": "us-east-1" } }
-
DELETE
/terraform/instance/{instanceID}/provider/{providerName}
¶ Remove the Terraform provider and all its arguments (unaliased provider). This information is removed from Consul.
Parameters: - instanceID – The instance ID. An opaque string.
- providerName – A Terraform provider name.
-
GET
/terraform/instance/{instanceID}/provider/{providerName}/{providerAlias}
¶ Get the Terraform arguments. This information is retrieved from Consul.
Parameters: - instanceID – The instance ID. An opaque string.
- providerName – A Terraform provider name.
- providerAlias – A Terraform provider alias.
Response JSON Object: - name (string) – Provider name.
- meta.alias (string) – An optional provider alias.
- meta.version (string) – Version constraint following Terraform’s syntax.
- arguments[key] – Type can be any of boolean,integer,number,object,string,null.
Example response:
{ "name": "aws", "meta": { "alias": null, "version": "~> 2.2.0" }, "arguments": { "region": "us-east-1" } }
-
DELETE
/terraform/instance/{instanceID}/provider/{providerName}/{providerAlias}
¶ Remove the Terraform provider and all its arguments. This information is removed from Consul.
Parameters: - instanceID – The instance ID. An opaque string.
- providerName – A Terraform provider name.
- providerAlias – A Terraform provider alias.
-
POST
/terraform/instance/{instanceID}/get
¶ Execute the terraform get command.
Parameters: - instanceID – The instance ID. An opaque string.
Response JSON Object: - data (string) –
Example response:
{ "data": "- module.cluster\n- module.cluster.cluster\n- module.cluster.cluster.server\n- module.cluster.cluster.internal\n- module.cluster.cluster.encoding\n- module.cluster.cluster.public\n- module.cluster.cluster.game\n" }
-
POST
/terraform/instance/{instanceID}/importmodule
¶ Import a module into Terraform.
Parameters: - instanceID – The instance ID. An opaque string.
Query Parameters: - force – Force the operation even if the cluster is in an error state.
Request JSON Object: - modulePath (string) – The module path.
Response JSON Object: - id (string) –
- displayText (string) –
- instanceID (string) –
- category (string) –
- command (string) –
- start (string) –
Example query:
{ "modulePath": "" }
Example response:
{ "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85", "displayText": "terraform command", "instanceID": "mycluster", "category": "terraform", "command": "D:\\genvidtech\\main\\bin\\terraform", "start": "2019-02-11T12:58:15-05:00" }
-
POST
/terraform/instance/{instanceID}/init
¶ Execute the ‘terraform init’ command.
Parameters: - instanceID – The instance ID. An opaque string.
Query Parameters: - force – Force the operation even if the cluster is in an error state.
Response JSON Object: - id (string) –
- displayText (string) –
- instanceID (string) –
- category (string) –
- command (string) –
- start (string) –
Example response:
{ "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85", "displayText": "terraform command", "instanceID": "mycluster", "category": "terraform", "command": "D:\\genvidtech\\main\\bin\\terraform", "start": "2019-02-11T12:58:15-05:00" }
-
POST
/terraform/instance/{instanceID}/plan
¶ Execute the ‘terraform plan’ command.
Parameters: - instanceID – The instance ID. An opaque string.
Response JSON Object: - id (string) –
- displayText (string) –
- instanceID (string) –
- category (string) –
- command (string) –
- start (string) –
Example response:
{ "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85", "displayText": "terraform command", "instanceID": "mycluster", "category": "terraform", "command": "D:\\genvidtech\\main\\bin\\terraform", "start": "2019-02-11T12:58:15-05:00" }
-
POST
/terraform/instance/{instanceID}/refresh
¶ Execute the ‘terraform refresh’ command.
Parameters: - instanceID – The instance ID. An opaque string.
Response JSON Object: - id (string) –
- displayText (string) –
- instanceID (string) –
- category (string) –
- command (string) –
- start (string) –
Example response:
{ "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85", "displayText": "terraform command", "instanceID": "mycluster", "category": "terraform", "command": "D:\\genvidtech\\main\\bin\\terraform", "start": "2019-02-11T12:58:15-05:00" }
-
POST
/terraform/instance/{instanceID}/apply
¶ Execute the ‘terraform apply’ command.
Parameters: - instanceID – The instance ID. An opaque string.
Response JSON Object: - id (string) –
- displayText (string) –
- instanceID (string) –
- category (string) –
- command (string) –
- start (string) –
Example response:
{ "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85", "displayText": "terraform command", "instanceID": "mycluster", "category": "terraform", "command": "D:\\genvidtech\\main\\bin\\terraform", "start": "2019-02-11T12:58:15-05:00" }
-
POST
/terraform/instance/{instanceID}/apply/{planFileName}
¶ Execute the ‘terraform apply’ command on the specified plan.
Parameters: - instanceID – The instance ID. An opaque string.
- planFileName – The plan file name.
Response JSON Object: - id (string) –
- displayText (string) –
- instanceID (string) –
- category (string) –
- command (string) –
- start (string) –
Example response:
{ "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85", "displayText": "terraform command", "instanceID": "mycluster", "category": "terraform", "command": "D:\\genvidtech\\main\\bin\\terraform", "start": "2019-02-11T12:58:15-05:00" }
-
POST
/terraform/instance/{instanceID}/destroy
¶ Execute the ‘terraform destroy’ command.
Parameters: - instanceID – The instance ID. An opaque string.
Response JSON Object: - id (string) –
- displayText (string) –
- instanceID (string) –
- category (string) –
- command (string) –
- start (string) –
Example response:
{ "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85", "displayText": "terraform command", "instanceID": "mycluster", "category": "terraform", "command": "D:\\genvidtech\\main\\bin\\terraform", "start": "2019-02-11T12:58:15-05:00" }
-
GET
/terraform/instance/{instanceID}/output
¶ Execute the ‘terraform output’ command.
Parameters: - instanceID – The instance ID. An opaque string.
Response JSON Object: - sensitive (boolean) –
- type (string) –
- value (undefined) –
Example response:
{ "sensitive": false, "type": "" }
Commands¶
-
GET
/terraform/instance/{instanceID}/commands
¶ Get the commands.
Parameters: - instanceID – The instance ID. An opaque string.
Query Parameters: - current – If true, only return executing commands.
Response JSON Object: - [] (object) –
- [].id (string) –
- [].displayText (string) –
- [].instanceID (string) –
- [].category (string) –
- [].command (string) –
- [].start (string) –
Example response:
[ { "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85", "displayText": "terraform command", "instanceID": "mycluster", "category": "terraform", "command": "D:\\genvidtech\\main\\bin\\terraform", "start": "2019-02-11T12:58:15-05:00" } ]
-
GET
/terraform/instance/{instanceID}/command/{commandID}
¶ Get the command data.
Parameters: - instanceID – The instance ID. An opaque string.
- commandID – The command ID. An opaque string.
Response JSON Object: - id (string) –
- displayText (string) –
- instanceID (string) –
- category (string) –
- command (string) –
- start (string) –
Example response:
{ "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85", "displayText": "terraform command", "instanceID": "mycluster", "category": "terraform", "command": "D:\\genvidtech\\main\\bin\\terraform", "start": "2019-02-11T12:58:15-05:00" }
-
GET
/terraform/instance/{instanceID}/log/{commandID}
¶ Get a command log.
Parameters: - instanceID – The instance ID. An opaque string.
- commandID – The command ID. An opaque string.
Query Parameters: - origin – Either ‘start’ or ‘end’.
- offset – The offset to the origin.
- size – The max size of the return value.
Response JSON Object: - offset (integer) –
- data (string) –
- isDone (boolean) –
Example response:
{ "data": "", "isDone": false }
-
GET
/terraform/instance/{instanceID}/wait/{commandID}
¶ Wait until the command finishes and returns the command runner.
Parameters: - instanceID – The instance ID. An opaque string.
- commandID – The command ID. An opaque string.
Response JSON Object: - id (string) –
- displayText (string) –
- instanceID (string) –
- category (string) –
- command (string) –
- start (string) –
Example response:
{ "id": "b12eb81b-6bde-489f-99ca-e5ea02108f85", "displayText": "terraform command", "instanceID": "mycluster", "category": "terraform", "command": "D:\\genvidtech\\main\\bin\\terraform", "start": "2019-02-11T12:58:15-05:00" }
-
GET
/terraform/instance/{instanceID}/terminate/{commandID}
¶ Terminate a command.
Parameters: - instanceID – The instance ID. An opaque string.
- commandID – The command ID. An opaque string.
-
GET
/terraform/instance/{instanceID}/kill/{commandID}
¶ Kill a command.
Parameters: - instanceID – The instance ID. An opaque string.
- commandID – The command ID. An opaque string.