backend

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 19, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultAWSRegion is the AWS default region (legacy behavior for S3)
	DefaultAWSRegion = "us-east-1"
)

Variables

This section is empty.

Functions

func BackendTFPath

func BackendTFPath(terraformDir string) string

BackendTFPath returns the path where backend.tf should be written

func GenerateBackendTF

func GenerateBackendTF(cfg BackendTFConfig) string

GenerateBackendTF generates the backend.tf file content

func WriteBackendTF

func WriteBackendTF(terraformDir string, cfg BackendTFConfig) (string, error)

WriteBackendTF writes the backend.tf file to the terraform directory

Types

type BackendTFConfig

type BackendTFConfig struct {
	BucketName string
	Region     string
	Key        string
}

BackendTFConfig represents the configuration for generating backend.tf

type S3Manager

type S3Manager struct {
	// contains filtered or unexported fields
}

S3Manager handles S3 operations for Terraform state backend

func NewS3Manager

func NewS3Manager(ctx context.Context, region string) (*S3Manager, error)

NewS3Manager creates a new S3 manager

func (*S3Manager) BucketExists

func (m *S3Manager) BucketExists(ctx context.Context, bucketName string) (bool, error)

BucketExists checks if an S3 bucket exists

func (*S3Manager) CreateStateBucket

func (m *S3Manager) CreateStateBucket(ctx context.Context, bucketName string) (bool, error)

CreateStateBucket creates and configures an S3 bucket for Terraform state Returns true if the bucket was created, false if it already existed

func (*S3Manager) GetBucketLocation

func (m *S3Manager) GetBucketLocation(ctx context.Context, bucketName string) (string, error)

GetBucketLocation returns the AWS region where a bucket is located

func (*S3Manager) ListBuckets

func (m *S3Manager) ListBuckets(ctx context.Context) ([]string, error)

ListBuckets returns all S3 buckets in the account

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL