Documentation ¶
Index ¶
- Variables
- func ConnectServices(importResources map[string][]Resource, isServicePath bool, ...) map[string][]Resource
- func ContainsResource(s []Resource, e Resource) bool
- func FilterCleanup(s *Service, isInitial bool)
- func HclPrintResource(resources []Resource, providerData map[string]interface{}, output string, ...) ([]byte, error)
- func IgnoreKeys(resourcesTypes []string, p *providerwrapper.ProviderWrapper) map[string][]string
- func NewTfState(resources []Resource) *terraform.State
- func ParseFilterValues(value string) []string
- func Print(data interface{}, mapsObjects map[string]struct{}, format string, sort bool) ([]byte, error)
- func PrintTfState(resources []Resource) ([]byte, error)
- func RefreshResourceWorker(input chan *Resource, wg *sync.WaitGroup, ...)
- func RefreshResourcesByProvider(providersMapping *ProvidersMapping, ...) error
- func TfSanitize(name string) string
- func WalkAndCheckField(path string, data interface{}) bool
- func WalkAndGet(path string, data interface{}) []interface{}
- func WalkAndOverride(path, oldValue, newValue string, data interface{})
- type ApplicableFilter
- type BaseResource
- type FlatmapParser
- type Flatmapper
- type Provider
- func (p *Provider) GenerateFiles()
- func (p *Provider) GenerateOutputPath() error
- func (p *Provider) GetBasicConfig() cty.Value
- func (p *Provider) GetConfig() cty.Value
- func (p *Provider) GetName() string
- func (p *Provider) GetService() ServiceGenerator
- func (p *Provider) GetSupportedService() map[string]ServiceGenerator
- func (p *Provider) Init(args []string) error
- func (p *Provider) InitService(serviceName string) error
- type ProviderGenerator
- type ProviderWithSource
- type ProvidersMapping
- func (p *ProvidersMapping) AddServiceToProvider(service string) ProviderGenerator
- func (p *ProvidersMapping) CleanupProviders()
- func (p *ProvidersMapping) ConvertTFStates(providerWrapper *providerwrapper.ProviderWrapper)
- func (p *ProvidersMapping) GetBaseProvider() ProviderGenerator
- func (p *ProvidersMapping) GetResourcesByService() map[string][]Resource
- func (p *ProvidersMapping) GetServices() []string
- func (p *ProvidersMapping) MatchProvider(resource *Resource) ProviderGenerator
- func (p *ProvidersMapping) ProcessResources(isCleanup bool)
- func (p *ProvidersMapping) RemoveServices(services []string)
- func (p *ProvidersMapping) SetResources(resourceToKeep []*Resource)
- func (p *ProvidersMapping) ShuffleResources() []*Resource
- type Resource
- func NewResource(id, resourceName, resourceType, provider string, attributes map[string]string, ...) Resource
- func NewSimpleResource(id, resourceName, resourceType, provider string, allowEmptyValues []string) Resource
- func RefreshResources(resources []*Resource, provider *providerwrapper.ProviderWrapper, ...) ([]*Resource, error)
- func (r *Resource) ConvertTFstate(provider *providerwrapper.ProviderWrapper) error
- func (r Resource) GetIDKey() string
- func (r *Resource) ParseTFstate(parser Flatmapper, impliedType cty.Type) error
- func (r *Resource) Refresh(provider *providerwrapper.ProviderWrapper)
- func (r *Resource) ServiceName() string
- type ResourceFilter
- type Service
- func (s *Service) GetArgs() map[string]interface{}
- func (s *Service) GetName() string
- func (s *Service) GetProviderName() string
- func (s *Service) GetResources() []Resource
- func (s *Service) InitResources() error
- func (s *Service) InitialCleanup()
- func (s *Service) ParseFilter(rawFilter string) []ResourceFilter
- func (s *Service) ParseFilters(rawFilters []string)
- func (s *Service) PopulateIgnoreKeys(providerWrapper *providerwrapper.ProviderWrapper)
- func (s *Service) PostConvertHook() error
- func (s *Service) PostRefreshCleanup()
- func (s *Service) SetArgs(args map[string]interface{})
- func (s *Service) SetName(name string)
- func (s *Service) SetProviderName(providerName string)
- func (s *Service) SetResources(resources []Resource)
- func (s *Service) SetVerbose(verbose bool)
- type ServiceGenerator
Constants ¶
This section is empty.
Variables ¶
View Source
var ClosingBracketRegexp = regexp.MustCompile(`.?\\>`)
View Source
var OpeningBracketRegexp = regexp.MustCompile(`.?\\<`)
Functions ¶
func ConnectServices ¶
func ContainsResource ¶
func FilterCleanup ¶
func HclPrintResource ¶
func HclPrintResource(resources []Resource, providerData map[string]interface{}, output string, sort bool) ([]byte, error)
Print hcl file from TerraformResource + provider
func IgnoreKeys ¶
func IgnoreKeys(resourcesTypes []string, p *providerwrapper.ProviderWrapper) map[string][]string
func NewTfState ¶
func ParseFilterValues ¶
func PrintTfState ¶
func RefreshResourceWorker ¶
func RefreshResourceWorker(input chan *Resource, wg *sync.WaitGroup, provider *providerwrapper.ProviderWrapper)
func RefreshResourcesByProvider ¶
func RefreshResourcesByProvider(providersMapping *ProvidersMapping, providerWrapper *providerwrapper.ProviderWrapper) error
func WalkAndCheckField ¶
func WalkAndGet ¶
func WalkAndGet(path string, data interface{}) []interface{}
func WalkAndOverride ¶
func WalkAndOverride(path, oldValue, newValue string, data interface{})
Types ¶
type ApplicableFilter ¶
type BaseResource ¶
type FlatmapParser ¶
type FlatmapParser struct { Flatmapper // contains filtered or unexported fields }
func NewFlatmapParser ¶
func (*FlatmapParser) Parse ¶
func (p *FlatmapParser) Parse(ty cty.Type) (map[string]interface{}, error)
FromFlatmap converts a map compatible with what would be produced by the "flatmap" package to a map[string]interface{} object type.
The intended result type must be provided in order to guide how the map contents are decoded. This must be an object type or this function will panic.
Flatmap values can only represent maps when they are of primitive types, so the given type must not have any maps of complex types or the result is undefined.
The result may contain null values if the given map does not contain keys for all of the different key paths implied by the given type.
type Provider ¶
type Provider struct { Service ServiceGenerator Config cty.Value }
func (*Provider) GenerateFiles ¶
func (p *Provider) GenerateFiles()
func (*Provider) GenerateOutputPath ¶
func (*Provider) GetBasicConfig ¶
func (*Provider) GetService ¶
func (p *Provider) GetService() ServiceGenerator
func (*Provider) GetSupportedService ¶
func (p *Provider) GetSupportedService() map[string]ServiceGenerator
func (*Provider) InitService ¶
type ProviderGenerator ¶
type ProviderGenerator interface { Init(args []string) error InitService(serviceName string, verbose bool) error GetName() string GetService() ServiceGenerator GetConfig() cty.Value GetBasicConfig() cty.Value GetSupportedService() map[string]ServiceGenerator GenerateFiles() GetProviderData(arg ...string) map[string]interface{} GenerateOutputPath() error GetResourceConnections() map[string]map[string][]string }
type ProviderWithSource ¶
type ProviderWithSource interface {
GetSource() string
}
type ProvidersMapping ¶
type ProvidersMapping struct { Resources map[*Resource]bool Services map[string]bool Providers map[ProviderGenerator]bool // contains filtered or unexported fields }
func NewProvidersMapping ¶
func NewProvidersMapping(baseProvider ProviderGenerator) *ProvidersMapping
func (*ProvidersMapping) AddServiceToProvider ¶
func (p *ProvidersMapping) AddServiceToProvider(service string) ProviderGenerator
func (*ProvidersMapping) CleanupProviders ¶
func (p *ProvidersMapping) CleanupProviders()
func (*ProvidersMapping) ConvertTFStates ¶
func (p *ProvidersMapping) ConvertTFStates(providerWrapper *providerwrapper.ProviderWrapper)
func (*ProvidersMapping) GetBaseProvider ¶
func (p *ProvidersMapping) GetBaseProvider() ProviderGenerator
func (*ProvidersMapping) GetResourcesByService ¶
func (p *ProvidersMapping) GetResourcesByService() map[string][]Resource
func (*ProvidersMapping) GetServices ¶
func (p *ProvidersMapping) GetServices() []string
func (*ProvidersMapping) MatchProvider ¶
func (p *ProvidersMapping) MatchProvider(resource *Resource) ProviderGenerator
func (*ProvidersMapping) ProcessResources ¶
func (p *ProvidersMapping) ProcessResources(isCleanup bool)
func (*ProvidersMapping) RemoveServices ¶
func (p *ProvidersMapping) RemoveServices(services []string)
func (*ProvidersMapping) SetResources ¶
func (p *ProvidersMapping) SetResources(resourceToKeep []*Resource)
func (*ProvidersMapping) ShuffleResources ¶
func (p *ProvidersMapping) ShuffleResources() []*Resource
type Resource ¶
type Resource struct { InstanceInfo *terraform.InstanceInfo InstanceState *terraform.InstanceState Outputs map[string]*terraform.OutputState `json:",omitempty"` ResourceName string Provider string Item map[string]interface{} `json:",omitempty"` IgnoreKeys []string `json:",omitempty"` AllowEmptyValues []string `json:",omitempty"` AdditionalFields map[string]interface{} `json:",omitempty"` SlowQueryRequired bool DataFiles map[string][]byte }
func NewResource ¶
func NewSimpleResource ¶
func RefreshResources ¶
func RefreshResources(resources []*Resource, provider *providerwrapper.ProviderWrapper, slowProcessingResources [][]*Resource) ([]*Resource, error)
func (*Resource) ConvertTFstate ¶
func (r *Resource) ConvertTFstate(provider *providerwrapper.ProviderWrapper) error
func (*Resource) ParseTFstate ¶
func (r *Resource) ParseTFstate(parser Flatmapper, impliedType cty.Type) error
func (*Resource) Refresh ¶
func (r *Resource) Refresh(provider *providerwrapper.ProviderWrapper)
func (*Resource) ServiceName ¶
type ResourceFilter ¶
type ResourceFilter struct { ApplicableFilter ServiceName string FieldPath string AcceptableValues []string }
func (*ResourceFilter) Filter ¶
func (rf *ResourceFilter) Filter(resource Resource) bool
func (*ResourceFilter) IsApplicable ¶
func (rf *ResourceFilter) IsApplicable(serviceName string) bool
type Service ¶
type Service struct { Name string Resources []Resource ProviderName string Args map[string]interface{} Filter []ResourceFilter Verbose bool }
func (*Service) GetProviderName ¶
func (*Service) GetResources ¶
func (*Service) InitResources ¶
func (*Service) InitialCleanup ¶
func (s *Service) InitialCleanup()
func (*Service) ParseFilter ¶
func (s *Service) ParseFilter(rawFilter string) []ResourceFilter
func (*Service) ParseFilters ¶
func (*Service) PopulateIgnoreKeys ¶
func (s *Service) PopulateIgnoreKeys(providerWrapper *providerwrapper.ProviderWrapper)
func (*Service) PostConvertHook ¶
func (*Service) PostRefreshCleanup ¶
func (s *Service) PostRefreshCleanup()
func (*Service) SetProviderName ¶
func (*Service) SetResources ¶
func (*Service) SetVerbose ¶
type ServiceGenerator ¶
type ServiceGenerator interface { InitResources() error GetResources() []Resource SetResources(resources []Resource) ParseFilter(rawFilter string) []ResourceFilter ParseFilters(rawFilters []string) PostConvertHook() error GetArgs() map[string]interface{} SetArgs(args map[string]interface{}) SetName(name string) SetVerbose(bool) SetProviderName(name string) GetProviderName() string GetName() string InitialCleanup() PopulateIgnoreKeys(*providerwrapper.ProviderWrapper) PostRefreshCleanup() }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.