Logo

Autoschematic

GitHub
Cluster Login

Advanced Configuration

We'll dive a little deeper into how you can set up your Autoschematic repo.

Here we have two prefixes, "backend-team" and "data-team", and multiple connectors in each, making our full config a little more substantial.

Notice that we've even added some environment variables to each connector in order to configure them. Environment variables set in your shell are not automatically passed through to connectors for security. You must explicitly pass them through with the "env://..." syntax as shown below.

AutoschematicConfig(
    prefixes: {
        "backend-team": Prefix(
            resource_group: "main",
            connectors: [
                Connector(
                    shortname: "snowflake",
                    spec: Pip(
                        name: "autoschematic-connector-snowflake",
                        version: "0.14.0"
                        binary: "autoschematic-connector-snowflake"
                    )
                    env: {
                        "RUST_LOG": "INFO",
                    }
                ),
                Connector(
                    shortname: "aws/ecr",
                    spec: Cargo(
                        name: "autoschematic-connector-aws-ecr",
                        version: "0.14.0"
                    )
                    env: {
                        "RUST_LOG": "INFO",
                    }
                ),
                Connector(
                    shortname: "aws/s3",
                    spec: Cargo(
                        name: "autoschematic-connector-aws-s3",
                        version: "0.14.0"
                    )
                    env_file: ".secret.env",
                    env: {
                        "RUST_LOG": "DEBUG"
                        "AWS_ACCESS_KEY_ID": "env://AWS_ACCESS_KEY_ID",
                        "AWS_SECRET_ACCESS_KEY": "env://AWS_SECRET_ACCESS_KEY",
                    }
                )
            ]
        ),
        "data-team": Prefix(
            resource_group: "main",
            connectors: [
                Connector(
                    shortname: "zendesk",
                    spec: TypescriptLocal(
                        path: "./autoschematic-connector-zendesk/src/index.ts",
                    ),
                    env_file: ".secret.env",
                    env: {
                        "ZENDESK_SUBDOMAIN": "otterland"
                    }
                ),
                Connector(
                    shortname: "aws/s3",
                    spec: Cargo(
                        name: "autoschematic-connector-aws-s3",
                        version: "0.14.0"
                    )
                    env: {
                        "RUST_LOG": "DEBUG",
                    }
                )
            ]
        )
    },
)

Now that we've covered the basics of configuration, you can start Managing Infrastructure with Connectors, or build your own connectors in Rust or Python.