MCPcopy
hub / github.com/Azure/aztfexport / BaseMeta

Interface BaseMeta

internal/meta/base_meta.go:51–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49type TFConfigTransformer func(configs ConfigInfos) (ConfigInfos, error)
50
51type BaseMeta interface {
52 // Logger returns a slog.Logger
53 Logger() *slog.Logger
54 // ProviderName returns the target provider name, which is either azurerm or azapi.
55 ProviderName() string
56 // Init initializes the base meta, including initialize terraform, provider and soem runtime temporary resources.
57 Init(ctx context.Context) error
58 // DeInit deinitializes the base meta, including cleaning up runtime temporary resources.
59 DeInit(ctx context.Context) error
60 // Workspace returns the path of the output directory.
61 Workspace() string
62 // ParallelImport imports the specified import list in parallel (parallelism is set during the meta builder function).
63 // Import error won't be returned in the error, but is recorded in each ImportItem.
64 ParallelImport(ctx context.Context, items []*ImportItem) error
65 // PushState pushes the terraform state file (the base state of the workspace, adding the newly imported resources) back to the workspace.
66 PushState(ctx context.Context) error
67 // CleanTFState clean up the specified TF resource from the workspace's state file.
68 CleanTFState(ctx context.Context, addr string)
69 // GetTerraformCfg generates the TF configuration from the import list. Only resources successfully imported will be processed.
70 GetTerraformCfg(ctx context.Context, l ImportList) ([]byte, error)
71 // WriteTerraformCfg writes the TF configuration generated from the import list. Only resources successfully imported will be processed.
72 WriteTerraformCfg(ctx context.Context, l ImportList) error
73 // GetSkippedResources get list of resources that are skipped to be imported.
74 GetSkippedResources(ctx context.Context, l ImportList) []string
75 // WriteSkippedResources writes a file listing record resources that are skipped to be imported to the output directory.
76 WriteSkippedResources(ctx context.Context, l ImportList) error
77 // GetImportBlocks get a list of TF import blocks of the importing resources.
78 GetImportBlocks(ctx context.Context, l ImportList) []byte
79 // WriteResourceMapping writes a resource mapping file to the output directory. In case import block generation is specified, a TF import block file will also be generated.
80 WriteResourceMapping(ctx context.Context, l ImportList) error
81 // CleanUpWorkspace is a weired method that is only meant to be used internally by aztfexport, which under the hood will remove everything in the output directory, except the generated TF config.
82 // This method does nothing if HCLOnly in the Config is not set.
83 CleanUpWorkspace(ctx context.Context) error
84
85 SetPreImportHook(config.ImportCallback)
86 SetPostImportHook(config.ImportCallback)
87}
88
89var _ BaseMeta = &baseMeta{}
90

Callers 31

UpdateMethod · 0.65
ListResourceMethod · 0.65
ListResourceMethod · 0.65
ListResourceMethod · 0.65
ListResourceMethod · 0.65
NewModelFunction · 0.65
BatchImportFunction · 0.65
runCaseFunction · 0.65
runCaseFunction · 0.65
TestQueryModeFunction · 0.65
runCaseFunction · 0.65
TestAppendModeFunction · 0.65

Implementers 2

baseMetainternal/meta/base_meta.go
MetaGroupDummyinternal/meta/meta_dummy.go

Calls

no outgoing calls

Tested by

no test coverage detected