Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/mkdocs-gh-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: mkdocs gh-deploy

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: "3.8"
- name: Cache pip
id: cache
uses: actions/cache@v1
with:
path: ~/.cache/pip # This path is specific to Ubuntu
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip
${{ runner.os }}
- name: Pip install requirements
run: pip install -r requirements.txt
- name: MkDocs
env:
GH_PAT: ${{ secrets.GH_PAT }}
run: |
git remote set-url origin https://x-access-token:${GH_PAT}@github.com/${GITHUB_REPOSITORY}.git
mkdocs gh-deploy
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v2.3.4

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: "1.15"
go-version: 1.16

- name: Test
run: make test build
75 changes: 75 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
---
layout: "airflow"
page_title: "Provider: Airflow"
sidebar_current: "docs-airflow-index"
description: |-
The Airflow provider is used to interact with Airflow.
---

# Airflow Provider

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.

Use the navigation to the left to read about the available data sources.

## Example Usage

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

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

## Authentication

An OAUTH2 token must be passed to the provider block.

### Google Composer Example

```terraform
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` - (Required) An OAUTH2 identity token used to authenticate against an Airflow server.
47 changes: 47 additions & 0 deletions docs/resources/airflow_connection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
layout: "airflow"
page_title: "Airflow: airflow_connection"
sidebar_current: "docs-airflow-resource-connection"
description: |-
Provides an Airflow connection
---

# airflow_connection

Provides an Airflow connection.

## Example Usage

```hcl
resource airflow_connection "example" {
connection_id = "example"
conn_type = "example"
}
```

## Argument Reference

The following arguments are supported:

* `connection_id` - (Required) The connection ID.
* `conn_type` - (Required) The connection type.
* `host` - (Optional) The host of the connection.
* `login` - (Optional) The login of the connection.
* `schema` - (Optional) The schema of the connection.
* `port` - (Optional) The port of the connection.
* `password` - (Optional) The paasword of the connection.
* `extra` - (Optional) Other values that cannot be put into another field, e.g. RSA keys.

## Attributes Reference

This resource exports the following attributes:

* `id` - The connection id.

## Import

Content can be imported using the connection key.

```terraform
terraform import airflow_connection.default example
```
45 changes: 45 additions & 0 deletions docs/resources/airflow_pool.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
layout: "airflow"
page_title: "Airflow: airflow_pool"
sidebar_current: "docs-airflow-resource-pool"
description: |-
Provides an Airflow pool
---

# airflow_pool

Provides an Airflow pool.

## Example Usage

```hcl
resource airflow_pool "example" {
name = "example"
slots = 2
}
```

## Argument Reference

The following arguments are supported:

* `name` - (Required) The name of pool.
* `slots` - (Required) The maximum number of slots that can be assigned to tasks. One job may occupy one or more slots.

## Attributes Reference

This resource exports the following attributes:

* `id` - The pool name.
* `occupied_slots` - The number of slots used by running/queued tasks at the moment.
* `used_slots` - The number of slots used by running tasks at the moment.
* `queued_slots` - The number of slots used by queued tasks at the moment.
* `open_slots` - The number of free slots at the moment.

## Import

Content can be imported using the pool name.

```terraform
terraform import airflow_pool.default example
```
41 changes: 41 additions & 0 deletions docs/resources/airflow_variable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
layout: "airflow"
page_title: "Airflow: airflow_variable"
sidebar_current: "docs-airflow-resource-variable"
description: |-
Provides an Airflow variable
---

# airflow_variable

Provides an Airflow variable.

## Example Usage

```hcl
resource airflow_variable "example" {
key = "example"
value = "example"
}
```

## Argument Reference

The following arguments are supported:

* `key` - (Required) The variable key.
* `value` - (Required) The variable value.

## Attributes Reference

This resource exports the following attributes:

* `id` - The variable key.

## Import

Content can be imported using the variable key.

```terraform
terraform import airflow_variable.default example
```