InfraWeave Overview
InfraWeave is a platform designed to bridge the gap between your infrastructure code and devlopers, making it accessible to a wide range of users with different technical backgrounds.
Combined with the Backstage plugin it provides a great user experience.
Getting started
It all starts with you having a Terraform module available that you want to deploy
terraform { required_providers { aws = { source = "hashicorp/aws" version = "~> 5.0" } }}
resource "aws_s3_bucket" "example" { bucket = var.bucket_name tags = var.tags}
variable "bucket_name" { type = string}
variable "tags" { type = map(string) default = { Owner = "John Doe" Department = "Platform" }}
Define Module Manifest
The only job you have to do is to create a module.yaml
manifest to define your module
Directorysrc/
- .terraform.lock.hcl
- data.tf
- main.tf
- module.yaml
- variables.tf
Directoryother_files
- example.txt
in the same directory as your terraform files (including the lockfile .terraform.lock.hcl
):
apiVersion: infraweave.io/v1kind: Modulemetadata: name: s3bucket # The name of the module you definespec: moduleName: S3Bucket # metadata.name cannot have any uppercase, which is why we need this version: 0.0.11 # The released version to use description: "This module deploys an S3 bucket in AWS" # Supports markdown reference: https://github.com/your-org/s3bucket # The URL to the module's source code
Next, publish it:
infraweave module publish dev .
This will package your terraform module and store it for you.
You decide if it is manual or in CI, you can read more about ready-to-use GitHub actions here.
That’s all!
Let’s Deploy!
That’s it! Let’s look at four different ways to deploy this module:
- GitOps
- CLI
- Kubernetes
- Python
For the first three options, you will use a manifest like this:
apiVersion: infraweave.io/v1kind: S3Bucketmetadata: name: my-s3-bucket namespace: defaultspec: moduleVersion: 0.0.11-dev # The released version to use, must match the version in the module.yaml region: us-west-2 variables: bucketName: my-unique-bucket-name-32142j tags: Name234: my-s3bucket Environment43: dev
GitOps
Given that it is configured, simply push the claim to your repository, that’s it! 🎉
CLI
In case you want to set something up quick and dirty from your local computer, this is easy:
Using the same manifest file as above
infraweave apply <some-namespace-here> s3_manifest.yaml
Deploy from anywhere you have cloud provider access, no tf-states to worry about! 🥳
Kubernetes
You might want to create an S3 Bucket next to your application in a Kubernetes cluster, this is as simple as this:
kubectl apply -f s3_manifest.yaml
(just make sure to have the Kubernetes controller installed in your cluster)
kubectl
feedback
This will make it possible to list all your resources by simply typing kubectl
$ kubectl get s3buckets -A
NAME RESOURCESTATUS ENVIRONMENTmy-s3-bucket Deployed my-cluster/defaultmy-other-s3-bucket Deployed my-cluster/namespace2
Python
If you want a more dynamic approach (using loops etc) you can use the python
-module.
It is also very useful in module- and intergration-tests.
from infraweave import S3Bucket, Deployment
bucket_module = S3Bucket( version='0.0.11-dev', track="dev")
bucket1 = Deployment( name="bucket1", namespace="playground", module=bucket_module, region="us-west-2")
with bucket1: bucket1.set_variables( bucket_name="my-bucket12347ydfs3", enable_acl=False ) bucket1.apply() # Run some tests here
# bucket1.destroy() is automatically called when finished (or on error)