Resources
A resource in Facets refers to any cloud infrastructure component included in a Blueprint and deployed to an environment. This can range from fundamental elements like VPCs and Kubernetes clusters to application-specific components like databases, caches, and load balancers.
For detailed instructions on provisioning resources within Facets, refer to the Adding Resources documentation.
Understanding Intents
An Intent represents a high-level infrastructure requirement. When you're building an application, you think in terms of capabilities: "I need a database" or "I need a cache." You shouldn't need to worry about whether it's AWS RDS, GCP Cloud SQL, or which specific configuration parameters to set.
Here's how an Intent works in practice:
# Example Database Intent
{
"kind": "postgres",
"version": "0.1",
"disabled": true,
"metadata": {
"tags": {
"name": "postgres"
}
},
"spec": { }
}
The Intent above declares a postgres intent what you need without specifying implementation details. It focuses on the essential characteristics your application requires. This abstraction allows you to maintain the same Intent across different environments or cloud providers.
Working with Flavors
While Intents declare what you need, Flavors define how to provide it. A Flavor is a concrete implementation of an Intent, packaged as a Terraform module. Think of Flavors as the bridge between your high-level requirements and actual cloud resources. Each Flavor implements the same Intent differently, but they all satisfy the core requirements.
Here's how to assign a flavor:
# Example Database Flavor
{
"kind": "postgres",
"flavor": "k8s",
"version": "0.1",
"disabled": true,
"metadata": {
"tags": {
"name": "postgres"
}
},
"spec": { }
}
In the above, the Flavor we assign—"k8s" in this case—specifies how this database will be provisioned, packaged as a Terraform module tailored for Kubernetes deployment. This allows the Intent for PostgreSQL to be fulfilled in a way that’s consistent across different cloud environments, leveraging Kubernetes as a common infrastructure layer.
With an understanding of resources, intents, and flavors, you can define infrastructure components in Facets. By structuring these components, you can create an infrastructure blueprint tailored to your project’s needs.
Updated 2 days ago