| 49 | type TFConfigTransformer func(configs ConfigInfos) (ConfigInfos, error) |
| 50 | |
| 51 | type 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 | |
| 89 | var _ BaseMeta = &baseMeta{} |
| 90 |
no outgoing calls
no test coverage detected