Skip to main content
Stores the state using a simple REST client. State will be fetched via GET, updated via POST, and purged with DELETE. The method used for updating is configurable. This backend optionally supports state locking. When locking support is enabled it will use LOCK and UNLOCK requests providing the lock info in the body. The endpoint should return a 423: Locked or 409: Conflict with the holding lock info when it’s already taken, 200: OK for success. Any other status will be considered an error. The ID of the holding lock info will be added as a query parameter to state updates requests. Read more about this backend in the Terraform docs: https://developer.hashicorp.com/terraform/language/settings/backends/http

Initializer

import "github.com/open-constructs/cdk-terrain-go/cdktn"

&cdktn.HttpBackendConfig {
	Address: *string,
	ClientCaCertificatePem: *string,
	ClientCertificatePem: *string,
	ClientPrivateKeyPem: *string,
	LockAddress: *string,
	LockMethod: *string,
	Password: *string,
	RetryMax: *f64,
	RetryWaitMax: *f64,
	RetryWaitMin: *f64,
	SkipCertVerification: *bool,
	UnlockAddress: *string,
	UnlockMethod: *string,
	UpdateMethod: *string,
	Username: *string,
}

Properties

NameTypeDescription
Address*string(Required) The address of the REST endpoint.
ClientCaCertificatePem*string(Optional) A PEM-encoded CA certificate chain used by the client to verify server certificates during TLS authentication.
ClientCertificatePem*string(Optional) A PEM-encoded certificate used by the server to verify the client during mutual TLS (mTLS) authentication.
ClientPrivateKeyPem*string(Optional) A PEM-encoded private key, required if client_certificate_pem is specified.
LockAddress*string(Optional) The address of the lock REST endpoint.
LockMethod*string(Optional) The HTTP method to use when locking.
Password*string(Optional) The password for HTTP basic authentication.
RetryMax*f64(Optional) The number of HTTP request retries.
RetryWaitMax*f64(Optional) The maximum time in seconds to wait between HTTP request attempts.
RetryWaitMin*f64(Optional) The minimum time in seconds to wait between HTTP request attempts.
SkipCertVerification*bool(Optional) Whether to skip TLS verification.
UnlockAddress*string(Optional) The address of the unlock REST endpoint.
UnlockMethod*string(Optional) The HTTP method to use when unlocking.
UpdateMethod*string(Optional) HTTP method to use when updating state.
Username*string(Optional) The username for HTTP basic authentication.

AddressRequired

Address *string
  • Type: *string
(Required) The address of the REST endpoint.

ClientCaCertificatePemOptional

ClientCaCertificatePem *string
  • Type: *string
(Optional) A PEM-encoded CA certificate chain used by the client to verify server certificates during TLS authentication.

ClientCertificatePemOptional

ClientCertificatePem *string
  • Type: *string
(Optional) A PEM-encoded certificate used by the server to verify the client during mutual TLS (mTLS) authentication.

ClientPrivateKeyPemOptional

ClientPrivateKeyPem *string
  • Type: *string
(Optional) A PEM-encoded private key, required if client_certificate_pem is specified.

LockAddressOptional

LockAddress *string
  • Type: *string
(Optional) The address of the lock REST endpoint. Defaults to disabled.

LockMethodOptional

LockMethod *string
  • Type: *string
(Optional) The HTTP method to use when locking. Defaults to LOCK.

PasswordOptional

Password *string
  • Type: *string
(Optional) The password for HTTP basic authentication.

RetryMaxOptional

RetryMax *f64
  • Type: *f64
(Optional) The number of HTTP request retries. Defaults to 2.

RetryWaitMaxOptional

RetryWaitMax *f64
  • Type: *f64
(Optional) The maximum time in seconds to wait between HTTP request attempts. Defaults to 30.

RetryWaitMinOptional

RetryWaitMin *f64
  • Type: *f64
(Optional) The minimum time in seconds to wait between HTTP request attempts. Defaults to 1.

SkipCertVerificationOptional

SkipCertVerification *bool
  • Type: *bool
(Optional) Whether to skip TLS verification. Defaults to false.

UnlockAddressOptional

UnlockAddress *string
  • Type: *string
(Optional) The address of the unlock REST endpoint. Defaults to disabled.

UnlockMethodOptional

UnlockMethod *string
  • Type: *string
(Optional) The HTTP method to use when unlocking. Defaults to UNLOCK.

UpdateMethodOptional

UpdateMethod *string
  • Type: *string
(Optional) HTTP method to use when updating state. Defaults to POST.

UsernameOptional

Username *string
  • Type: *string
(Optional) The username for HTTP basic authentication.