Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #30 from hashicorp/initial-tests
Browse files Browse the repository at this point in the history
Initial tests for project resource
  • Loading branch information
cicoyle authored Jun 2, 2023
2 parents 39fede8 + d87c197 commit f8c7a38
Show file tree
Hide file tree
Showing 16 changed files with 226 additions and 161 deletions.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,24 @@ terraform {
required_providers {
waypoint = {
source = "local/hashicorp/waypoint"
version = "0.1.0"
# version = ""
# latest version by default
# see the following resources for more information on specific versions:
# https://github.com/hashicorp/terraform-provider-waypoint/blob/main/CHANGELOG.md
# https://releases.hashicorp.com/
# https://github.com/hashicorp/terraform-provider-waypoint/releases
}
}
}
provider "waypoint" {
waypoint_addr = "localhost:9701"
token = "..."
# if running locally: localhost:9701,
# or use WAYPOINT_HOST environment variable
# host = ""
# output from `waypoint user token`,
# or use WAYPOINT_TOKEN environment variable
# token = ""
}
resource "waypoint_project" "example" {
Expand Down Expand Up @@ -76,6 +86,8 @@ resource "waypoint_project" "example" {
}
}
```
NOTE: `WAYPOINT_HOST` and `WAYPOINT_TOKEN` may be set as environment variables, and will override the provider host/token set in your terraform configuration.


## Developing the Provider

Expand Down
14 changes: 0 additions & 14 deletions docs/data-sources/runner_profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,6 @@ description: |-
## Example Usage

```terraform
terraform {
required_providers {
waypoint = {
source = "hashicorp/waypoint"
version = "0.1.0"
}
}
}
provider "waypoint" {
host = "localhost:9701"
token = ""
}
data "waypoint_runner_profile" "default_docker" {
id = "01GV45AW59XGNT906S8XXKG5E5"
}
Expand Down
18 changes: 14 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,25 @@ description: |-
terraform {
required_providers {
waypoint = {
source = "hashicorp/waypoint"
version = "0.1.0"
source = "hashicorp/waypoint"
# version = ""
# latest version by default
# see the following resources for more information on specific versions:
# https://github.com/hashicorp/terraform-provider-waypoint/blob/main/CHANGELOG.md
# https://releases.hashicorp.com/
# https://github.com/hashicorp/terraform-provider-waypoint/releases
}
}
}
provider "waypoint" {
waypoint_addr = "localhost:9701"
token = "..."
# if running locally: localhost:9701,
# or use WAYPOINT_HOST environment variable
# host = ""
# output from `waypoint user token`,
# or use WAYPOINT_TOKEN environment variable
# token = ""
}
```

Expand Down
2 changes: 2 additions & 0 deletions docs/resources/config_source.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ description: |-
## Example Usage

```terraform
## Example #1: global scoped
resource "waypoint_config_source" "globalvault" {
type = "globalvault"
scope = "global"
Expand All @@ -23,6 +24,7 @@ resource "waypoint_config_source" "globalvault" {
}
}
## Example #2: project scoped
resource "waypoint_config_source" "projectvault" {
type = "vault"
scope = "project"
Expand Down
62 changes: 42 additions & 20 deletions docs/resources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,51 @@ description: |-

```terraform
resource "waypoint_project" "example" {
project_name = "example"
remote_runners_enabled = false
remote_runners_enabled = true
data_source_git {
data_source_git = {
git_url = "https://github.com/hashicorp/waypoint-examples"
git_path = "docker/go"
git_ref = "HEAD"
file_change_signal = "some-signal"
git_poll_interval_seconds = 15
# ignore_changes_outside_path = true
}
app_status_poll_seconds = 12
project_variables = {
name = "devopsrob"
job = "dev-advocate"
conference = "HashiConf EU 2022"
project_variables = [
{
name = "name"
value = "devopsrob"
sensitive = true
},
{
name = "job"
value = "dev-advocate"
sensitive = false
},
{
name = "conference"
value = "HashiConf EU 2022"
sensitive = false
},
]
git_auth_basic = {
username = "catsby"
password = "test"
}
}
##Git auth ssh example
resource "waypoint_project" "example" {
resource "waypoint_project" "example1" {
project_name = "example"
project_name = "example1"
remote_runners_enabled = true
data_source_git {
data_source_git = {
git_url = "https://github.com/hashicorp/waypoint-examples"
git_path = "docker/go"
git_ref = "HEAD"
Expand All @@ -51,16 +68,17 @@ resource "waypoint_project" "example" {
app_status_poll_seconds = 12
project_variables = {
name = "devopsrob"
job = "dev-advocate"
conference = "HashiConf EU 2022"
}
git_auth_ssh {
git_user = "devops-rob"
passphrase = "test-password"
project_variables = [
{
name = "devopsrob"
value = "dev-advocate"
sensitive = "false"
},
]
git_auth_ssh = {
git_user = "cassie"
passphrase = "test"
ssh_private_key = <<EOF
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQCjcGqTkOq0CR3rTx0ZSQSIdTrDrFAYl29611xN8aVgMQIWtDB/
Expand Down Expand Up @@ -98,6 +116,10 @@ EOF
- `project_variables` (Attributes List) List of variables in Key/value pairs associated with the Waypoint Project (see [below for nested schema](#nestedatt--project_variables))
- `remote_runners_enabled` (Boolean) Enable remote runners for project

### Read-Only

- `id` (String) The id required for acceptance testing to work

<a id="nestedatt--data_source_git"></a>
### Nested Schema for `data_source_git`

Expand Down
14 changes: 0 additions & 14 deletions examples/data-sources/waypoint_runner_profile/data-source.tf
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
terraform {
required_providers {
waypoint = {
source = "hashicorp/waypoint"
version = "0.1.0"
}
}
}

provider "waypoint" {
host = "localhost:9701"
token = ""
}

data "waypoint_runner_profile" "default_docker" {
id = "01GV45AW59XGNT906S8XXKG5E5"
}
Expand Down
19 changes: 14 additions & 5 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
terraform {
required_providers {
waypoint = {
source = "hashicorp/waypoint"
version = "0.1.0"
source = "hashicorp/waypoint"
# version = ""
# latest version by default
# see the following resources for more information on specific versions:
# https://github.com/hashicorp/terraform-provider-waypoint/blob/main/CHANGELOG.md
# https://releases.hashicorp.com/
# https://github.com/hashicorp/terraform-provider-waypoint/releases
}
}
}

provider "waypoint" {
waypoint_addr = "localhost:9701"
token = "..."
}
# if running locally: localhost:9701,
# or use WAYPOINT_HOST environment variable
# host = ""

# output from `waypoint user token`,
# or use WAYPOINT_TOKEN environment variable
# token = ""
}
2 changes: 2 additions & 0 deletions examples/resources/waypoint_config_source/resource.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
## Example #1: global scoped
resource "waypoint_config_source" "globalvault" {
type = "globalvault"
scope = "global"
Expand All @@ -8,6 +9,7 @@ resource "waypoint_config_source" "globalvault" {
}
}

## Example #2: project scoped
resource "waypoint_config_source" "projectvault" {
type = "vault"
scope = "project"
Expand Down
53 changes: 0 additions & 53 deletions examples/resources/waypoint_project/provider.tf

This file was deleted.

Loading

0 comments on commit f8c7a38

Please sign in to comment.