2017-03-21 22:24:29 +01:00
|
|
|
---
|
2017-03-21 22:50:17 +01:00
|
|
|
layout: "api"
|
|
|
|
page_title: "Terraform Configuration API"
|
|
|
|
sidebar_current: "docs-enterprise-api-configurations"
|
|
|
|
description: |-
|
2017-03-23 19:03:36 +01:00
|
|
|
A configuration represents settings associated with a resource that runs Terraform with versions of Terraform configuration..
|
2017-03-21 22:24:29 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
# Terraform Configuration API
|
|
|
|
|
2017-03-23 19:03:36 +01:00
|
|
|
A configuration represents settings associated with a resource that
|
2017-03-21 22:24:29 +01:00
|
|
|
runs Terraform with versions of Terraform configuration.
|
|
|
|
|
2017-03-23 00:23:08 +01:00
|
|
|
Configurations have many [configuration versions](/docs/enterprise/api/configuration-versions.html)
|
2017-03-21 22:24:29 +01:00
|
|
|
which represent versions of Terraform configuration templates and other associated
|
|
|
|
configuration.
|
|
|
|
|
|
|
|
### Configuration Attributes
|
|
|
|
|
2017-03-23 00:23:08 +01:00
|
|
|
<table class="apidocs">
|
2017-03-21 22:24:29 +01:00
|
|
|
<tr>
|
|
|
|
<th>Attribute</th>
|
|
|
|
<th>Description</th>
|
|
|
|
<th>Required</th>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><code>name</code></td>
|
|
|
|
<td>The name of the configuration, used to identify it. It
|
|
|
|
has a maximum length of 50 characters and must contain only
|
|
|
|
letters, numbers, dashes, underscores or periods.</td>
|
|
|
|
<td>Yes</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><code>username</code></td>
|
|
|
|
<td>The username to assign the configuration to. You must be a member of the
|
|
|
|
organization and have the ability to create the resource.</td>
|
|
|
|
<td>Yes</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
### Actions
|
|
|
|
|
2017-03-23 19:03:36 +01:00
|
|
|
The following actions can be performed on this resource.
|
2017-03-21 22:24:29 +01:00
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt>Show</dt>
|
|
|
|
<dd>GET /api/v1/terraform/configurations/:username/:name/versions/latest</dd>
|
|
|
|
<dt>Create</dt>
|
|
|
|
<dd>POST /api/v1/terraform/configurations</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
### Examples
|
|
|
|
|
|
|
|
#### Creating a configuration
|
|
|
|
|
|
|
|
Creates a configuration with the provided attributes.
|
|
|
|
|
|
|
|
$ curl %{ATLAS_URL}/api/v1/terraform/configurations \
|
|
|
|
-X POST \
|
|
|
|
-H "X-Atlas-Token: $ATLAS_TOKEN" \
|
|
|
|
-d configuration[name]='test' \
|
|
|
|
-d configuration[username]='%{DEFAULT_USERNAME}'
|
|
|
|
|
|
|
|
#### Retrieving a configuration
|
|
|
|
|
2017-03-23 19:03:36 +01:00
|
|
|
Returns the JSON representation of the latest configuration.
|
2017-03-21 22:24:29 +01:00
|
|
|
|
|
|
|
$ curl %{ATLAS_URL}/api/v1/terraform/configurations/%{DEFAULT_USERNAME}/test/versions/latest \
|
|
|
|
-H "X-Atlas-Token: $ATLAS_TOKEN"
|