Skip to content

Commit

Permalink
docs: Add examples for two Waypoint resources.
Browse files Browse the repository at this point in the history
  • Loading branch information
paladin-devops committed Dec 18, 2024
1 parent 902fc97 commit 36180d3
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 4 deletions.
1 change: 0 additions & 1 deletion docs/data-sources/waypoint_add_on_definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ The Waypoint Add-on Definition data source retrieves information on a given Add-
- `terraform_agent_pool_id` (String) The ID of the Terraform agent pool.
- `terraform_cloud_workspace_details` (Attributes) Terraform Cloud Workspace details. (see [below for nested schema](#nestedatt--terraform_cloud_workspace_details))
- `terraform_execution_mode` (String) The execution mode for the Terraform Cloud workspace.
- `terraform_no_code_module_id` (String) The ID of the Terraform no-code module to use for running Terraform operations
- `terraform_no_code_module_source` (String) Terraform No Code Module source
- `variable_options` (Attributes List) List of variable options for the Add-on Definition. (see [below for nested schema](#nestedatt--variable_options))

Expand Down
1 change: 0 additions & 1 deletion docs/data-sources/waypoint_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ The Waypoint Template data source retrieves information on a given Template.
- `terraform_agent_pool_id` (String) Terraform agent pool ID
- `terraform_cloud_workspace_details` (Attributes) Terraform Cloud Workspace details (see [below for nested schema](#nestedatt--terraform_cloud_workspace_details))
- `terraform_execution_mode` (String) Terraform execution mode
- `terraform_no_code_module_id` (String) The ID of the Terraform no-code module to use for running Terraform operations
- `terraform_no_code_module_source` (String) Terraform No Code Module source
- `variable_options` (Attributes List) List of variable options for the template (see [below for nested schema](#nestedatt--variable_options))

Expand Down
25 changes: 24 additions & 1 deletion docs/resources/waypoint_add_on_definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,30 @@ description: |-

Waypoint Add-on Definition resource

## Example Usage

```terraform
resource "hcp_waypoint_add_on_definition" "add_on_definition" {
name = "postgres"
summary = "An add-on that provisions a PostgreSQL database."
description = <<EOF
This add-on provisions a PostgreSQL database in AWS. The database is provisioned
with a default schema and user.
EOF
terraform_project_id = "prj-123456"
labels = ["postgres", "aws", "db"]
terraform_no_code_module_source = "private/fake-org/postgres-aws/aws"
terraform_no_code_module_id = "nocode-abcdef"
variable_options = [
{
name = "size"
user_editable = true
options = ["small", "medium", "large"]
}
]
}
```

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

Expand All @@ -19,7 +43,6 @@ Waypoint Add-on Definition resource
- `description` (String) A longer description of the Add-on Definition.
- `name` (String) The name of the Add-on Definition.
- `summary` (String) A short summary of the Add-on Definition.
- `terraform_no_code_module_id` (String) The ID of the Terraform no-code module to use for running Terraform operations. This is in the format of 'nocode-<ID>'.
- `terraform_no_code_module_source` (String) Terraform Cloud no-code Module Source, expected to be in one of the following formats: "app.terraform.io/hcp_waypoint_example/ecs-advanced-microservice/aws" or "private/hcp_waypoint_example/ecs-advanced-microservice/aws".
- `terraform_project_id` (String) The ID of the Terraform Cloud Project to create workspaces in. The ID is found on the Terraform Cloud Project settings page.

Expand Down
32 changes: 31 additions & 1 deletion docs/resources/waypoint_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,44 @@ description: |-

Waypoint Template resource

## Example Usage

```terraform
resource "hcp_waypoint_template" "template" {
name = "go-k8s-microservice"
summary = "A simple Go microservice running on Kubernetes."
description = <<EOF
This template deploys a simple Go microservice to Kubernetes. The microservice
is a simple HTTP server that listens on port 8080 and returns a JSON response.
The template includes a Dockerfile, Kubernetes manifests, and boiler plate code
for a gRPC service written in Go.
EOF
terraform_project_id = "prj-123456"
labels = ["go", "kubernetes"]
terraform_no_code_module_source = "private/fake-org/go-k8s-microservice/kubernetes"
terraform_no_code_module_id = "nocode-123456"
variable_options = [
{
name = "resource_size"
user_editable = true
options = ["small", "medium", "large"]
},
{
name = "service_port"
user_editable = false
options = ["8080"]
},
]
}
```

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

### Required

- `name` (String) The name of the Template.
- `summary` (String) A brief description of the template, up to 110 characters.
- `terraform_no_code_module_id` (String) The ID of the Terraform no-code module to use for running Terraform operations. This is in the format of 'nocode-<ID>'.
- `terraform_no_code_module_source` (String) Terraform Cloud No-Code Module details
- `terraform_project_id` (String) The ID of the Terraform Cloud Project to create workspaces in. The ID is found on the Terraform Cloud Project settings page.

Expand Down
19 changes: 19 additions & 0 deletions examples/resources/hcp_waypoint_add_on_definition/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
resource "hcp_waypoint_add_on_definition" "add_on_definition" {
name = "postgres"
summary = "An add-on that provisions a PostgreSQL database."
description = <<EOF
This add-on provisions a PostgreSQL database in AWS. The database is provisioned
with a default schema and user.
EOF
terraform_project_id = "prj-123456"
labels = ["postgres", "aws", "db"]
terraform_no_code_module_source = "private/fake-org/postgres-aws/aws"
terraform_no_code_module_id = "nocode-abcdef"
variable_options = [
{
name = "size"
user_editable = true
options = ["small", "medium", "large"]
}
]
}
26 changes: 26 additions & 0 deletions examples/resources/hcp_waypoint_template/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
resource "hcp_waypoint_template" "template" {
name = "go-k8s-microservice"
summary = "A simple Go microservice running on Kubernetes."
description = <<EOF
This template deploys a simple Go microservice to Kubernetes. The microservice
is a simple HTTP server that listens on port 8080 and returns a JSON response.
The template includes a Dockerfile, Kubernetes manifests, and boiler plate code
for a gRPC service written in Go.
EOF
terraform_project_id = "prj-123456"
labels = ["go", "kubernetes"]
terraform_no_code_module_source = "private/fake-org/go-k8s-microservice/kubernetes"
terraform_no_code_module_id = "nocode-123456"
variable_options = [
{
name = "resource_size"
user_editable = true
options = ["small", "medium", "large"]
},
{
name = "service_port"
user_editable = false
options = ["8080"]
},
]
}
4 changes: 4 additions & 0 deletions templates/resources/waypoint_add_on_definition.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ description: |-

{{ .Description | trimspace }}

## Example Usage

{{ tffile "examples/resources/hcp_waypoint_add_on_definition/resource.tf" }}

{{ .SchemaMarkdown | trimspace }}
4 changes: 4 additions & 0 deletions templates/resources/waypoint_template.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ description: |-

{{ .Description | trimspace }}

## Example Usage

{{ tffile "examples/resources/hcp_waypoint_template/resource.tf" }}

{{ .SchemaMarkdown | trimspace }}

0 comments on commit 36180d3

Please sign in to comment.