diff --git a/README.md b/README.md index 5dd11d7..d049a95 100644 --- a/README.md +++ b/README.md @@ -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" { @@ -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 diff --git a/docs/data-sources/runner_profile.md b/docs/data-sources/runner_profile.md index 6160dc6..f098db9 100644 --- a/docs/data-sources/runner_profile.md +++ b/docs/data-sources/runner_profile.md @@ -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" } diff --git a/docs/index.md b/docs/index.md index 9f7d9e1..c992933 100644 --- a/docs/index.md +++ b/docs/index.md @@ -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 = "" } ``` diff --git a/docs/resources/config_source.md b/docs/resources/config_source.md index 9de38aa..ff9f8aa 100644 --- a/docs/resources/config_source.md +++ b/docs/resources/config_source.md @@ -13,6 +13,7 @@ description: |- ## Example Usage ```terraform +## Example #1: global scoped resource "waypoint_config_source" "globalvault" { type = "globalvault" scope = "global" @@ -23,6 +24,7 @@ resource "waypoint_config_source" "globalvault" { } } +## Example #2: project scoped resource "waypoint_config_source" "projectvault" { type = "vault" scope = "project" diff --git a/docs/resources/project.md b/docs/resources/project.md index d449c40..7ce3939 100644 --- a/docs/resources/project.md +++ b/docs/resources/project.md @@ -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" @@ -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 = < ### Nested Schema for `data_source_git` diff --git a/examples/data-sources/waypoint_runner_profile/data-source.tf b/examples/data-sources/waypoint_runner_profile/data-source.tf index bbe5caa..98ab4ca 100644 --- a/examples/data-sources/waypoint_runner_profile/data-source.tf +++ b/examples/data-sources/waypoint_runner_profile/data-source.tf @@ -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" } diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index 1b404e6..16134eb 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -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 = "" +} \ No newline at end of file diff --git a/examples/resources/waypoint_config_source/resource.tf b/examples/resources/waypoint_config_source/resource.tf index 74840e2..be1e7e2 100644 --- a/examples/resources/waypoint_config_source/resource.tf +++ b/examples/resources/waypoint_config_source/resource.tf @@ -1,3 +1,4 @@ +## Example #1: global scoped resource "waypoint_config_source" "globalvault" { type = "globalvault" scope = "global" @@ -8,6 +9,7 @@ resource "waypoint_config_source" "globalvault" { } } +## Example #2: project scoped resource "waypoint_config_source" "projectvault" { type = "vault" scope = "project" diff --git a/examples/resources/waypoint_project/provider.tf b/examples/resources/waypoint_project/provider.tf deleted file mode 100644 index 988eaf9..0000000 --- a/examples/resources/waypoint_project/provider.tf +++ /dev/null @@ -1,53 +0,0 @@ -terraform { - required_providers { - waypoint = { - source = "hashicorp/waypoint" - version = "0.1.0" - } - } -} - -provider "waypoint" { - host = "localhost:9701" - token = "" -} - -resource "waypoint_project" "example" { - - project_name = "example" - remote_runners_enabled = true - - 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 = "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" - } -} diff --git a/examples/resources/waypoint_project/resource.tf b/examples/resources/waypoint_project/resource.tf index 538cf24..8a5e1be 100644 --- a/examples/resources/waypoint_project/resource.tf +++ b/examples/resources/waypoint_project/resource.tf @@ -1,32 +1,49 @@ 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" @@ -36,16 +53,17 @@ resource "waypoint_project" "example" { app_status_poll_seconds = 12 - project_variables = { - name = "devopsrob" - job = "dev-advocate" - conference = "HashiConf EU 2022" - } - + project_variables = [ + { + name = "devopsrob" + value = "dev-advocate" + sensitive = "false" + }, + ] - git_auth_ssh { - git_user = "devops-rob" - passphrase = "test-password" + git_auth_ssh = { + git_user = "cassie" + passphrase = "test" ssh_private_key = <