generated from hashicorp/terraform-provider-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [CDS-98026]: TF support for gitops project (#1003)
* fix: [CDS-98026]: Terraform Project resources * fix: [CDS-98026]: Terraform Project resources * fix: [CDS-98026]: Terraform Project resources * fix: [CDS-98026]: Terraform Project resources * feat: [CDS-98026]: TF support for gitops project * feat: [CDS-98026]: TF support for gitops project * feat: [CDS-98026]: TF support for gitops project * feat: [CDS-98026]: TF support for gitops project * feat: [CDS-98026]: TF support for gitops project * feat: [CDS-98026]: TF support for gitops project * feat: [CDS-98026]: TF support for gitops project * feat: [CDS-98026]: TF support for gitops project
- Loading branch information
1 parent
39f3d68
commit 66c8d4c
Showing
15 changed files
with
1,272 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "harness_platform_gitops_project Data Source - terraform-provider-harness" | ||
subcategory: "Next Gen" | ||
description: |- | ||
--- | ||
|
||
# harness_platform_gitops_project (Data Source) | ||
|
||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
data "harness_platform_gitops_repository" "example" { | ||
agent_id = "agent_id" | ||
query_name = "query_name" | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `account_id` (String) Account identifier of the GitOps project. | ||
- `agent_id` (String) Agent identifier of the GitOps project. | ||
- `project` (Block List, Min: 1) App projects configuration details. (see [below for nested schema](#nestedblock--project)) | ||
|
||
### Optional | ||
|
||
- `org_id` (String) Org identifier of the GitOps project. | ||
- `project_id` (String) Project identifier of the GitOps repository. | ||
- `query_name` (String) Identifier for the GitOps project. | ||
- `upsert` (Boolean) Indicates if the GitOps repository should be updated if existing and inserted if not. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
|
||
<a id="nestedblock--project"></a> | ||
### Nested Schema for `project` | ||
|
||
Optional: | ||
|
||
- `metadata` (Block List) Metadata details that all persisted resources must have. (see [below for nested schema](#nestedblock--project--metadata)) | ||
- `spec` (Block List) Spec is the specification of an AppProject. (see [below for nested schema](#nestedblock--project--spec)) | ||
|
||
<a id="nestedblock--project--metadata"></a> | ||
### Nested Schema for `project.metadata` | ||
|
||
Optional: | ||
|
||
- `generation` (String) A sequence number representing a specific generation of the desired state. | ||
- `name` (String) Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. | ||
- `namespace` (String) The namespace where the GitOps project should be created. | ||
|
||
|
||
<a id="nestedblock--project--spec"></a> | ||
### Nested Schema for `project.spec` | ||
|
||
Optional: | ||
|
||
- `cluster_resource_whitelist` (Block List) ClusterResourceWhitelist contains list of whitelisted cluster level resources. (see [below for nested schema](#nestedblock--project--spec--cluster_resource_whitelist)) | ||
- `destinations` (Block List) Destinations contains list of destinations available for deployment. (see [below for nested schema](#nestedblock--project--spec--destinations)) | ||
- `source_repos` (List of String) SourceRepos contains list of repository URLs which can be used for deployment. | ||
|
||
<a id="nestedblock--project--spec--cluster_resource_whitelist"></a> | ||
### Nested Schema for `project.spec.cluster_resource_whitelist` | ||
|
||
Optional: | ||
|
||
- `group` (String) Cluster group name. | ||
- `kind` (String) Cluster kind. | ||
|
||
|
||
<a id="nestedblock--project--spec--destinations"></a> | ||
### Nested Schema for `project.spec.destinations` | ||
|
||
Optional: | ||
|
||
- `namespace` (String) Namespace specifies the target namespace for the application's resources. | ||
- `server` (String) Server specifies the URL of the target cluster and must be set to the Kubernetes control plane API. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
--- | ||
# generated by https://github.com/hashicorp/terraform-plugin-docs | ||
page_title: "harness_platform_gitops_project Resource - terraform-provider-harness" | ||
subcategory: "Next Gen" | ||
description: |- | ||
--- | ||
|
||
# harness_platform_gitops_project (Resource) | ||
|
||
|
||
|
||
## Example Usage | ||
|
||
```terraform | ||
// Create Account level gitOps project | ||
resource "harness_platform_gitops_project" "test" { | ||
account_id = "accountIdentifier" | ||
agent_id = "agentIdentifier" | ||
upsert = true | ||
project { | ||
metadata { | ||
generation = "generation" | ||
name = "name" | ||
namespace = "namespace" | ||
} | ||
spec { | ||
cluster_resource_whitelist { | ||
group = "*" | ||
kind = "*" | ||
} | ||
destinations { | ||
namespace = "*" | ||
server = "*" | ||
} | ||
source_repos = ["*"] | ||
} | ||
} | ||
} | ||
// Create Org level gitOps project | ||
resource "harness_platform_gitops_project" "test" { | ||
account_id = "accountIdentifier" | ||
org_id = "orgIdentifier" | ||
agent_id = "agentIdentifier" | ||
upsert = true | ||
project { | ||
metadata { | ||
generation = "generation" | ||
name = "name" | ||
namespace = "namespace" | ||
} | ||
spec { | ||
cluster_resource_whitelist { | ||
group = "*" | ||
kind = "*" | ||
} | ||
destinations { | ||
namespace = "*" | ||
server = "*" | ||
} | ||
source_repos = ["*"] | ||
} | ||
} | ||
} | ||
// Create Project level gitOps project | ||
resource "harness_platform_gitops_project" "test" { | ||
account_id = "accountIdentifier" | ||
org_id = "orgIdentifier" | ||
agent_id = "agentIdentifier" | ||
project_id = "projectIdentifier" | ||
upsert = true | ||
project { | ||
metadata { | ||
generation = "generation" | ||
name = "name" | ||
namespace = "namespace" | ||
} | ||
spec { | ||
cluster_resource_whitelist { | ||
group = "*" | ||
kind = "*" | ||
} | ||
destinations { | ||
namespace = "*" | ||
server = "*" | ||
} | ||
source_repos = ["*"] | ||
} | ||
} | ||
} | ||
``` | ||
|
||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
||
### Required | ||
|
||
- `account_id` (String) Account identifier of the GitOps project. | ||
- `agent_id` (String) Agent identifier of the GitOps project. | ||
- `project` (Block List, Min: 1) App projects configuration details. (see [below for nested schema](#nestedblock--project)) | ||
|
||
### Optional | ||
|
||
- `org_id` (String) Org identifier of the GitOps project. | ||
- `project_id` (String) Project identifier of the GitOps repository. | ||
- `query_name` (String) Identifier for the GitOps project. | ||
- `upsert` (Boolean) Indicates if the GitOps repository should be updated if existing and inserted if not. | ||
|
||
### Read-Only | ||
|
||
- `id` (String) The ID of this resource. | ||
|
||
<a id="nestedblock--project"></a> | ||
### Nested Schema for `project` | ||
|
||
Optional: | ||
|
||
- `metadata` (Block List) Metadata details that all persisted resources must have. (see [below for nested schema](#nestedblock--project--metadata)) | ||
- `spec` (Block List) Spec is the specification of an AppProject. (see [below for nested schema](#nestedblock--project--spec)) | ||
|
||
<a id="nestedblock--project--metadata"></a> | ||
### Nested Schema for `project.metadata` | ||
|
||
Optional: | ||
|
||
- `generation` (String) A sequence number representing a specific generation of the desired state. | ||
- `name` (String) Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. | ||
- `namespace` (String) The namespace where the GitOps project should be created. | ||
|
||
|
||
<a id="nestedblock--project--spec"></a> | ||
### Nested Schema for `project.spec` | ||
|
||
Optional: | ||
|
||
- `cluster_resource_whitelist` (Block List) ClusterResourceWhitelist contains list of whitelisted cluster level resources. (see [below for nested schema](#nestedblock--project--spec--cluster_resource_whitelist)) | ||
- `destinations` (Block List) Destinations contains list of destinations available for deployment. (see [below for nested schema](#nestedblock--project--spec--destinations)) | ||
- `source_repos` (List of String) SourceRepos contains list of repository URLs which can be used for deployment. | ||
|
||
<a id="nestedblock--project--spec--cluster_resource_whitelist"></a> | ||
### Nested Schema for `project.spec.cluster_resource_whitelist` | ||
|
||
Optional: | ||
|
||
- `group` (String) Cluster group name. | ||
- `kind` (String) Cluster kind. | ||
|
||
|
||
<a id="nestedblock--project--spec--destinations"></a> | ||
### Nested Schema for `project.spec.destinations` | ||
|
||
Optional: | ||
|
||
- `namespace` (String) Namespace specifies the target namespace for the application's resources. | ||
- `server` (String) Server specifies the URL of the target cluster and must be set to the Kubernetes control plane API. | ||
|
||
## Import | ||
|
||
Import is supported using the following syntax: | ||
|
||
```shell | ||
# Import an Account level Gitops Repository | ||
terraform import harness_platform_gitops_project.example <agent_id>/<query_name> | ||
|
||
# Import an Org level Gitops Repository | ||
terraform import harness_platform_gitops_repository.example <organization_id>/<agent_id>/<query_name | ||
|
||
# Import a Project level Gitops Repository | ||
terraform import harness_platform_gitops_repository.example <organization_id>/<project_id>/<agent_id>/<query_name> | ||
``` |
4 changes: 4 additions & 0 deletions
4
examples/data-sources/harness_platform_gitops_project/data-source.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
data "harness_platform_gitops_repository" "example" { | ||
agent_id = "agent_id" | ||
query_name = "query_name" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Import an Account level Gitops Repository | ||
terraform import harness_platform_gitops_project.example <agent_id>/<query_name> | ||
|
||
# Import an Org level Gitops Repository | ||
terraform import harness_platform_gitops_repository.example <organization_id>/<agent_id>/<query_name | ||
|
||
# Import a Project level Gitops Repository | ||
terraform import harness_platform_gitops_repository.example <organization_id>/<project_id>/<agent_id>/<query_name> |
77 changes: 77 additions & 0 deletions
77
examples/resources/harness_platform_gitops_project/resource.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
// Create Account level gitOps project | ||
resource "harness_platform_gitops_project" "test" { | ||
account_id = "accountIdentifier" | ||
agent_id = "agentIdentifier" | ||
upsert = true | ||
project { | ||
metadata { | ||
generation = "generation" | ||
name = "name" | ||
namespace = "namespace" | ||
} | ||
spec { | ||
cluster_resource_whitelist { | ||
group = "*" | ||
kind = "*" | ||
} | ||
destinations { | ||
namespace = "*" | ||
server = "*" | ||
} | ||
source_repos = ["*"] | ||
} | ||
} | ||
} | ||
|
||
// Create Org level gitOps project | ||
resource "harness_platform_gitops_project" "test" { | ||
account_id = "accountIdentifier" | ||
org_id = "orgIdentifier" | ||
agent_id = "agentIdentifier" | ||
upsert = true | ||
project { | ||
metadata { | ||
generation = "generation" | ||
name = "name" | ||
namespace = "namespace" | ||
} | ||
spec { | ||
cluster_resource_whitelist { | ||
group = "*" | ||
kind = "*" | ||
} | ||
destinations { | ||
namespace = "*" | ||
server = "*" | ||
} | ||
source_repos = ["*"] | ||
} | ||
} | ||
} | ||
|
||
// Create Project level gitOps project | ||
resource "harness_platform_gitops_project" "test" { | ||
account_id = "accountIdentifier" | ||
org_id = "orgIdentifier" | ||
agent_id = "agentIdentifier" | ||
project_id = "projectIdentifier" | ||
upsert = true | ||
project { | ||
metadata { | ||
generation = "generation" | ||
name = "name" | ||
namespace = "namespace" | ||
} | ||
spec { | ||
cluster_resource_whitelist { | ||
group = "*" | ||
kind = "*" | ||
} | ||
destinations { | ||
namespace = "*" | ||
server = "*" | ||
} | ||
source_repos = ["*"] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.