{"id":24737416,"url":"https://github.com/engineersbox/schematic","last_synced_at":"2025-10-04T14:39:12.674Z","repository":{"id":41352808,"uuid":"316634435","full_name":"EngineersBox/Schematic","owner":"EngineersBox","description":"A terraform style IaC manager of services","archived":false,"fork":false,"pushed_at":"2021-02-20T13:56:07.000Z","size":71,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-03T22:44:48.467Z","etag":null,"topics":["infrastructure-as-code","schema","schematic"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EngineersBox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-28T01:33:48.000Z","updated_at":"2021-10-20T13:52:18.000Z","dependencies_parsed_at":"2022-09-19T03:51:28.012Z","dependency_job_id":null,"html_url":"https://github.com/EngineersBox/Schematic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineersBox%2FSchematic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineersBox%2FSchematic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineersBox%2FSchematic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EngineersBox%2FSchematic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EngineersBox","download_url":"https://codeload.github.com/EngineersBox/Schematic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244999215,"owners_count":20544866,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["infrastructure-as-code","schema","schematic"],"created_at":"2025-01-27T22:08:13.840Z","updated_at":"2025-10-04T14:39:07.620Z","avatar_url":"https://github.com/EngineersBox.png","language":"Go","readme":"# Schematic\n\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/EngineersBox/Schematic/Go?style=for-the-badge)\n\nA terraform style IaC (Infrastructure as Code) manager of services\n\n## Declaration Language\n\n### Basic Types (`B`)\n\n* `String`\n* `Integer`\n* `Float`\n* `Boolean`\n\n```JSON\n\"StringValue\" = \"some string\"\n\"IntegerValue\" = 5821\n\"FloatValue\" = 63.64f\n\"BooleanValue\" = false\n```\n\n---\n\n### Expressions (`E`)\n\n```Typescript\n\u003cString\u003e = \u003cB | V\u003cT\u003e\u003e\n```\n\n---\n\n### Variables (`V\u003cT\u003e`)\n\n```HCL\nvariable \"someVar\" {\n    value = \u003cT\u003e\n}\n```\n\n*or*\n\n```Typescript\nvariable \"anotherVar\" = \u003cB\u003e\n```\n\n---\n\n### Complex Types (`C\u003cT\u003e`)\n\n* `Block\u003cT\u003e`\n* `Array\u003cT\u003e`\n\n#### Block\n\nA composite object of fields and values:\n\n```Typescript\n\u003cString\u003e {\n    ...\u003cString\u003e = \u003cB | C\u003cT\u003e | V\u003e\n}\n```\n\n#### Array\n\nA list of values or composites\n\n```Typescript\n\u003cString\u003e = [\n    ...\u003cB | C\u003cT\u003e | V\u003e\n]\n```\n\n---\n\n## Schema Strucure\n\nThere are three top level components to a schema:\n\n* Instance\n* Data\n* Capture\n\nInstances are paramterized and filled instantiations of a template, data are a source that can be referenced and templates are skeletons that describe the structure of a custom instance.\n\n---\n  \n### Instance\n\n| Field        \t| Type           \t    |\n|--------------\t|----------------------\t|\n| name         \t| `String`         \t    |\n| type         \t| `String`         \t    |\n| hasDependency | `Array\u003cString\u003e` |\n| count        \t| `Integer`  \t    |\n| structure    \t| `Block\u003cInstBody\u003e` \t    |\n\n```HCL\ninstance \"String\u003cName\u003e\" \"String\u003cType\u003e\" {\n    hasDependency = [\n        \"String\u003cINSTANCE NAME\u003e\"\n    ]\n    count = Integer\n    \u003cInstBody\u003e\n}\n```\n\nExample of an instance\n\n```HCL\nvariable \"testcapsule_clsid\" {\n    value = 85831\n}\n\ninstance \"capsule::config\" \"test_capsule\" {\n    hasDependency = []\n    count = 2\n    inbuilt = true\n    containerId = \"testContainer\"\n    config = {\n        pidsMax = 20\n        memMax = 4096\n        netClsId = var.testcapsule_clsid\n        terminateOnClose = true\n    }\n}\n```\n\n---\n\n#### InstBody\n\nThere are two variants of the `InstBody`, one as a custom defintion via schema defintion and the second with inbuilt service support. The services are as follows:\n\n* `capsule::config`\n* `capsule::boxfile`\n* `aws::s3`\n* `aws::ec2`\n* `aws::route53`\n* `docker::config`\n* `docker::dockerfile`\n\nA custom schema is defined as a set of `\"String\" = \u003cB | C\u003cT\u003e | V\u003e`\n\nThe schema for the inbuilt support is:\n\n| Field | Type |\n|-------|------|\n| inbuilt | `Boolean` |\n| fieldSet | `{...\u003cB\u003e | C\u003cT\u003e | V\u003e}` |\n\n*Capsule (Config)*\n\n```Typescript\ninbuilt = true\ncontainerId = \u003cString | V\u003cString\u003e\u003e\nconfig = {\n    pidsMax = \u003cInteger | V\u003cInteger\u003e\u003e\n    memMax = \u003cInteger | V\u003cInteger\u003e\u003e\n    netClsId = \u003cInteger | V\u003cInteger\u003e\u003e\n    terminateOnClose = \u003cBoolean | V\u003cBoolean\u003e\u003e\n}\n```\n\n*Capsule (BoxFile)*\n\n```Typescript\ninbuilt = true\nboxFileLocation = \u003cString | V\u003cString\u003e\u003e\n```\n\n*AWS (S3)*\n\n```Typescript\ninbuilt = true\ninstanceType = \"s3\"\nbucketName = \u003cString | V\u003cString\u003e\u003e\narn = \u003cString | V\u003cString\u003e\u003e\naccessPolicy = {\n    public = \u003c\"ALL\" | \"NONE\" | \"GROUP\"\u003e\n    private = \u003c\"ALL\" | \"NONE\" | \"GROUP\" | \"SELF\"\u003e\n}\n```\n\n*Docker (Dockerfile)*\n\n```Typescript\ninbuilt = true\ndockerfileLocation = \u003cString | V\u003cString\u003e\u003e\n```\n\nAn example of a Capsule structure is\n\n```HCL\nvariable \"testcon_clsid\" {\n    value = 85831\n}\n\ninstance \"capsule::config\" \"test_capsule_structure\" {\n    inbuilt = true\n    containerId = \"testContainer\"\n    config = {\n        pidsMax = 20\n        memMax = 4096\n        netClsId = var.testcon_clsid\n        terminateOnClose = true\n    }\n}\n```\n\n---\n\n### Data\n\nData declarations are \"intakes\" for data for a specific existing source such as a running container or active S3 bucket\n\n```Typescript\ndata \u003c\"file\" | \"service\"\u003e \"String\u003cNAME\u003e\" {\n    reference = String\u003c'L' | 'W'\u003e::\u003cString | V\u003cString\u003e\n    schema {...\u003cB | C\u003cT\u003e | V\u003e}\n}\n```\n\n```Typescript\ndata.\u003cString\u003cTYPE\u003e\u003e.\u003cString\u003cNAME\u003e\u003e.\u003cString\u003cATTRIUTE\u003e\u003e[.\u003cString\u003cATTRIUTE\u003e\u003e]\n```\n\n```HCL\ndata \"service\" \"service_manager_container\" {\n    reference = \"L::/etc/capsule/containers/service_manager_container\"\n    schema = {\n        containerId = \u003cString | V\u003cString\u003e\u003e\n        proc = {\n            pidsMax = \u003cInteger | V\u003cInteger\u003e\u003e\n            memMax = \u003cInteger | V\u003cInteger\u003e\u003e\n            terminateOnClose = \u003cBoolean | V\u003cBoolean\u003e\u003e\n        }\n        network = {\n            netClsId = \u003cInteger | V\u003cInteger\u003e\u003e\n        }\n    }\n}\n\ninstance \"test_inst_type\" \"example_inst\" {\n    someProperty = data.service.service_manager_container.network.netClsId\n    ...\n}\n```\n\n---\n\n### Capture\n\nCaptures define the source code for instances\n\n```HCL\ncapture \"String\u003cNAME\u003e\" {\n    source = \u003cString | V\u003cString\u003e\u003e\n    hasDependency = [\n        ...\u003cString | V\u003cString\u003e\u003e\n    ]\n    handler = \u003cString | V\u003cString\u003e\u003e\n}\n```\n\nFor example\n\n```HCL\nvariable \"service_manager_net_id\" {\n    value = 2586425\n}\n\ncapture \"capsule\" {\n    source = \"github.com/EngineersBox/Capsule\"\n    hasDependency = [\n        \"github.com/google/golang\"\n    ]\n    handler = \"capsule\"\n}\n\ninstance \"capsule\" \"test_container\" {\n    hasDependency = []\n    count = 2\n    inbuilt = true\n    containerId = \"service_id_573\"\n    config = {\n        pidsMax = 20\n        memMax = 4096\n        netClsId = var.service_manager_net_id\n        terminateOnClose = true\n    }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineersbox%2Fschematic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fengineersbox%2Fschematic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fengineersbox%2Fschematic/lists"}