importer

package
v0.3.39 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MPL-2.0 Imports: 28 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 (
	PoliciesResourceFileName = "policies.tf"
	PolicyResource           = "polytomic_policy"
)
View Source
const (
	RolesResourceFileName = "roles.tf"
	RoleResource          = "polytomic_role"
)
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, includePermissions bool)

func ReplaceRefs added in v0.3.19

func ReplaceRefs(b []byte, refs map[string]string) []byte

ReplaceRefs takes in an array of bytes and a map of references It will parse the array of bytes and replace any reference byte sequences with the value from the map.

Types

type BulkSyncs

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

func NewBulkSyncs

func NewBulkSyncs(c *ptclient.Client) *BulkSyncs

func (*BulkSyncs) DatasourceRefs added in v0.3.19

func (b *BulkSyncs) DatasourceRefs() map[string]string

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, refs map[string]string) error

func (*BulkSyncs) Init

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

func (*BulkSyncs) ResourceRefs added in v0.3.19

func (b *BulkSyncs) ResourceRefs() map[string]string

func (*BulkSyncs) Variables added in v0.3.33

func (b *BulkSyncs) Variables() []Variable

type Connection

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

type Connections

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

func NewConnections

func NewConnections(c *ptclient.Client) *Connections

func (*Connections) DatasourceRefs added in v0.3.19

func (c *Connections) DatasourceRefs() map[string]string

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, refs map[string]string) error

func (*Connections) Init

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

func (*Connections) ResourceRefs added in v0.3.19

func (c *Connections) ResourceRefs() map[string]string

func (*Connections) Variables added in v0.3.33

func (c *Connections) Variables() []Variable

type Importable

type Importable interface {
	Init(ctx context.Context) error
	ResourceRefs() map[string]string
	DatasourceRefs() map[string]string
	GenerateTerraformFiles(ctx context.Context, writer io.Writer, refs map[string]string) error
	GenerateImports(ctx context.Context, writer io.Writer) error
	Filename() string
	Variables() []Variable
}

type Main

type Main struct {
	URL         string
	APIKey      string
	WriteAPIKey bool
}

func NewMain

func NewMain() *Main

func (*Main) DatasourceRefs added in v0.3.19

func (m *Main) DatasourceRefs() map[string]string

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, refs map[string]string) error

func (*Main) Init

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

func (*Main) ResourceRefs added in v0.3.19

func (m *Main) ResourceRefs() map[string]string

func (*Main) Variables added in v0.3.33

func (m *Main) Variables() []Variable

type Models

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

func NewModels

func NewModels(c *ptclient.Client) *Models

func (*Models) DatasourceRefs added in v0.3.19

func (m *Models) DatasourceRefs() map[string]string

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, refs map[string]string) error

func (*Models) Init

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

func (*Models) ResourceRefs added in v0.3.19

func (m *Models) ResourceRefs() map[string]string

func (*Models) Variables added in v0.3.33

func (m *Models) Variables() []Variable

type Policies added in v0.3.13

type Policies struct {
	Resources map[string]*polytomic.PolicyResponse
	// contains filtered or unexported fields
}

func NewPolicies added in v0.3.13

func NewPolicies(c *ptclient.Client) *Policies

func (*Policies) DatasourceRefs added in v0.3.19

func (p *Policies) DatasourceRefs() map[string]string

func (*Policies) Filename added in v0.3.13

func (p *Policies) Filename() string

func (*Policies) GenerateImports added in v0.3.13

func (p *Policies) GenerateImports(ctx context.Context, writer io.Writer) error

func (*Policies) GenerateTerraformFiles added in v0.3.13

func (p *Policies) GenerateTerraformFiles(ctx context.Context, writer io.Writer, refs map[string]string) error

func (*Policies) Init added in v0.3.13

func (p *Policies) Init(ctx context.Context) error

func (*Policies) ResourceRefs added in v0.3.19

func (p *Policies) ResourceRefs() map[string]string

func (*Policies) Variables added in v0.3.33

func (p *Policies) Variables() []Variable

type Roles added in v0.3.13

type Roles struct {
	Resources map[string]*polytomic.RoleResponse
	// contains filtered or unexported fields
}

func NewRoles added in v0.3.13

func NewRoles(c *ptclient.Client) *Roles

func (*Roles) DatasourceRefs added in v0.3.19

func (r *Roles) DatasourceRefs() map[string]string

func (*Roles) Filename added in v0.3.13

func (r *Roles) Filename() string

func (*Roles) GenerateImports added in v0.3.13

func (r *Roles) GenerateImports(ctx context.Context, writer io.Writer) error

func (*Roles) GenerateTerraformFiles added in v0.3.13

func (r *Roles) GenerateTerraformFiles(ctx context.Context, writer io.Writer, refs map[string]string) error

func (*Roles) Init added in v0.3.13

func (r *Roles) Init(ctx context.Context) error

func (*Roles) ResourceRefs added in v0.3.19

func (r *Roles) ResourceRefs() map[string]string

func (*Roles) Variables added in v0.3.33

func (r *Roles) Variables() []Variable

type Syncs

type Syncs struct {
	Resources map[string]*polytomic.ModelSyncResponse
	// contains filtered or unexported fields
}

func NewSyncs

func NewSyncs(c *ptclient.Client) *Syncs

func (*Syncs) DatasourceRefs added in v0.3.19

func (s *Syncs) DatasourceRefs() map[string]string

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, refs map[string]string) error

func (*Syncs) Init

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

func (*Syncs) ResourceRefs added in v0.3.19

func (s *Syncs) ResourceRefs() map[string]string

func (*Syncs) Variables added in v0.3.33

func (s *Syncs) Variables() []Variable

type Variable added in v0.3.33

type Variable struct {
	Name      string
	Default   any
	Type      string
	Sensitive bool
}

Jump to

Keyboard shortcuts

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