Coder Social home page Coder Social logo

srlightbody / terraform-provider-airflow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from drfaust92/terraform-provider-airflow

0.0 0.0 0.0 132 KB

Terraform Airflow provider.

Home Page: https://registry.terraform.io/providers/DrFaust92/airflow

License: MIT License

Go 99.59% Makefile 0.41%

terraform-provider-airflow's Introduction

Terraform Provider Airflow

==========================

terraformregistry build GitHub go.mod Go version (subdirectory of monorepo)

The Airflow provider is used to interact with the Airflow. The provider needs to be configured with the proper credentials before it can be used.

Example Usage

provider "airflow" {
  base_endpoint = "airflow.net"
  oauth2_token  = "token"
}

resource "airflow_variable" "default" {
  key   = "foo"
  value = "bar"
}

Authentication

Google Composer Example (OAUTH2 token)

data "http" "client_id" {
  url = "composer-url"
}

resource "google_service_account" "example" {
  account_id = "example"
}

data "google_service_account_access_token" "impersonated" {
  target_service_account = google_service_account.example.email
  delegates              = []
  scopes                 = ["userinfo-email", "cloud-platform"]
  lifetime               = "300s"
}

provider "google" {
  alias        = "impersonated"
  access_token = data.google_service_account_access_token.impersonated.access_token
}

data "google_service_account_id_token" "oidc" {
  provider               = google.impersonated
  target_service_account = google_service_account.example.email
  delegates              = []
  include_email          = true
  target_audience        = regex("[A-Za-z0-9-]*\\.apps\\.googleusercontent\\.com", data.http.client_id.body)
}

provider "airflow" {
  base_endpoint = data.http.client_id.url
  oauth2_token  = data.google_service_account_id_token.oidc.id_token
}

Argument Reference

  • base_endpoint - (Required) The Airflow API endpoint.
  • oauth2_token - (Optional) An OAUTH2 identity token used to authenticate against an Airflow server. Conflicts with username and password
  • username - (Optional) The username to use for API basic authentication. Conflicts with oauth2_token
  • password - (Optional) The password to use for API basic authentication. Conflicts with oauth2_token

Running Acceptence Tests

Setting Up Local Environment

  • See Official docs and run docker-compose up spin up a local airflow cluster.
  • export AIRFLOW_BASE_ENDPOINT=http://localhost:8080
  • export AIRFLOW_API_PASSWORD=airflow
  • export AIRFLOW_API_USERNAME=airflow

Running Tests

Run make testacc

terraform-provider-airflow's People

Contributors

drfaust92 avatar houqp avatar petoju avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.