Skip to content

Provider Overview

Providers define reusable Terraform provider configurations used by modules and stacks in InfraWeave.

Each Provider configures how Terraform interacts with a specific platform, such as cloud providers (AWS, Azure, GCP), Kubernetes clusters, or other infrastructure services.

A Provider is published using the cli and becomes available for use in modules and stacks.

Defining Providers

You define a Provider in a manifest file. Below is an example of a provider definition.

providers/aws-6.yaml
apiVersion: infraweave.io/v1
kind: Provider
metadata:
name: aws-6 # The name of the provider
spec:
provider: aws # The cloud provider type (aws, azure, gcp, etc.)
reference: https://github.com/infraweave-io/providers/aws-6 # The URL to the provider's source code
description: | # Description; supports markdown
AWS Provider with default configuration. This provider is configured to use the default AWS profile and region.

Put it in the same directory as your terraform files that only defines a provider and optionally locals or variables:

  • Directorysrc/
    • locals.tf
    • provider.tf
    • provider.yaml
    • variables.tf
    • variables_infraweave.tf

The variables_infraweave.tf file contains InfraWeave runtime context variables (see Runtime Context Variables below).

Example Provider Configuration

Here’s an example of a typical AWS provider configuration:

provider.tf
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 6.0"
}
}
}
provider "aws" {
default_tags {
tags = local.tags
}
}

Runtime Context Variables

It is possible to create variables that will automatically be set during runtime, e.g. which deployment_id, who committed, which repo etc, by adding this to a module:

...
variable "INFRAWEAVE_GIT_COMMITTER_EMAIL" {
type = string
default = ""
}
variable "INFRAWEAVE_REFERENCE" {
type = string
default = ""
}

Any variable starting with INFRAWEAVE_ is reserved for this feature and will not be exposed to user as a regular variable. It is mandatory to set type=string and default="", you can optionally set a description.

Usecase

This is commonly used for tags, e.g.:

provider "aws" {
default_tags {
tags = merge(
var.tags,
{
INFRAWEAVE_GIT_COMMITTER_EMAIL = var.INFRAWEAVE_GIT_COMMITTER_EMAIL
INFRAWEAVE_REFERENCE = var.INFRAWEAVE_REFERENCE
}
)
}
}

Available Options

Generic (always available)

These will always set a value if you decide to include it

INFRAWEAVE_DEPLOYMENT_ID
INFRAWEAVE_ENVIRONMENT
INFRAWEAVE_REFERENCE
INFRAWEAVE_MODULE_VERSION
INFRAWEAVE_MODULE_TYPE
INFRAWEAVE_MODULE_TRACK
INFRAWEAVE_DRIFT_DETECTION
INFRAWEAVE_DRIFT_DETECTION_INTERVAL
GitHub Webhook Specific

Will only be set when pushing to a GitHub repository, otherwise it will be "" (empty string)

INFRAWEAVE_GIT_COMMITTER_EMAIL
INFRAWEAVE_GIT_COMMITTER_NAME
INFRAWEAVE_GIT_ACTOR_USERNAME
INFRAWEAVE_GIT_ACTOR_PROFILE_URL
INFRAWEAVE_GIT_REPOSITORY_NAME
INFRAWEAVE_GIT_REPOSITORY_PATH
INFRAWEAVE_GIT_COMMIT_SHA

Template Specification

Below is the specification for the Provider resource.

  • apiVersion: [Required] Should always be infraweave.io/v1.

  • kind: [Required] Should always be Provider.

  • metadata

    • name: [Required] The name of the provider.
  • spec

    • provider: [Required] The cloud provider type (e.g., aws, azure, gcp).

    • alias: [Optional] An alias for the provider configuration. If specified, the configuration will be named <provider>.<alias>.

    • description: [Required] A description of the provider, supports markdown.

    • reference: [Required] A link to the source code (location of this file).