Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
micahlmartin committed Nov 3, 2021
1 parent de9cee1 commit a7f65df
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 1 deletion.
46 changes: 46 additions & 0 deletions docs/resources/connector.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,40 @@ description: |-

Resource for creating a connector. This resource is part of the Harness nextgen platform.

## Example Usage

```terraform
# Create a kubernetes connector
resource "harness_connector" "test" {
identifier = "k8s"
name = "Test Kubernetes Cluster"
k8s_cluster {
service_account {
master_url = "https://kubernetes.example.com"
service_account_token_ref = "account.k8s_service_account_token"
}
}
}
# Create a docker registry connector
resource "harness_connector" "test" {
identifier = "dockerhub"
name = "Docker Hub"
docker_registry {
type = "DockerHub"
url = "https://hub.docker.io"
credentials {
username = "admin"
password_ref = "account.docker_registry_password"
}
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down Expand Up @@ -215,4 +248,17 @@ Optional:
- **username** (String) Username for the connector.
- **username_ref** (String) Reference to the secret containing the username for the connector.

## Import

Import is supported using the following syntax:

```shell
# Import an account level connector
terraform import harness_connector.example <connector_id>

# Import an organization level connector
terraform import harness_connector.example <organization_id>/<connector_id>

# Import an project level connector
terraform import harness_connector.example <organization_id>/<project_id>/<connector_id>
```
16 changes: 16 additions & 0 deletions docs/resources/organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ description: |-

Resource for creating a Harness organization. This resource is part of the Harness nextgen platform.

## Example Usage

```terraform
resource "harness_organization" "test" {
identifier = "MyOrg"
name = "My Otganization"
description = "An example organization"
tags = ["foo:bar", "baz:qux"]
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -26,4 +35,11 @@ Resource for creating a Harness organization. This resource is part of the Harne
- **id** (String) The ID of this resource.
- **tags** (Set of String) Tags associated with the organization.

## Import

Import is supported using the following syntax:

```shell
# Import using organization id
terraform import harness_organization.example <organization_id>
```
15 changes: 15 additions & 0 deletions docs/resources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ description: |-

Resource for creating a Harness project. This resource is part of the Harness nextgen platform.

## Example Usage

```terraform
resource "harness_project" "test" {
identifier = "testproject"
name = "Test Project"
color = "#0063F7"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -32,4 +40,11 @@ Resource for creating a Harness project. This resource is part of the Harness ne
- **modules** (Set of String) Modules in the project.
- **tags** (Set of String) Tags associated with the project.

## Import

Import is supported using the following syntax:

```shell
# Import using the connector using the organization id and the connector id
terraform import harness_connector.example <organization_id>/<connector_id>
```
8 changes: 8 additions & 0 deletions examples/resources/harness_connector/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Import an account level connector
terraform import harness_connector.example <connector_id>

# Import an organization level connector
terraform import harness_connector.example <organization_id>/<connector_id>

# Import an project level connector
terraform import harness_connector.example <organization_id>/<project_id>/<connector_id>
30 changes: 30 additions & 0 deletions examples/resources/harness_connector/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Create a kubernetes connector

resource "harness_connector" "test" {
identifier = "k8s"
name = "Test Kubernetes Cluster"

k8s_cluster {
service_account {
master_url = "https://kubernetes.example.com"
service_account_token_ref = "account.k8s_service_account_token"
}
}
}

# Create a docker registry connector

resource "harness_connector" "test" {
identifier = "dockerhub"
name = "Docker Hub"

docker_registry {
type = "DockerHub"
url = "https://hub.docker.io"

credentials {
username = "admin"
password_ref = "account.docker_registry_password"
}
}
}
2 changes: 2 additions & 0 deletions examples/resources/harness_organization/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Import using organization id
terraform import harness_organization.example <organization_id>
6 changes: 6 additions & 0 deletions examples/resources/harness_organization/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
resource "harness_organization" "test" {
identifier = "MyOrg"
name = "My Otganization"
description = "An example organization"
tags = ["foo:bar", "baz:qux"]
}
2 changes: 2 additions & 0 deletions examples/resources/harness_project/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Import using the connector using the organization id and the connector id
terraform import harness_connector.example <organization_id>/<connector_id>
5 changes: 5 additions & 0 deletions examples/resources/harness_project/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resource "harness_project" "test" {
identifier = "testproject"
name = "Test Project"
color = "#0063F7"
}
2 changes: 1 addition & 1 deletion internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func ConfigAsCodeDescription(descripton string) string {
}

func GetNextgenDescription(description string) string {
return fmt.Sprintf("%s %s", description, NextgenDescription)
return fmt.Sprintf("[NG] - %s %s", description, NextgenDescription)
}

func ExpandDelegateSelectors(ds []interface{}) []string {
Expand Down

0 comments on commit a7f65df

Please sign in to comment.