Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions docs/resources/platform_apikey.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,31 @@ resource "harness_platform_apikey" "test" {

- `id` (String) The ID of this resource.

### Important Note: Managing resource dependency order.

Terraform determines deletion order based on resource dependencies. To avoid unexpected behavior, it’s recommended to define explicit `depends_on` blocks so resources are created and destroyed in the correct sequence.

The expected order is:

* **Create:** Service Account → API Key → Token
* **Destroy:** Token → API Key → Service Account

You can enforce this explicitly in your Terraform configuration:

```terraform
resource "harness_platform_token" "token" {
...
depends_on = [harness_platform_apikey.apikey]
}

resource "harness_platform_apikey" "apikey" {
...
depends_on = [harness_platform_service_account.service_account]
}
```

This ensures Terraform manages these resources in the proper order during both creation and deletion.

## Import

Import is supported using the following syntax:
Expand Down
26 changes: 26 additions & 0 deletions docs/resources/platform_service_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,31 @@ resource "harness_platform_service_account" "example" {

- `id` (String) The ID of this resource.

### Important Note: Managing resource dependency order.

Terraform determines deletion order based on resource dependencies. To avoid unexpected behavior, it’s recommended to define explicit `depends_on` blocks so resources are created and destroyed in the correct sequence.

The expected order is:

* **Create:** Service Account → API Key → Token
* **Destroy:** Token → API Key → Service Account

You can enforce this explicitly in your Terraform configuration:

```terraform
resource "harness_platform_token" "token" {
...
depends_on = [harness_platform_apikey.apikey]
}

resource "harness_platform_apikey" "apikey" {
...
depends_on = [harness_platform_service_account.service_account]
}
```

This ensures Terraform manages these resources in the proper order during both creation and deletion.

## Import

Import is supported using the following syntax:
Expand All @@ -60,3 +85,4 @@ terraform import harness_platform_service_account.example <ord_id>/<service_acco
# Import project level service account
terraform import harness_platform_service_account.example <org_id>/<project_id>/<service_account_id>
```

27 changes: 26 additions & 1 deletion docs/resources/platform_token.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,31 @@ resource "harness_platform_token" "test" {
- `id` (String) The ID of this resource.
- `value` (String, Sensitive) Value of the Token

### Important Note: Managing resource dependency order.

Terraform determines deletion order based on resource dependencies. To avoid unexpected behavior, it’s recommended to define explicit `depends_on` blocks so resources are created and destroyed in the correct sequence.

The expected order is:

* **Create:** Service Account → API Key → Token
* **Destroy:** Token → API Key → Service Account

You can enforce this explicitly in your Terraform configuration:

```terraform
resource "harness_platform_token" "token" {
...
depends_on = [harness_platform_apikey.apikey]
}

resource "harness_platform_apikey" "apikey" {
...
depends_on = [harness_platform_service_account.service_account]
}
```

This ensures Terraform manages these resources in the proper order during both creation and deletion.

## Import

Import is supported using the following syntax:
Expand All @@ -93,4 +118,4 @@ terraform import harness_platform_token <org_id>/<parent_id>/<apikey_id>/<apikey

# Import project level token
terraform import harness_platform_token <org_id>/<project_id>/<parent_id>/<apikey_id>/<apikey_type>/<token_id>
```
```