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.
apiVersion: infraweave.io/v1kind: Providermetadata: name: aws-6 # The name of the providerspec: 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:
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_IDINFRAWEAVE_ENVIRONMENTINFRAWEAVE_REFERENCEINFRAWEAVE_MODULE_VERSIONINFRAWEAVE_MODULE_TYPEINFRAWEAVE_MODULE_TRACKINFRAWEAVE_DRIFT_DETECTIONINFRAWEAVE_DRIFT_DETECTION_INTERVALGitHub Webhook Specific
Will only be set when pushing to a GitHub repository, otherwise it will be "" (empty string)
INFRAWEAVE_GIT_COMMITTER_EMAILINFRAWEAVE_GIT_COMMITTER_NAMEINFRAWEAVE_GIT_ACTOR_USERNAMEINFRAWEAVE_GIT_ACTOR_PROFILE_URLINFRAWEAVE_GIT_REPOSITORY_NAMEINFRAWEAVE_GIT_REPOSITORY_PATHINFRAWEAVE_GIT_COMMIT_SHATemplate Specification
Below is the specification for the Provider resource.
-
apiVersion: [Required] Should always beinfraweave.io/v1. -
kind: [Required] Should always beProvider. -
metadataname: [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).
-