Import Existing Resources
Autoschematic can scan and import your existing infrastructure automatically as code.
In other words, something like terraformer is built-in by design.
This means you don't need to reprovision or manually import your existing infra to start using Autoschematic - you can scan and fetch resources and convert them into code:
If your repo has multiple prefixes or connectors, Autoschematic will prompt you to choose which ones to include in the import.
Imported resource files are written under the prefix and optionally staged with git add and committed. The exact file format depends on the connector: some write .ron, some (like the k8s connector) write .yaml, some (like the Snowflake connector) may even write SQL or other formats.
Here is a real example using the Kubernetes connector:
Three filters are especially useful:
-por--prefixlimits the operation to one prefix.-cor--connectorlimits the operation to one connector.-sor--subpathlimits the operation to an address subtree or glob.
That --subpath filter is usually the most important one. It lets you import just one namespace, one branch of an AWS account, or one family of resources instead of crawling everything the connector can see.
By default, import will not overwrite files that already exist in the repo. If you want the remote state to replace the current file contents, use --overwrite:
Passing --commit false will skip the git stage and commit.

