terraformify

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Bold = color.New(color.Bold).SprintFunc()
View Source
var BoldGreen = color.New(color.Bold, color.FgGreen).SprintFunc()
View Source
var (
	ErrInvalidLogEndpoint = errors.New("Invalid log endpoint")
)

Functions

func CheckDirEmpty

func CheckDirEmpty(path string) error

func CreateInitTerraformFiles

func CreateInitTerraformFiles(c Config) (*os.File, error)

func CreateLogFilter

func CreateLogFilter() io.Writer

func FetchAssetsViaFastlyAPI

func FetchAssetsViaFastlyAPI(props []TFBlockProp, c Config) error

func RewriteResources

func RewriteResources(rawHCL string, serviceProp *VCLServiceResourceProp) ([]byte, error)

func TerraformImport

func TerraformImport(tf *tfexec.Terraform, prop TFBlockProp, f io.Writer) error

func TerraformInit

func TerraformInit(tf *tfexec.Terraform) error

func TerraformInstall

func TerraformInstall(workingDir string) (*tfexec.Terraform, error)

func TerraformShow

func TerraformShow(tf *tfexec.Terraform) (string, error)

func YesNo

func YesNo(message string) (bool, error)

Types

type ACLResourceProp

type ACLResourceProp struct {
	ID   string
	Name string
	No   int
	*VCLServiceResourceProp
}

func NewACLResourceProp

func NewACLResourceProp(id, name string, sr *VCLServiceResourceProp) *ACLResourceProp

func (*ACLResourceProp) GetID

func (a *ACLResourceProp) GetID() string

func (*ACLResourceProp) GetIDforTFImport

func (a *ACLResourceProp) GetIDforTFImport() string

func (*ACLResourceProp) GetName

func (a *ACLResourceProp) GetName() string

func (*ACLResourceProp) GetNormalizedName

func (a *ACLResourceProp) GetNormalizedName() string

func (*ACLResourceProp) GetRef

func (a *ACLResourceProp) GetRef() string

func (*ACLResourceProp) GetType

func (a *ACLResourceProp) GetType() string

type Config

type Config struct {
	ID          string
	Version     int
	Directory   string
	Interactive bool
	Client      *fastly.Client
}

type DictionaryResourceProp

type DictionaryResourceProp struct {
	ID   string
	Name string
	*VCLServiceResourceProp
}

func NewDictionaryResourceProp

func NewDictionaryResourceProp(id, name string, sr *VCLServiceResourceProp) *DictionaryResourceProp

func (*DictionaryResourceProp) GetID

func (d *DictionaryResourceProp) GetID() string

func (*DictionaryResourceProp) GetIDforTFImport

func (d *DictionaryResourceProp) GetIDforTFImport() string

func (*DictionaryResourceProp) GetName

func (d *DictionaryResourceProp) GetName() string

func (*DictionaryResourceProp) GetNormalizedName

func (d *DictionaryResourceProp) GetNormalizedName() string

func (*DictionaryResourceProp) GetRef

func (d *DictionaryResourceProp) GetRef() string

func (*DictionaryResourceProp) GetType

func (d *DictionaryResourceProp) GetType() string

type DynamicSnippetResourceProp

type DynamicSnippetResourceProp struct {
	ID   string
	Name string
	*VCLServiceResourceProp
}

func NewDynamicSnippetResourceProp

func NewDynamicSnippetResourceProp(id, name string, sr *VCLServiceResourceProp) *DynamicSnippetResourceProp

func (*DynamicSnippetResourceProp) GetID

func (ds *DynamicSnippetResourceProp) GetID() string

func (*DynamicSnippetResourceProp) GetIDforTFImport

func (ds *DynamicSnippetResourceProp) GetIDforTFImport() string

func (*DynamicSnippetResourceProp) GetName

func (ds *DynamicSnippetResourceProp) GetName() string

func (*DynamicSnippetResourceProp) GetNormalizedName

func (ds *DynamicSnippetResourceProp) GetNormalizedName() string

func (*DynamicSnippetResourceProp) GetRef

func (ds *DynamicSnippetResourceProp) GetRef() string

func (*DynamicSnippetResourceProp) GetType

func (ds *DynamicSnippetResourceProp) GetType() string

type LoggingBlockProp

type LoggingBlockProp struct {
	Name         string
	EndpointType string
	IsJSON       bool
	*VCLServiceResourceProp
}

func NewLoggingBlockProp

func NewLoggingBlockProp(name, endpointType string, isJSON bool, sr *VCLServiceResourceProp) *LoggingBlockProp

func (*LoggingBlockProp) GetEndpointType

func (l *LoggingBlockProp) GetEndpointType() string

func (*LoggingBlockProp) GetName

func (l *LoggingBlockProp) GetName() string

func (*LoggingBlockProp) GetNormalizedName

func (l *LoggingBlockProp) GetNormalizedName() string

type SnippetBlockProp

type SnippetBlockProp struct {
	Name string
	*VCLServiceResourceProp
}

func NewSnippetBlockProp

func NewSnippetBlockProp(name string, sr *VCLServiceResourceProp) *SnippetBlockProp

func (*SnippetBlockProp) GetName

func (s *SnippetBlockProp) GetName() string

func (*SnippetBlockProp) GetNormalizedName

func (s *SnippetBlockProp) GetNormalizedName() string

func (*SnippetBlockProp) GetType

func (s *SnippetBlockProp) GetType() string

type TFBlockProp

type TFBlockProp interface {
	GetType() string
	GetID() string
	GetIDforTFImport() string
	GetNormalizedName() string
	GetRef() string
}

func ParseVCLServiceResource

func ParseVCLServiceResource(serviceProp *VCLServiceResourceProp, rawHCL string) ([]TFBlockProp, error)

type VCLBlockProp

type VCLBlockProp struct {
	Name string
	*VCLServiceResourceProp
}

func NewVCLBlockProp

func NewVCLBlockProp(name string, sr *VCLServiceResourceProp) *VCLBlockProp

func (*VCLBlockProp) GetName

func (v *VCLBlockProp) GetName() string

func (*VCLBlockProp) GetNormalizedName

func (v *VCLBlockProp) GetNormalizedName() string

func (*VCLBlockProp) GetType

func (v *VCLBlockProp) GetType() string

type VCLServiceResourceProp

type VCLServiceResourceProp struct {
	ID            string
	Name          string
	Version       int
	TargetVersion int
}

func NewVCLServiceResourceProp

func NewVCLServiceResourceProp(id, name string, version, targetversion int) *VCLServiceResourceProp

func (*VCLServiceResourceProp) GetID

func (v *VCLServiceResourceProp) GetID() string

func (*VCLServiceResourceProp) GetIDforTFImport

func (v *VCLServiceResourceProp) GetIDforTFImport() string

func (*VCLServiceResourceProp) GetName

func (v *VCLServiceResourceProp) GetName() string

func (*VCLServiceResourceProp) GetNormalizedName

func (v *VCLServiceResourceProp) GetNormalizedName() string

func (*VCLServiceResourceProp) GetRef

func (v *VCLServiceResourceProp) GetRef() string

func (*VCLServiceResourceProp) GetType

func (v *VCLServiceResourceProp) GetType() string

func (*VCLServiceResourceProp) GetVersion

func (v *VCLServiceResourceProp) GetVersion() int

type WAFResourceProp

type WAFResourceProp struct {
	ID   string
	Name string
	*VCLServiceResourceProp
}

func NewWAFResourceProp

func NewWAFResourceProp(id string, sr *VCLServiceResourceProp) *WAFResourceProp

func (*WAFResourceProp) GetID

func (w *WAFResourceProp) GetID() string

func (*WAFResourceProp) GetIDforTFImport

func (w *WAFResourceProp) GetIDforTFImport() string

func (*WAFResourceProp) GetName

func (w *WAFResourceProp) GetName() string

func (*WAFResourceProp) GetNormalizedName

func (w *WAFResourceProp) GetNormalizedName() string

func (*WAFResourceProp) GetRef

func (w *WAFResourceProp) GetRef() string

func (*WAFResourceProp) GetType

func (w *WAFResourceProp) GetType() string

Jump to

Keyboard shortcuts

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