Documentation ¶
Index ¶
- func NewAzurermBlobBackend(ctx context.Context, config TfStackConfig) interfaces.TerraformWorkspace
- func NewGCSBackend(ctx context.Context, config TfStackConfig) interfaces.TerraformWorkspace
- func NewS3Backend(ctx context.Context, config TfStackConfig) interfaces.TerraformWorkspace
- func NewTerraformCloud(ctx context.Context, config TfStackConfig) interfaces.TerraformWorkspace
- type AWSCredentials
- type AzureBackendBlock
- type AzureBlobBackend
- type AzureCredentials
- type Factory
- type GCSBackend
- type GCSBackendBlock
- type IsolatedTerraformWorkspace
- type S3Backend
- type S3BackendBlock
- type TerraformCloud
- type TfStackConfig
- type WorkspaceDirectoriesDecoder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAzurermBlobBackend ¶
func NewAzurermBlobBackend(ctx context.Context, config TfStackConfig) interfaces.TerraformWorkspace
NewAzurermBlobBackend creates a new AzureBlobBackend instance.
func NewGCSBackend ¶
func NewGCSBackend(ctx context.Context, config TfStackConfig) interfaces.TerraformWorkspace
NewGCSBackend creates a new GCSBackend instance.
func NewS3Backend ¶
func NewS3Backend(ctx context.Context, config TfStackConfig) interfaces.TerraformWorkspace
NewS3Backend creates a new instance of the TerraformCloud struct.
func NewTerraformCloud ¶
func NewTerraformCloud(ctx context.Context, config TfStackConfig) interfaces.TerraformWorkspace
NewTerraformCloud creates a new instance of the TerraformCloud struct.
Types ¶
type AWSCredentials ¶
type AWSCredentials struct { AWSAccessKeyID string `json:"awsAccessKeyID"` AWSSecretKeyAccess string `json:"awsSecretAccessKey"` Token string `json:"token"` }
AWSCredentials is a struct that contains the AWS credentials for a specific workspace.
type AzureBackendBlock ¶
type AzureBackendBlock struct { ResourceGroupName string StorageAccountName string ContainerName string Key string }
AzureBackendBlock is a struct representation of a terraform backend block for azurerm
type AzureBlobBackend ¶
type AzureBlobBackend struct {
// contains filtered or unexported fields
}
AzureBlobBackend is an implementation of the interfaces.TerraformWorkspace interface that uses Azure Blob Storage as the backend.
func (*AzureBlobBackend) DownloadWorkspaceState ¶
func (b *AzureBlobBackend) DownloadWorkspaceState(ctx context.Context, workspaceToDirectory map[string]string) error
DownloadWorkspaceState downloads from the remote Azure Blob Storage backend the latest state file
func (*AzureBlobBackend) FindTerraformWorkspaces ¶
FindTerraformWorkspaces returns a map of Terraform workspace names to their respective directories.
type AzureCredentials ¶
type AzureCredentials struct {
AzureStorageAccountKey string `json:"azure_storage_account_key"`
}
AzureCredentials is a struct that holds the credentials for an Azure Blob Storage backend.
type Factory ¶
type Factory struct{}
Factory is a struct that generates implementations of interfaces.TerraformWorkspace.
func (*Factory) Instantiate ¶
func (f *Factory) Instantiate(ctx context.Context, environment string, tfConfig TfStackConfig) (interfaces.TerraformWorkspace, error)
Instantiate returns an implementation of the interfaces.TerraformWorkspace interface depending on the passed environment specification.
type GCSBackend ¶
type GCSBackend struct {
// contains filtered or unexported fields
}
GCSBackend is an implementation of the interfaces.TerraformWorkspace interface that uses GCS as a backend.
func (*GCSBackend) DownloadWorkspaceState ¶
func (b *GCSBackend) DownloadWorkspaceState(ctx context.Context, workspaceToDirectory map[string]string) error
DownloadWorkspaceState downloads from the remote Azure Blob Storage backend the latest state file
func (*GCSBackend) FindTerraformWorkspaces ¶
FindTerraformWorkspaces returns a map of Terraform workspace names to their respective directories.
type GCSBackendBlock ¶
GCSBackendBlock parses the backend block for GCS
type IsolatedTerraformWorkspace ¶
type IsolatedTerraformWorkspace struct{}
IsolatedTerraformWorkspace is a struct that implements the interfaces.TerraformWorkspace interface for the purpose of end-to-end testing.
func NewIsolatedTerraformWorkspace ¶
func NewIsolatedTerraformWorkspace() *IsolatedTerraformWorkspace
NewIsolatedTerraformWorkspace returns a new instance of IsolatedTerraformWorkspace
func (*IsolatedTerraformWorkspace) DownloadWorkspaceState ¶
func (v *IsolatedTerraformWorkspace) DownloadWorkspaceState(_ context.Context, _ map[string]string) error
DownloadWorkspaceState downloads from the remote TerraformCloudFile backend the latest state file for each "workspace".
func (*IsolatedTerraformWorkspace) FindTerraformWorkspaces ¶
type S3Backend ¶
type S3Backend struct {
// contains filtered or unexported fields
}
type S3BackendBlock ¶
S3BackendBlock is a struct representation of a terraform backend block for s3
type TerraformCloud ¶
type TerraformCloud struct {
// contains filtered or unexported fields
}
TerraformCloud is a struct that implements the interfaces.TerraformWorkspace interface.
func (*TerraformCloud) DownloadWorkspaceState ¶
func (c *TerraformCloud) DownloadWorkspaceState(ctx context.Context, WorkspaceToDirectory map[string]string) error
DownloadWorkspaceState downloads from the remote TerraformCloudFile backend the latest state file for each "workspace".
func (*TerraformCloud) FindTerraformWorkspaces ¶
type TfStackConfig ¶
type TfStackConfig struct { // Region is the region of that contains the state storage bucket (or container if Azure). Region string // CloudCredential is a cloud credential that is used to authenticate with a cloud provider. Credential should // only require read-only access. CloudCredential terraformValueObjects.Credential // StateBackend is the name of the backend used for storing State. StateBackend string // TerraformCloudOrganization is the name of the organization within TerraformCloudFile Cloud TerraformCloudOrganization string // TerraformCloudToken is the auth token to access TerraformCloudFile Cloud programmatically. TerraformCloudToken string // WorkspaceDirectories is a slice of directories that contains terraform workspaces within the user repo. WorkspaceDirectories WorkspaceDirectoriesDecoder }
TfStackConfig is a struct containing the variables that define the Terraform operating environment (backend, workspaces, etc.).
type WorkspaceDirectoriesDecoder ¶
type WorkspaceDirectoriesDecoder []string
func (*WorkspaceDirectoriesDecoder) Decode ¶
func (d *WorkspaceDirectoriesDecoder) Decode(value string) error