Documentation ¶
Overview ¶
Package variable manages terraform workspace variables
Index ¶
Constants ¶
View Source
const ( // https://developer.hashicorp.com/terraform/cloud-docs/workspaces/variables/managing-variables#character-limits VariableDescriptionMaxChars = 512 VariableKeyMaxChars = 128 VariableValueMaxKB = 256 // 256*1024 bytes CategoryTerraform VariableCategory = "terraform" CategoryEnv VariableCategory = "env" )
Variables ¶
View Source
var ( ErrVariableDescriptionMaxExceeded = fmt.Errorf("maximum variable description size (%d chars) exceeded", VariableDescriptionMaxChars) ErrVariableKeyMaxExceeded = fmt.Errorf("maximum variable key size (%d chars) exceeded", VariableKeyMaxChars) ErrVariableValueMaxExceeded = fmt.Errorf("maximum variable value size of %d KB exceeded", VariableValueMaxKB) )
Functions ¶
func NewService ¶
func NewService(opts Options) *service
func WriteTerraformVars ¶
WriteTerraformVars writes workspace variables to a file named terraform.tfvars located in the given path. If the file already exists it'll be appended to.
Types ¶
type Client ¶
type Client struct {
internal.JSONAPIClient
}
type CreateVariableOptions ¶
type Service ¶
type Service interface { CreateVariable(ctx context.Context, workspaceID string, opts CreateVariableOptions) (*Variable, error) ListVariables(ctx context.Context, workspaceID string) ([]*Variable, error) GetVariable(ctx context.Context, variableID string) (*Variable, error) UpdateVariable(ctx context.Context, variableID string, opts UpdateVariableOptions) (*Variable, error) DeleteVariable(ctx context.Context, variableID string) (*Variable, error) }
type UpdateVariableOptions ¶
type Variable ¶
type Variable struct { ID string Key string Value string Description string Category VariableCategory Sensitive bool HCL bool WorkspaceID string }
func NewTestVariable ¶
func NewTestVariable(t *testing.T, workspaceID string, opts CreateVariableOptions) *Variable
func NewVariable ¶
func NewVariable(workspaceID string, opts CreateVariableOptions) (*Variable, error)
func (*Variable) Update ¶
func (v *Variable) Update(opts UpdateVariableOptions) error
type VariableCategory ¶
type VariableCategory string
VariableCategory is the category of variable
func VariableCategoryPtr ¶
func VariableCategoryPtr(v VariableCategory) *VariableCategory
VariableCategoryPtr returns a pointer to the given category type.
type VariableService ¶
type VariableService = Service
Click to show internal directories.
Click to hide internal directories.