Skip to content

Commit

Permalink
Merge pull request #15 from DopplerHQ/nic/new-resources
Browse files Browse the repository at this point in the history
Add resources for Doppler projects, environments, configs, and service tokens
  • Loading branch information
nmanoogian authored Feb 25, 2022
2 parents 22467a8 + 97b4641 commit e760904
Show file tree
Hide file tree
Showing 28 changed files with 1,260 additions and 85 deletions.
37 changes: 35 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,18 @@ terraform {
}
}
variable "doppler_token" {
type = string
}
provider "doppler" {
doppler_token = "<YOUR DOPPLER TOKEN>"
doppler_token = var.doppler_token
}
data "doppler_secrets" "this" {}
data "doppler_secrets" "this" {
project = "backend"
config = "dev"
}
# Access individual secrets
output "stripe_key" {
Expand All @@ -42,6 +49,32 @@ resource "doppler_secret" "db_password" {
name = "DB_PASSWORD"
value = random_password.db_password.result
}
# Create and modify Doppler projects, environments, configs, and service tokens
resource "doppler_project" "test_proj" {
name = "my-test-project"
description = "This is a test project"
}
resource "doppler_environment" "ci" {
project = doppler_project.test_proj.name
slug = "ci"
name = "CI-CD"
}
resource "doppler_config" "ci_github" {
project = doppler_project.test_proj.name
environment = doppler_environment.ci.slug
name = "ci_github"
}
resource "doppler_service_token" "ci_github_token" {
project = doppler_project.test_proj.name
config = doppler_config.ci_github.name
name = "test token"
access = "read"
}
```

# Development
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/secrets.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
page_title: "doppler_secrets Data Source - terraform-provider-doppler"
subcategory: "Secrets"
description: |-
Retrieves all secrets in the config.
Retrieve all secrets in the config.
---

# doppler_secrets (Data Source)

Retrieves all secrets in the config.
Retrieve all secrets in the config.

## Example Usage

Expand Down
35 changes: 35 additions & 0 deletions docs/resources/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
page_title: "doppler_config Resource - terraform-provider-doppler"
subcategory: ""
description: |-
Manage a Doppler config.
---

# doppler_config (Resource, Pre-Release)

**This resource is in pre-release and is not intended to be used in production.**

Manage a Doppler config.

## Example Usage

```terraform
resource "doppler_config" "backend_ci_github" {
project = "backend"
environment = "ci"
name = "ci_github"
}
```

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

### Required

- **environment** (String) The name of the Doppler environment where the config is located
- **name** (String) The name of the Doppler config
- **project** (String) The name of the Doppler project where the config is located

### Optional

- **id** (String) The ID of this resource.
35 changes: 35 additions & 0 deletions docs/resources/environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
page_title: "doppler_environment Resource - terraform-provider-doppler"
subcategory: ""
description: |-
Manage a Doppler environment.
---

# doppler_environment (Resource, Pre-Release)

**This resource is in pre-release and is not intended to be used in production.**

Manage a Doppler environment.

## Example Usage

```terraform
resource "doppler_environment" "backend_ci" {
project = "backend"
slug = "ci"
name = "Continuous Integration"
}
```

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

### Required

- **name** (String) The name of the Doppler environment
- **project** (String) The name of the Doppler project where the environment is located
- **slug** (String) The slug of the Doppler environment

### Optional

- **id** (String) The ID of this resource.
33 changes: 33 additions & 0 deletions docs/resources/project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
page_title: "doppler_project Resource - terraform-provider-doppler"
subcategory: ""
description: |-
Manage a Doppler project.
---

# doppler_project (Resource, Pre-Release)

**This resource is in pre-release and is not intended to be used in production.**

Manage a Doppler project.

## Example Usage

```terraform
resource "doppler_project" "backend" {
name = "backend"
description = "The main backend project"
}
```

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

### Required

- **name** (String) The name of the Doppler project

### Optional

- **description** (String) The description of the Doppler project
- **id** (String) The ID of this resource.
4 changes: 2 additions & 2 deletions docs/resources/secret.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
page_title: "doppler_secret Resource - terraform-provider-doppler"
subcategory: ""
description: |-
Manages a single Doppler secret in a config.
Manage a single Doppler secret in a config.
---

# doppler_secret (Resource, Pre-Release)

**This resource is in pre-release and is not intended to be used in production.**

Manages a single Doppler secret in a config.
Manage a single Doppler secret in a config.

## Example Usage

Expand Down
43 changes: 43 additions & 0 deletions docs/resources/service_token.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
page_title: "doppler_service_token Resource - terraform-provider-doppler"
subcategory: ""
description: |-
Manage a Doppler service_token.
---

# doppler_service_token (Resource, Pre-Release)

**This resource is in pre-release and is not intended to be used in production.**

Manage a Doppler service token.

## Example Usage

```terraform
resource "doppler_service_token" "backend_ci_token" {
project = "backend"
config = "ci"
name = "Builder Token"
access = "read"
}
# Service token key available as `doppler_service_token.backend_ci_token.key`
```

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

### Required

- **config** (String) The name of the Doppler config where the service token is located
- **name** (String) The name of the Doppler service token
- **project** (String) The name of the Doppler project where the service token is located

### Optional

- **access** (String) The access level (read or read/write)
- **id** (String) The ID of this resource.

### Read-Only

- **key** (String, Sensitive) The key for the Doppler service token
Loading

0 comments on commit e760904

Please sign in to comment.