• Stars
    star
    136
  • Rank 266,737 (Top 6 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 2 years ago
  • Updated 29 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A @crossplane provider for Terraform

Official Terraform Provider

CI GitHub release Go Report Card Slack Twitter Follow

Provider Terraform is a Crossplane provider that can run Terraform code and enables defining new Crossplane Composite Resources (XRs) that are composed of a mix of 'native' Crossplane managed resources and your existing Terraform modules.

The Terraform provider adds support for a Workspace managed resource that represents a Terraform workspace. The configuration of each workspace may be either fetched from a remote source (e.g. git), or simply specified inline.

apiVersion: tf.upbound.io/v1beta1
kind: Workspace
metadata:
  name: example-inline
  annotations:
    # The terraform workspace will be named 'coolbucket'. If you omitted this
    # annotation it would be derived from metadata.name - i.e. 'example-inline'.
    crossplane.io/external-name: coolbucket
spec:
  forProvider:
    # For simple cases you can use an inline source to specify the content of
    # main.tf as opaque, inline HCL.
    source: Inline
    module: |
      // All outputs are written to the connection secret.  Non-sensitive outputs
      // are stored in the status.atProvider.outputs object.
      output "url" {
        value       = google_storage_bucket.example.self_link
      }

      resource "random_id" "example" {
        byte_length = 4
      }

      // The google provider and remote state are configured by the provider
      // config - see examples/providerconfig.yaml.
      resource "google_storage_bucket" "example" {
        name = "crossplane-example-${terraform.workspace}-${random_id.example.hex}"
      }
  writeConnectionSecretToRef:
    namespace: default
    name: terraform-workspace-example-inline
apiVersion: tf.upbound.io/v1beta1
kind: Workspace
metadata:
  name: example-remote
  annotations:
    crossplane.io/external-name: myworkspace
spec:
  forProvider:
    # Use any module source supported by terraform init -from-module.
    source: Remote
    module: https://github.com/crossplane/tf
    # Variables can be specified inline as a list of key-value pairs or as an json object, or loaded from a ConfigMap or Secret.
    vars:
    - key: region
      value: us-west-1
    varmap:
      account:
        region: us-west-1
        owners:
        - example-owner-1
        - example-owner-2
    varFiles:
    - source: SecretKey
      secretKeyRef:
        namespace: default
        name: terraform
        key: example.tfvar.json
  # All Terraform outputs are written to the connection secret.
  writeConnectionSecretToRef:
    namespace: default
    name: terraform-workspace-example-inline

Getting Started

Follow the quick start guide here.

You can find a detailed API reference for all the managed resources with examples in the Upbound Marketplace.

Further Configuration

You can find more information about configuring the provider further here.

Polling Interval

The default polling interval has been updated to 10 minutes from 1 minute. This affects how often the provider will run terraform plan on existing Workspaces to determine if there are any resources out of sync and whether terraform apply needs to be re-executed to recover the desired state. A 1 minute polling interval is often too short when the time required for running terrform init, terraform plan and terraform apply is taken into account. Workspaces with large numbers of resources can take longer than 1 minute to run terraform plan. Changes to the Workspace object spec will still be reconciled immediately. The poll interval is configurable using ControllerConfig.

Known limitations:

  • You must either use remote state or ensure the provider container's /tf directory is not lost. provider-terraform does not persist state; consider using the Kubernetes remote state backend.
  • If the module takes longer than the value of --timeout (default is 20m) to apply the underlying terraform process will be killed. You will potentially lose state and leak resources. The workspace lock will also likely be left in place and need to be manually removed before the Workspace can be reconciled again.
  • The provider won't emit an event until after it has successfully applied the Terraform module, which can take a long time.
  • Setting --max-reconcile-rate to a value greater than 1 will potentially cause the provider to use up to the same number of CPUs. Add a resources section to the ControllerConfig to restrict CPU usage as needed.

Report a Bug

For filing bugs, suggesting improvements, or requesting new features, please open an issue.

Contact

Please open a Github issue for all requests. If you need to reach out to Upbound, you can do so via the following channels:

Licensing

Provider Terraform is under the Apache 2.0 license with notice.

More Repositories

1

universal-crossplane

Enterprise-grade @crossplane from @upbound
Go
120
star
2

platform-ref-aws

AWS Reference Platform for Kubernetes + Data Services for use as a starting point in upbound.io to build, run, and operate your own internal cloud platform and offer a self-service console and API to your internal teams.
Makefile
100
star
3

build

Upbound build and CI scripts
Makefile
65
star
4

platform-ref-multi-k8s

Upbound's reference platform for multi-cloud Kubernetes with Crossplane
Shell
65
star
5

up

The @upbound CLI
Go
52
star
6

xgql

Crossplane's @graphql API
Go
43
star
7

platform-ref-gcp

Upbound's reference platform for Google Cloud Platform (GCP) services with Crossplane
Makefile
24
star
8

official-providers-ci

End to end integration testing for Crossplane Providers and Configurations
Go
18
star
9

platform-ref-azure

Upbound's reference platform for Microsoft Azure services with Crossplane
Makefile
15
star
10

provider-vault

A Crossplane provider for HashiCorp Vault
Go
15
star
11

vscode-up

Visual Studio Code extension for @upbound
TypeScript
14
star
12

platform-ref-multi-vault

Crossplane configuration for running Vault on Google Kubernetes Engine (GKE)
12
star
13

crossplane

Upbound's distribution of Crossplane
Go
12
star
14

platform-ref-aws-cnoe

This is the reference implementation of CNOE and its toolings on AWS with Crossplane
Makefile
11
star
15

up-sdk-go

The @golang SDK for @upbound
Go
10
star
16

configuration-aws-eks

AWS EKS Configuration
Makefile
9
star
17

platform-ref-cloud-native

The Cloud Native reference platform
8
star
18

provider-upbound

A @crossplane provider for Upbound services.
Go
8
star
19

configuration-observability-oss

A Crossplane Observability Reference Platform For Open Source Software Integrations
Shell
7
star
20

function-cidr

Composition Function that transforms CIDRs
Go
6
star
21

configuration-aws-eks-karpenter

AWS EKS Karpenter Configuration
Makefile
6
star
22

configuration-rds

Starter Configuration for Amazon RDS as a service.
6
star
23

composition-testing

Composition and E2E testing Examples
Shell
5
star
24

function-argo-eks-discovery

discover aws eks clusters and create argocd server managed resources
Go
5
star
25

configuration-caas

Configuration for Cluster-as-a-Service
Shell
5
star
26

olm-bundle

A utility to build an OLM bundle from a stream of YAMLs
Go
5
star
27

docs

Upbound Docs v2.0
SCSS
4
star
28

platform-ref-apigateway

Reference architecture for dynamic API Gateway composition using the abstracted helm approach
Makefile
4
star
29

platform-ref-virtual-k8s

@upbound reference platform for virtual @kubernetes clusters with @crossplane
4
star
30

provider-dummy

A dummy @crossplane provider together with its external API for experimentation.
Go
4
star
31

configuration-dbaas

Configuration for Database-as-a-Service
Shell
4
star
32

platform-ref-lambda

Reference Platform for AWS Lambda
Makefile
4
star
33

configuration-aws-eks-velero

This repository offers a configuration for uxp backup
Makefile
4
star
34

vale

3
star
35

configuration-eks

3
star
36

demos

3
star
37

platform-ref-upbound-spaces

Spaces: Bring Upbound Managed Control Planes into your own environment.
Makefile
3
star
38

provider-existing-cluster

Crossplane provider for accessing an existing cluster via KubernetesCluster claim for development/testing purposes
Go
3
star
39

.github

Default @github configuration for @upbound
2
star
40

homebrew-tap

@Homebrew formulae for @upbound
Ruby
2
star
41

nats-proxy

Go
2
star
42

app-postgres-db

Simple application that consumes a PostgreSQL database
Go
2
star
43

configuration-azure-aks

Azure AKS Configuration
Makefile
2
star
44

configuration-vault

Makefile
2
star
45

configuration-gcp-gke-castai

Makefile
2
star
46

provider-datadog

Provider To Configure Datadog
Go
2
star
47

uxp-training

UXP training labs by Upbound
HTML
2
star
48

configuration-aws-database

AWS Database Configuration
Makefile
2
star
49

configuration-gitops-flux

GitOps Flux Configuration
Makefile
2
star
50

configuration-aws-eks-castai

AWS EKS CastAI Configuration
Makefile
2
star
51

useful-test-repo

A repo for testing github tooling
1
star
52

platform-ref-tools

1
star
53

configuration-aws-icp

1
star
54

configuration-cloudsql

1
star
55

docker-aws-cli

Upbound's build of the AWS CLI for use in various projects
Dockerfile
1
star
56

configuration-scratch

A @crossplane configuration that allows you to start from scratch!
1
star
57

configuration-observability-datadog

A Crossplane Observability Configuration For A Datadog Integration
Makefile
1
star
58

configuration-caas-ml

Makefile
1
star
59

configuration-aws-network

AWS Network Configuration
Makefile
1
star
60

discourse

A @crossplane configuration for deploying @discourse
1
star
61

configuration-aws-eks-irsa

AWS EKS IRSA Configuration
Makefile
1
star
62

gcp-example-platform

An example platform built on GCP
1
star
63

configuration-azure-database

Azure Database Configuration
Makefile
1
star
64

configuration-caas-byoc

This repository offers a configuration for Bring Your Own Controller (BYOC) that is built on top of the Cluster-as-a-Service configuration.
Shell
1
star
65

configuration-azure-network

Network fabric configuration
Makefile
1
star
66

spaces-reference-arch

A reference architecture built on Spaces, a feature of Upbound
Makefile
1
star
67

configuration-aws-assume-gcp

aws eks cluster crossplane providers impersonate serviceaccount in gcp with WorkloadIdentityFederation
Makefile
1
star
68

spaces-reference-architecture

A reference architecture for deploying a Cloud Native Platform powered by Upbound Self-Hosted Spaces
1
star