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) –
[].terraformContextVersion (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", "clusterUUID": "7dd1c33b-ca12-42eb-9b1c-fe95c21c66aa", "static": { "isStatic": false, "output": null }, "backendName": "default", "tfvars": { "azs": [ "1" ], "shared_gallery_image_version": "1.25.203", "shared_gallery_name": "genvid", "shared_gallery_resource_group_name": "genvidtech", "trusted_cidrs": [], "trusted_security_groups": [], "wingame_image_prefix": "genvidtech" }, "providers": { "providers": [ { "provider": "azurerm", "alias": null, "arguments": { "features": {} } } ] }, "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 \"azs\": \"${var.azs}\",\n \"cluster\": \"${var.cluster}\",\n \"datacenter\": \"${var.datacenter}\",\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 \"location\": \"${var.location}\",\n \"namespace\": \"${var.namespace}\",\n \"shared_gallery_image_version\": \"${var.shared_gallery_image_version}\",\n \"shared_gallery_name\": \"${var.shared_gallery_name}\",\n \"shared_gallery_resource_group_name\": \"${var.shared_gallery_resource_group_name}\",\n \"source\": \"..\\\\..\\\\..\\\\modules\\\\SDK-1.24.0\\\\basic\\\\azurerm_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 \"wingame_image_prefix\": \"${var.wingame_image_prefix}\"\n }\n },\n \"output\": {\n \"admin_username\": {\n \"value\": \"${module.cluster.admin_username}\"\n },\n \"cloud_provider\": {\n \"value\": \"${module.cluster.cloud_provider}\"\n },\n \"encoding_worker_public_ips\": {\n \"value\": \"${module.cluster.encoding_worker_public_ips}\"\n },\n \"game_admin_password\": {\n \"value\": \"${module.cluster.game_admin_password}\"\n },\n \"game_instance_ids\": {\n \"value\": \"${module.cluster.game_instance_ids}\"\n },\n \"game_machine_locations\": {\n \"value\": \"${module.cluster.game_machine_locations}\"\n },\n \"game_machine_names\": {\n \"value\": \"${module.cluster.game_machine_names}\"\n },\n \"game_public_ips\": {\n \"value\": \"${module.cluster.game_public_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_worker_public_ips\": {\n \"value\": \"${module.cluster.public_worker_public_ips}\"\n },\n \"resource_group_name\": {\n \"value\": \"${module.cluster.resource_group_name}\"\n },\n \"server_public_ips\": {\n \"value\": \"${module.cluster.server_public_ips}\"\n }\n },\n \"variable\": {\n \"admin_password\": {\n \"type\": \"string\",\n \"description\": \"Administrative password for the game machine.\\nThat password must respect default windows password complexity.\\n\",\n \"default\": \"1Genvid6!\"\n },\n \"azs\": {\n \"type\": \"list(number)\",\n \"description\": \"Enables multi-AZ, which automatically spans VMs across given availability zones. \\nEnabling this forces VMs to be rebuilt, due to their locations changing. An empty\\nlist disables multi-AZ. Options are 1, 2, 3\\n\",\n \"default\": []\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 \"instance_encoding_count\": {\n \"type\": \"number\",\n \"description\": \"Number of internal workers to spawn\",\n \"default\": 1\n },\n \"instance_encoding_type\": {\n \"type\": \"string\",\n \"description\": \"Type of Virtual Network to use for encoding servers\",\n \"default\": \"Standard_F8s_v2\"\n },\n \"instance_game_count\": {\n \"type\": \"number\",\n \"description\": \"Number of game instances to spawn\",\n \"default\": 1\n },\n \"instance_game_type\": {\n \"type\": \"string\",\n \"description\": \"Type of Virtual Network to use for game servers\",\n \"default\": \"Standard_NV6\"\n },\n \"instance_internal_count\": {\n \"type\": \"number\",\n \"description\": \"Number of internal workers to spawn\",\n \"default\": 1\n },\n \"instance_internal_type\": {\n \"type\": \"string\",\n \"description\": \"Type of Virtual Network to use for internal servers\",\n \"default\": \"Standard_B2s\"\n },\n \"instance_public_count\": {\n \"type\": \"number\",\n \"description\": \"Number of public workers to spawn\",\n \"default\": 1\n },\n \"instance_public_type\": {\n \"type\": \"string\",\n \"description\": \"Type of Virtual Network to use for public servers\",\n \"default\": \"Standard_B2s\"\n },\n \"instance_server_count\": {\n \"type\": \"number\",\n \"description\": \"the number of supervisor servers. Must be an odd number.\\n#It is usually 3 for production deployment.\\n\",\n \"default\": 1\n },\n \"instance_server_type\": {\n \"type\": \"string\",\n \"description\": \"Type of Virtual Network instance to use for admin servers\",\n \"default\": \"Standard_B2s\"\n },\n \"location\": {\n \"type\": \"string\",\n \"description\": \"Azure deployment location\",\n \"default\": \"East US\"\n },\n \"namespace\": {\n \"type\": \"string\",\n \"description\": \"Deployment namespace that will regroup the clusters\",\n \"default\": \"deployment\"\n },\n \"shared_gallery_image_version\": {\n \"type\": \"string\",\n \"description\": \"SDK Shared Image version, should be only one per Genvid SDK\",\n \"default\": \"1.25.0000\"\n },\n \"shared_gallery_name\": {\n \"type\": \"string\",\n \"description\": \"Shared Gallery Name\",\n \"default\": \"SDKgallery\"\n },\n \"shared_gallery_resource_group_name\": {\n \"type\": \"string\",\n \"description\": \"Shared Gallery Resource Group Name\",\n \"default\": \"Genvid\"\n },\n \"stage\": {\n \"type\": \"string\",\n \"description\": \"Deployment stage\",\n \"default\": \"dev\"\n },\n \"toolbox_location\": {\n \"type\": \"string\",\n \"description\": \"Genvid Toolbox Wheel file.\\nOnly required if you need to update the one from the .\\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(string)\",\n \"default\": []\n },\n \"trusted_security_groups\": {\n \"type\": \"list(string)\",\n \"description\": \"A list of security groups to be trusted.\",\n \"default\": []\n },\n \"wingame_image_prefix\": {\n \"type\": \"string\",\n \"description\": \"Prefix of the wingame image\",\n \"default\": \"default\"\n }\n }\n}", "bastionVersion": "", "terraformContextVersion": "1.27" } ]
- GET /terraform/instances/status
Get all Terraform instances status.
- Response JSON Object:
[] (object) –
[].clusterID (string) – Cluster ID of the instance
[].instanceID (string) – Cluster ID of the instance
[].resourceCount (number) – The number of resource currently allocated by Terraform for the cluster.
[].status (string) – Cluster instance status
Example response:
[ { "clusterID": "MyCluster1", "instanceID": "MyCluster1", "status": "VOID", "resourceCount": 0 } ]
- 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) –
terraformContextVersion (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", "clusterUUID": "7dd1c33b-ca12-42eb-9b1c-fe95c21c66aa", "static": { "isStatic": false, "output": null }, "backendName": "default", "tfvars": { "azs": [ "1" ], "shared_gallery_image_version": "1.25.203", "shared_gallery_name": "genvid", "shared_gallery_resource_group_name": "genvidtech", "trusted_cidrs": [], "trusted_security_groups": [], "wingame_image_prefix": "genvidtech" }, "providers": { "providers": [ { "provider": "azurerm", "alias": null, "arguments": { "features": {} } } ] }, "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 \"azs\": \"${var.azs}\",\n \"cluster\": \"${var.cluster}\",\n \"datacenter\": \"${var.datacenter}\",\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 \"location\": \"${var.location}\",\n \"namespace\": \"${var.namespace}\",\n \"shared_gallery_image_version\": \"${var.shared_gallery_image_version}\",\n \"shared_gallery_name\": \"${var.shared_gallery_name}\",\n \"shared_gallery_resource_group_name\": \"${var.shared_gallery_resource_group_name}\",\n \"source\": \"..\\\\..\\\\..\\\\modules\\\\SDK-1.24.0\\\\basic\\\\azurerm_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 \"wingame_image_prefix\": \"${var.wingame_image_prefix}\"\n }\n },\n \"output\": {\n \"admin_username\": {\n \"value\": \"${module.cluster.admin_username}\"\n },\n \"cloud_provider\": {\n \"value\": \"${module.cluster.cloud_provider}\"\n },\n \"encoding_worker_public_ips\": {\n \"value\": \"${module.cluster.encoding_worker_public_ips}\"\n },\n \"game_admin_password\": {\n \"value\": \"${module.cluster.game_admin_password}\"\n },\n \"game_instance_ids\": {\n \"value\": \"${module.cluster.game_instance_ids}\"\n },\n \"game_machine_locations\": {\n \"value\": \"${module.cluster.game_machine_locations}\"\n },\n \"game_machine_names\": {\n \"value\": \"${module.cluster.game_machine_names}\"\n },\n \"game_public_ips\": {\n \"value\": \"${module.cluster.game_public_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_worker_public_ips\": {\n \"value\": \"${module.cluster.public_worker_public_ips}\"\n },\n \"resource_group_name\": {\n \"value\": \"${module.cluster.resource_group_name}\"\n },\n \"server_public_ips\": {\n \"value\": \"${module.cluster.server_public_ips}\"\n }\n },\n \"variable\": {\n \"admin_password\": {\n \"type\": \"string\",\n \"description\": \"Administrative password for the game machine.\\nThat password must respect default windows password complexity.\\n\",\n \"default\": \"1Genvid6!\"\n },\n \"azs\": {\n \"type\": \"list(number)\",\n \"description\": \"Enables multi-AZ, which automatically spans VMs across given availability zones. \\nEnabling this forces VMs to be rebuilt, due to their locations changing. An empty\\nlist disables multi-AZ. Options are 1, 2, 3\\n\",\n \"default\": []\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 \"instance_encoding_count\": {\n \"type\": \"number\",\n \"description\": \"Number of internal workers to spawn\",\n \"default\": 1\n },\n \"instance_encoding_type\": {\n \"type\": \"string\",\n \"description\": \"Type of Virtual Network to use for encoding servers\",\n \"default\": \"Standard_F8s_v2\"\n },\n \"instance_game_count\": {\n \"type\": \"number\",\n \"description\": \"Number of game instances to spawn\",\n \"default\": 1\n },\n \"instance_game_type\": {\n \"type\": \"string\",\n \"description\": \"Type of Virtual Network to use for game servers\",\n \"default\": \"Standard_NV6\"\n },\n \"instance_internal_count\": {\n \"type\": \"number\",\n \"description\": \"Number of internal workers to spawn\",\n \"default\": 1\n },\n \"instance_internal_type\": {\n \"type\": \"string\",\n \"description\": \"Type of Virtual Network to use for internal servers\",\n \"default\": \"Standard_B2s\"\n },\n \"instance_public_count\": {\n \"type\": \"number\",\n \"description\": \"Number of public workers to spawn\",\n \"default\": 1\n },\n \"instance_public_type\": {\n \"type\": \"string\",\n \"description\": \"Type of Virtual Network to use for public servers\",\n \"default\": \"Standard_B2s\"\n },\n \"instance_server_count\": {\n \"type\": \"number\",\n \"description\": \"the number of supervisor servers. Must be an odd number.\\n#It is usually 3 for production deployment.\\n\",\n \"default\": 1\n },\n \"instance_server_type\": {\n \"type\": \"string\",\n \"description\": \"Type of Virtual Network instance to use for admin servers\",\n \"default\": \"Standard_B2s\"\n },\n \"location\": {\n \"type\": \"string\",\n \"description\": \"Azure deployment location\",\n \"default\": \"East US\"\n },\n \"namespace\": {\n \"type\": \"string\",\n \"description\": \"Deployment namespace that will regroup the clusters\",\n \"default\": \"deployment\"\n },\n \"shared_gallery_image_version\": {\n \"type\": \"string\",\n \"description\": \"SDK Shared Image version, should be only one per Genvid SDK\",\n \"default\": \"1.25.0000\"\n },\n \"shared_gallery_name\": {\n \"type\": \"string\",\n \"description\": \"Shared Gallery Name\",\n \"default\": \"SDKgallery\"\n },\n \"shared_gallery_resource_group_name\": {\n \"type\": \"string\",\n \"description\": \"Shared Gallery Resource Group Name\",\n \"default\": \"Genvid\"\n },\n \"stage\": {\n \"type\": \"string\",\n \"description\": \"Deployment stage\",\n \"default\": \"dev\"\n },\n \"toolbox_location\": {\n \"type\": \"string\",\n \"description\": \"Genvid Toolbox Wheel file.\\nOnly required if you need to update the one from the .\\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(string)\",\n \"default\": []\n },\n \"trusted_security_groups\": {\n \"type\": \"list(string)\",\n \"description\": \"A list of security groups to be trusted.\",\n \"default\": []\n },\n \"wingame_image_prefix\": {\n \"type\": \"string\",\n \"description\": \"Prefix of the wingame image\",\n \"default\": \"default\"\n }\n }\n}", "bastionVersion": "", "terraformContextVersion": "1.27" }
- 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.
resourceCount (number) – The resource count of the cluster allocated through Terraform.
Example response:
{ "status": "VOID", "resourceCount": 0 }
- 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.
[].alias (string) – An optional provider alias.
[].meta.alias (string) – An optional provider alias. This property is Deprecated and has been moved to the top level.
[].meta.version (string) – Version constraint following Terraform’s syntax. This property is deprecated and will be removed.
[].arguments[key] – Type can be any of boolean,integer,number,object,string,null.
Example response:
[ { "name": "aws", "alias": "east", "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.
[].alias (string) – An optional provider alias.
[].meta.alias (string) – An optional provider alias. This property is Deprecated and has been moved to the top level.
[].meta.version (string) – Version constraint following Terraform’s syntax. This property is deprecated and will be removed.
[].arguments[key] – Type can be any of boolean,integer,number,object,string,null.
Example query:
[ { "name": "aws", "alias": "east", "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.
alias (string) – An optional provider alias.
meta.alias (string) – An optional provider alias. This property is Deprecated and has been moved to the top level.
meta.version (string) – Version constraint following Terraform’s syntax. This property is deprecated and will be removed.
arguments[key] – Type can be any of boolean,integer,number,object,string,null.
Example query:
{ "name": "aws", "alias": "east", "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.
alias (string) – An optional provider alias.
meta.alias (string) – An optional provider alias. This property is Deprecated and has been moved to the top level.
meta.version (string) – Version constraint following Terraform’s syntax. This property is deprecated and will be removed.
arguments[key] – Type can be any of boolean,integer,number,object,string,null.
Example response:
{ "name": "aws", "alias": "east", "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.
alias (string) – An optional provider alias.
meta.alias (string) – An optional provider alias. This property is Deprecated and has been moved to the top level.
meta.version (string) – Version constraint following Terraform’s syntax. This property is deprecated and will be removed.
arguments[key] – Type can be any of boolean,integer,number,object,string,null.
Example response:
{ "name": "aws", "alias": "east", "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" }
- POST /terraform/instance/{instanceID}/terminate/{commandID}
Terminate a command.
- Parameters:
instanceID – The instance ID. An opaque string.
commandID – The command ID. An opaque string.
- POST /terraform/instance/{instanceID}/kill/{commandID}
Kill a command.
- Parameters:
instanceID – The instance ID. An opaque string.
commandID – The command ID. An opaque string.
BastionIpInCidr
- GET /terraform/bastionIpInCidr
Checks if Bastion IP is in Trusted Cidr or Trusted Cidrs.
BastionHealth
- GET /terraform/bastionHealth
Checks bastion entities required to run it successfully and returns a json object to state the health.
- Response JSON Object:
healthOK (boolean) – Bastion health status
Example response:
{ "healthOK": "true" }