Bastion API for global

Bastion API documentation for global

Global

GET /bastion/global

Get the global config

Response JSON Object:
 
  • bastionID (string) – The Bastion ID. Must be between 3 and 32 characters long, contain only lowercase letters, numbers, or hyphens, and start with a letter.
  • instanceID (string) – Deprecated since 1.14.0.
  • source (string) – Deprecated since 1.14.0.

Example response:

{
  "bastionID": "",
  "instanceID": "",
  "source": ""
}
POST /bastion/global

Set the global config. This operation will be rejected if the terraform instance is not destroyed

Request JSON Object:
 
  • bastionID (string) – The Bastion ID. Must be between 3 and 32 characters long, contain only lowercase letters, numbers, or hyphens, and start with a letter.
  • instanceID (string) – Deprecated since 1.14.0.
  • source (string) – Deprecated since 1.14.0.

Example query:

{
  "bastionID": "",
  "instanceID": "",
  "source": ""
}
GET /bastion/global/tfvars

Get the global tfvars.

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 /bastion/global/tfvars

Set the global tfvars.

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": []
}
DELETE /bastion/global/tfvars

Delete the global tfvars.

Terraform

GET /bastion/global/providers

Get the global default provider configurations. This information is retrieved from Consul.

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 /bastion/global/providers

Override the global default provider configurations. This information is also stored in Consul.

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 /bastion/global/providers

Remove the global default provider configurations. This information is wiped from Consul.

PUT /bastion/global/provider

Add or override a global default provider configuration. This information is stored in Consul.

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 /bastion/global/provider/{providerName}

Get the Terraform default provider arguments (unaliased provider). This information is retrieved from Consul.

Parameters:
  • 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 /bastion/global/provider/{providerName}

Remove the Terraform default provider and all its arguments (unaliased provider). This information is removed from Consul.

Parameters:
  • providerName – A Terraform provider name.
GET /bastion/global/provider/{providerName}/{providerAlias}

Get the Terraform default arguments. This information is retrieved from Consul.

Parameters:
  • 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 /bastion/global/provider/{providerName}/{providerAlias}

Remove the Terraform default provider and all its arguments. This information is removed from Consul.

Parameters:
  • providerName – A Terraform provider name.
  • providerAlias – A Terraform provider alias.

Config

POST /bastion/global/template_renderer

Render a template with consul-template in the context of the cluster. A GENVID_TEMPLATE_SANDBOX_PATH is set to the location of where the sources are copied.

New in version 1.33.0.

Request JSON Object:
 
  • sources (string) – A go-getter (https://github.com/hashicorp/go-getter) compatible url accessible by the cluster that contains the template files.
  • templatePath (string) – The path of the template file to render in the sources archives.
  • content (string) – The content of the template. If this field is provided, the templatePath will be ignored.
  • environment[key] (string) – the value of the environment variable
Response JSON Object:
 
  • data (string) – The rendered template.
  • stderr (string) – The logs of the rendering.

Example query:

{
  "sources": "s3://artifacts/templates/archive.zip",
  "templatePath": "template.tmpl",
  "environment": {
    "FAVORITE_COLOR": "blue",
    "SPEED_UNLADEN_SWALLOW": "NaN"
  }
}

Example response:

{
  "data": "127.0.0.1"
}