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 cdktn

cdktn.HttpBackendConfig(
  address: str,
  client_ca_certificate_pem: str = None,
  client_certificate_pem: str = None,
  client_private_key_pem: str = None,
  lock_address: str = None,
  lock_method: str = None,
  password: str = None,
  retry_max: typing.Union[int, float] = None,
  retry_wait_max: typing.Union[int, float] = None,
  retry_wait_min: typing.Union[int, float] = None,
  skip_cert_verification: bool = None,
  unlock_address: str = None,
  unlock_method: str = None,
  update_method: str = None,
  username: str = None
)

Properties

NameTypeDescription
addressstr(Required) The address of the REST endpoint.
client_ca_certificate_pemstr(Optional) A PEM-encoded CA certificate chain used by the client to verify server certificates during TLS authentication.
client_certificate_pemstr(Optional) A PEM-encoded certificate used by the server to verify the client during mutual TLS (mTLS) authentication.
client_private_key_pemstr(Optional) A PEM-encoded private key, required if client_certificate_pem is specified.
lock_addressstr(Optional) The address of the lock REST endpoint.
lock_methodstr(Optional) The HTTP method to use when locking.
passwordstr(Optional) The password for HTTP basic authentication.
retry_maxtyping.Union[int, float](Optional) The number of HTTP request retries.
retry_wait_maxtyping.Union[int, float](Optional) The maximum time in seconds to wait between HTTP request attempts.
retry_wait_mintyping.Union[int, float](Optional) The minimum time in seconds to wait between HTTP request attempts.
skip_cert_verificationbool(Optional) Whether to skip TLS verification.
unlock_addressstr(Optional) The address of the unlock REST endpoint.
unlock_methodstr(Optional) The HTTP method to use when unlocking.
update_methodstr(Optional) HTTP method to use when updating state.
usernamestr(Optional) The username for HTTP basic authentication.

addressRequired

address: str
  • Type: str
(Required) The address of the REST endpoint.

client_ca_certificate_pemOptional

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

client_certificate_pemOptional

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

client_private_key_pemOptional

client_private_key_pem: str
  • Type: str
(Optional) A PEM-encoded private key, required if client_certificate_pem is specified.

lock_addressOptional

lock_address: str
  • Type: str
(Optional) The address of the lock REST endpoint. Defaults to disabled.

lock_methodOptional

lock_method: str
  • Type: str
(Optional) The HTTP method to use when locking. Defaults to LOCK.

passwordOptional

password: str
  • Type: str
(Optional) The password for HTTP basic authentication.

retry_maxOptional

retry_max: typing.Union[int, float]
  • Type: typing.Union[int, float]
(Optional) The number of HTTP request retries. Defaults to 2.

retry_wait_maxOptional

retry_wait_max: typing.Union[int, float]
  • Type: typing.Union[int, float]
(Optional) The maximum time in seconds to wait between HTTP request attempts. Defaults to 30.

retry_wait_minOptional

retry_wait_min: typing.Union[int, float]
  • Type: typing.Union[int, float]
(Optional) The minimum time in seconds to wait between HTTP request attempts. Defaults to 1.

skip_cert_verificationOptional

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

unlock_addressOptional

unlock_address: str
  • Type: str
(Optional) The address of the unlock REST endpoint. Defaults to disabled.

unlock_methodOptional

unlock_method: str
  • Type: str
(Optional) The HTTP method to use when unlocking. Defaults to UNLOCK.

update_methodOptional

update_method: str
  • Type: str
(Optional) HTTP method to use when updating state. Defaults to POST.

usernameOptional

username: str
  • Type: str
(Optional) The username for HTTP basic authentication.