Documentation ¶
Index ¶
Constants ¶
View Source
const ( // TerraformStateNameInSecret is the key name to store Terraform state TerraformStateNameInSecret = "tfstate" // TFBackendSecret is the Secret name for Kubernetes backend TFBackendSecret = "tfstate-%s-%s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { // HCL can get the hcl code string HCL() string // GetTFStateJSON is used to get the Terraform state json from backend GetTFStateJSON(ctx context.Context) ([]byte, error) // CleanUp is used to clean up the backend when delete the configuration object // For example, if the configuration use kubernetes backend, CleanUp will delete the backend secret CleanUp(ctx context.Context) error }
Backend is an abstraction of what all backend types can do
type K8SBackend ¶
type K8SBackend struct { // Client is used to interact with the Kubernetes apiServer Client client.Client // HCLCode stores the backend hcl code string HCLCode string // SecretSuffix is the suffix of the name of the Terraform backend secret SecretSuffix string // SecretNS is the namespace of the Terraform backend secret SecretNS string // LegacySecretSuffix is the same as SecretSuffix, but only used when `--controller-namespace` is specified LegacySecretSuffix string }
K8SBackend is used to interact with the Terraform kubernetes backend
func (*K8SBackend) CleanUp ¶
func (k *K8SBackend) CleanUp(ctx context.Context) error
CleanUp will delete the Terraform kubernetes backend secret when deleting the configuration object
func (*K8SBackend) GetTFStateJSON ¶
func (k *K8SBackend) GetTFStateJSON(ctx context.Context) ([]byte, error)
GetTFStateJSON gets Terraform state json from the Terraform kubernetes backend
type S3Backend ¶ added in v0.7.4
type S3Backend struct { Region string Key string Bucket string // contains filtered or unexported fields }
S3Backend is used to interact with the Terraform s3 backend
func (*S3Backend) CleanUp ¶ added in v0.7.4
CleanUp will delete the s3 object which contains the Terraform state
func (*S3Backend) GetTFStateJSON ¶ added in v0.7.4
GetTFStateJSON gets Terraform state json from the Terraform s3 backend
Click to show internal directories.
Click to hide internal directories.