{% extends 'base.html' %} {% load base_extras %} {% block content %}

TF state {{ object.slug }}

{% if state_versions %}

{{ state_versions|length }} Version{{ state_versions|length|pluralize }}

{% for state_version in state_versions %} {% endfor %}
Created by Created at
{{ state_version.get_created_by_display }} {{ state_version.created_at }}
{% endif %}

HTTP backend configuration

You can use the following configuration block within the terraform block to use Zentral as HTTP state backend:

{% codeexample 'hcl' %} backend "http" { address = "https://{{ fqdn }}{% url 'terraform_api:backend_state' object %}" lock_address = "https://{{ fqdn }}{% url 'terraform_api:backend_lock' object %}" unlock_address = "https://{{ fqdn }}{% url 'terraform_api:backend_lock' object %}" lock_method = "POST" unlock_method = "DELETE" username = "Zentral username (user or service account)" password = "Zentral API token" } {% endcodeexample %}

You can also set a partial configuration:

{% codeexample 'hcl' %} backend "http" { address = "https://{{ fqdn }}{% url 'terraform_api:backend_state' object %}" lock_address = "https://{{ fqdn }}{% url 'terraform_api:backend_lock' object %}" unlock_address = "https://{{ fqdn }}{% url 'terraform_api:backend_lock' object %}" lock_method = "POST" unlock_method = "DELETE" } {% endcodeexample %}

The other arguments can be specified via the init command line:

{% codeexample 'bash' %} terraform init \ -backend-config="username=$ZTL_USERNAME" \ -backend-config="password=$ZTL_API_TOKEN" {% endcodeexample %} {% endblock %}