Skip to content

Commit

Permalink
22 feat implement dagster code location from document (#60)
Browse files Browse the repository at this point in the history
Co-authored-by: Nico Gelders <[email protected]>
Co-authored-by: Quinten Bruynseraede <[email protected]>
  • Loading branch information
3 people committed Jun 27, 2024
1 parent 6280fb2 commit 79fb6fb
Show file tree
Hide file tree
Showing 14 changed files with 1,111 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ Terraform provider to manage Dagster Cloud resources.
| Current deployment | | :heavy_check_mark: |
| Deployment | :heavy_check_mark: | :x: |
| Deployment settings | :heavy_check_mark: | :x: |
| Code location | Partial | :x: |
| Code location | :heavy_check_mark: | :x: |
| Team | :heavy_check_mark: | :x: |
| Team membership | :heavy_check_mark: | :x: |
38 changes: 38 additions & 0 deletions docs/resources/code_location_from_document.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "dagster_code_location_from_document Resource - dagster"
subcategory: ""
description: |-
Creates a code location from a dagster configuration document.
---

# dagster_code_location_from_document (Resource)

Creates a code location from a dagster configuration document.

## Example Usage

```terraform
resource "dagster_code_location_from_document" "example" {
document = data.dagster_configuration_document.example.json
}
data "dagster_configuration_document" "example" {
yaml_body = <<YAML
location_name: "example_code_location_from_document"
code_source:
python_file: "a_python_file.py"
YAML
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `document` (String) Code location as a JSON document. We recommend using a `dagster_configuration_document` to generate this instead of composing a JSON document yourself.

### Read-Only

- `name` (String) Code location name
47 changes: 47 additions & 0 deletions examples/e2e/code_location_from_document/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
variable "organization" {
type = string
}

variable "deployment" {
type = string
}

variable "api_token" {
type = string
}

terraform {
required_version = ">= 1.3.5"

required_providers {
dagster = {
source = "datarootsio/dagster"
}
}

backend "local" {
path = "terraform.tfstate"
}
}

provider "dagster" {
organization = var.organization
deployment = var.deployment
api_token = var.api_token
}

resource "dagster_code_location_from_document" "example" {
document = data.dagster_configuration_document.example.json
}

data "dagster_configuration_document" "example" {
yaml_body = <<YAML
location_name: "example_code_location_from_document"
code_source:
python_file: "a_python_file.py"
YAML
}

output "code_location" {
value = dagster_code_location_from_document.example
}
11 changes: 11 additions & 0 deletions examples/resources/dagster_code_location_from_document/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
resource "dagster_code_location_from_document" "example" {
document = data.dagster_configuration_document.example.json
}

data "dagster_configuration_document" "example" {
yaml_body = <<YAML
location_name: "example_code_location_from_document"
code_source:
python_file: "a_python_file.py"
YAML
}
Loading

0 comments on commit 79fb6fb

Please sign in to comment.