importer

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MPL-2.0 Imports: 17 Imported by: 0

README

Polytomic Importer

The polytomic terraform importer can be used to migrate existing polytomic resources into terraform.

Installation

Download the appropriate binary for you architecture from the Releases page.

Usage

./polytomic-importer run --api-key $POLYTOMIC_API_KEY --output terraform-imports --replace

Documentation

Index

Constants

View Source
const (
	BulkSyncResourceFileName = "bulk_syncs.tf"
	BulkSyncResource         = "polytomic_bulk_sync"
)
View Source
const (
	ModelsResourceFileName = "models.tf"
	ModelResource          = "polytomic_model"
)
View Source
const (
	SyncResourceFileName = "syncs.tf"
	SyncResource         = "polytomic_sync"
)
View Source
const (
	ConnectionsResourceFileName = "connections.tf"
)
View Source
const (
	ImportFileName = "import.sh"
)

Variables

This section is empty.

Functions

func Init

func Init(url, key, path string, recreate bool)

Types

type BulkSyncs

type BulkSyncs struct {
	Resources []polytomic.BulkSyncResponse
	// contains filtered or unexported fields
}

func NewBulkSyncs

func NewBulkSyncs(c *polytomic.Client) *BulkSyncs

func (*BulkSyncs) Filename

func (b *BulkSyncs) Filename() string

func (*BulkSyncs) GenerateImports

func (b *BulkSyncs) GenerateImports(ctx context.Context, writer io.Writer) error

func (*BulkSyncs) GenerateTerraformFiles

func (b *BulkSyncs) GenerateTerraformFiles(ctx context.Context, writer io.Writer) error

func (*BulkSyncs) Init

func (b *BulkSyncs) Init(ctx context.Context) error

type Connection

type Connection struct {
	ID            string
	Type          string
	Resource      string
	Name          string
	Organization  string
	Configuration interface{}
}

type Connections

type Connections struct {
	Resources []Connection
	// contains filtered or unexported fields
}

func NewConnections

func NewConnections(c *polytomic.Client) *Connections

func (*Connections) Filename

func (c *Connections) Filename() string

func (*Connections) GenerateImports

func (c *Connections) GenerateImports(ctx context.Context, writer io.Writer) error

func (*Connections) GenerateTerraformFiles

func (c *Connections) GenerateTerraformFiles(ctx context.Context, writer io.Writer) error

func (*Connections) Init

func (c *Connections) Init(ctx context.Context) error

type Importable

type Importable interface {
	Init(ctx context.Context) error
	GenerateTerraformFiles(ctx context.Context, writer io.Writer) error
	GenerateImports(ctx context.Context, writer io.Writer) error
	Filename() string
}

type Main

type Main struct {
	URL    string
	APIKey string
}

func NewMain

func NewMain() *Main

func (*Main) Filename

func (m *Main) Filename() string

func (*Main) GenerateImports

func (m *Main) GenerateImports(ctx context.Context, writer io.Writer) error

func (*Main) GenerateTerraformFiles

func (m *Main) GenerateTerraformFiles(ctx context.Context, writer io.Writer) error

func (*Main) Init

func (m *Main) Init(ctx context.Context) error

type Models

type Models struct {
	Resources []*polytomic.Model
	// contains filtered or unexported fields
}

func NewModels

func NewModels(c *polytomic.Client) *Models

func (*Models) Filename

func (m *Models) Filename() string

func (*Models) GenerateImports

func (m *Models) GenerateImports(ctx context.Context, writer io.Writer) error

func (*Models) GenerateTerraformFiles

func (m *Models) GenerateTerraformFiles(ctx context.Context, writer io.Writer) error

func (*Models) Init

func (m *Models) Init(ctx context.Context) error

type Syncs

type Syncs struct {
	Resources []polytomic.SyncResponse
	// contains filtered or unexported fields
}

func NewSyncs

func NewSyncs(c *polytomic.Client) *Syncs

func (*Syncs) Filename

func (s *Syncs) Filename() string

func (*Syncs) GenerateImports

func (s *Syncs) GenerateImports(ctx context.Context, writer io.Writer) error

func (*Syncs) GenerateTerraformFiles

func (s *Syncs) GenerateTerraformFiles(ctx context.Context, writer io.Writer) error

func (*Syncs) Init

func (s *Syncs) Init(ctx context.Context) error

Jump to

Keyboard shortcuts

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