setuptf

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPersistent

func ApplyPersistent(
	ctx context.Context,
	projectID string,
	autoApprove bool,
	logger *log.Logger,
) error

Create persistent resources (in tf/persistent) that are used across tests. No cleanup is required

Types

type PubsubInfo

type PubsubInfo struct {
	RequestTopic  TopicInfo `json:"request_topic"`
	ResponseTopic TopicInfo `json:"response_topic"`
}

func SetupTf

func SetupTf(
	ctx context.Context,
	projectID string,
	testRunID string,
	tfDir string,
	tfVars map[string]string,
	logger *log.Logger,
) (*PubsubInfo, func(), error)

Runs the sequence of terraform commands most environemnts need, returns the output bytes of `terraform output -json` and a cleanup function to teardown the created resources.

1. Run terraform init 2. Create a new terraform workspace for the test run ID 3. Run terraform apply 4. Get output results from terraform output

Cleanup method runs terraform destroy and then deletes the workspace.

type SubscriptionMode

type SubscriptionMode string
const (
	Push SubscriptionMode = "push"
	Pull SubscriptionMode = "pull"
)

type TopicInfo

type TopicInfo struct {
	TopicName        string `json:"topic_name"`
	SubscriptionName string `json:"subscription_name"`
}

Jump to

Keyboard shortcuts

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