Load modules from the catalog
Load modules from Facets' catalog with the Praxis CLI: register their output types, upload the modules you pick, and publish them. A project type is optional.
A new control plane has no modules, so there is nothing yet to build a blueprint from. Load the ones you need from Facets' module catalog with the Praxis CLI: clone the catalog, register its output types, upload the modules you pick, then publish them.
The catalog is the facets-modules-redesign repository. Browse it at facets-cloud.github.io/facets-modules-redesign.
In the console, Browse Templates on the Project Types page opens that site. The loading itself happens in the CLI.
The steps below replace raptor import project-type, which has been removed.
Load the modules
Clone the catalog and list its modules
git clone https://github.com/Facets-cloud/facets-modules-redesign.git ./reference-modules
raptor module discover --source ./reference-modulesDiscovery reads the clone and doesn't call your control plane. It lists each module's name as TYPE/FLAVOR/VERSION, its folder, and whether it has a README. Add -o json to also see each module's inputs and outputs, and which modules in the clone can supply each input.
Register the output types
Modules connect to each other through output types, and an upload checks that the ones a module uses already exist. Register the catalog's output types first:
raptor create output-type -f ./reference-modules/outputs --if-absent--if-absent creates the types your control plane doesn't have yet and leaves the others unchanged.
Upload the modules
Upload each module you picked, and the modules it depends on, from its folder:
raptor create iac-module -f ./reference-modules/modules/service/aws/1.0 --auto-create--auto-create registers a module's type, such as service, the first time one is uploaded. The upload runs Terraform's checks on the module first, so Terraform needs to be on your machine.
Publish them
An upload starts as a preview, which only test projects can use. Publish each module so other projects can use it too:
raptor publish iac-module service/aws/1.0Publish by the name discovery shows, since a module's version can differ from its folder name. Publishing needs a README.md with some text in the module's folder. To upload and publish in one step, add --publish to raptor create iac-module -f.
If your organization links a modules repository to the control plane, add catalog modules to that repository and publish them through its CI instead (Modules Repo).
What a service needs on each cloud
A service runs on a cluster, so it needs four other modules with it. These are the catalog's modules for a first service:
| Module | AWS | GCP | Azure |
|---|---|---|---|
| Cloud account | cloud_account/aws_provider | cloud_account/gcp_provider | cloud_account/azure_provider |
| Network | network/aws_network | network/gcp_network | network/azure_network |
| Cluster | kubernetes_cluster/eks_automode (EKS Auto Mode) | kubernetes_cluster/gke | kubernetes_cluster/aks |
| Node pool | kubernetes_node_pool/eks_automode | kubernetes_node_pool/gcp | kubernetes_node_pool/azure |
| Service | service/aws | service/gcp | service/azure |
Deploy your first application has the commands that load them. For any other module, add --module TYPE/FLAVOR/VERSION -o json to raptor module discover to see its inputs and which modules can supply them.
Confirm what landed
raptor get iac-modules --stage PUBLISHED
raptor get iac-modules --stage PREVIEWIn the console, the Module Registry lists the same modules with their stage.
Project types are optional
You don't need a project type to load modules: a published module is available across the control plane. A project type decides which of those modules a project can use, and every project has one.
Create one that allows every published module, for example when your control plane has no project type yet:
raptor create project-type platform --description "Modules for our services"Create one that lists its modules when a team's projects should use only those, such as approved datastores. Each module has to be published first:
raptor create project-type payments --description "Approved modules for payments" \
--resource-type service/aws --resource-type postgres/aws-rds
# Add a module to it later
raptor create resource-type-mapping payments --resource-type redis/aws-elasticacheraptor create resource-type-mapping changes nothing on a project type with no module list, since that type already allows every module. Project Types covers the console and the other settings a project type holds.
What to do next
- Deploy your first application: load the modules for a service, then create a project and deploy it.
- Bring your own modules: upload modules you wrote, and limit a project type to them.
- Building a module: change a catalog module or write your own.
- Creating a project type: create one in the console from a project or a Git repository.
Project Types
A project type is the template projects start from: its starting blueprint, IaC tool, cloud settings, and guardrails on which modules a project can use.
Bring your own modules
Upload and publish Facets modules you wrote with the Praxis CLI, register their output types, and optionally create a project type that limits projects to them.