Skip to content

Commit

Permalink
feat: [CDS-101927]: Categorize CD + Pipeline Connectors (#1105)
Browse files Browse the repository at this point in the history
* feat: [CDS-101927]: Categorize CD Cloud Providers Connectors

* feat: [CDS-101927]: Categorize CD Artifact Repositories Connectors

* feat: [CDS-101927]: Categorize CD Code Repositories Connectors

* fix: [CDS-101927]: CD http helm ConnectorTest

* fix: [CDS-101927]: Add Cd Pre-requisite

* fix: [CDS-101927]: Fix Artifact Connector test

* fix: [CDS-101927]: Fix Artifact Connector test

* fix: [CDS-101927]: Fix Artifact Connector test

* fix: [CDS-101927]: Skip two Test for now.

* fix: [CDS-101927]: Fix HTTP HELM test
  • Loading branch information
ritek01 authored Oct 27, 2024
1 parent aca2822 commit ab568a4
Show file tree
Hide file tree
Showing 87 changed files with 883 additions and 181 deletions.
79 changes: 41 additions & 38 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ import (
cd_trigger "github.com/harness/terraform-provider-harness/internal/service/cd/trigger"
"github.com/harness/terraform-provider-harness/internal/service/cd/user"
"github.com/harness/terraform-provider-harness/internal/service/cd/yamlconfig"
cdng_connector_artifactRepositories "github.com/harness/terraform-provider-harness/internal/service/cd_nextgen/connector/artifactRepositories"
cdng_connector_cloudProviders "github.com/harness/terraform-provider-harness/internal/service/cd_nextgen/connector/cloudProviders"
cdng_connector_codeRepositories "github.com/harness/terraform-provider-harness/internal/service/cd_nextgen/connector/codeRepositories"
pl_account "github.com/harness/terraform-provider-harness/internal/service/platform/account"
pl_apikey "github.com/harness/terraform-provider-harness/internal/service/platform/api_key"
"github.com/harness/terraform-provider-harness/internal/service/platform/autostopping/load_balancer"
Expand Down Expand Up @@ -163,36 +166,36 @@ func Provider(version string) func() *schema.Provider {
"harness_platform_connector_azure_cloud_cost": connector.DataSourceConnectorAzureCloudCost(),
"harness_platform_connector_appdynamics": connector.DatasourceConnectorAppDynamics(),
"harness_platform_connector_elasticsearch": connector.DatasourceConnectorElasticSearch(),
"harness_platform_connector_artifactory": connector.DatasourceConnectorArtifactory(),
"harness_platform_connector_artifactory": cdng_connector_artifactRepositories.DatasourceConnectorArtifactory(),
"harness_platform_connector_aws_secret_manager": pl_secretManagers.DatasourceConnectorAwsSM(),
"harness_platform_connector_aws": connector.DatasourceConnectorAws(),
"harness_platform_connector_aws": cdng_connector_cloudProviders.DatasourceConnectorAws(),
"harness_platform_connector_awscc": connector.DatasourceConnectorAwsCC(),
"harness_platform_connector_awskms": pl_secretManagers.DatasourceConnectorAwsKms(),
"harness_platform_connector_bitbucket": connector.DatasourceConnectorBitbucket(),
"harness_platform_connector_bitbucket": cdng_connector_codeRepositories.DatasourceConnectorBitbucket(),
"harness_platform_connector_customhealthsource": connector.DatasourceConnectorCustomHealthSource(),
"harness_platform_connector_datadog": connector.DatasourceConnectorDatadog(),
"harness_platform_connector_docker": connector.DatasourceConnectorDocker(),
"harness_platform_connector_docker": cdng_connector_artifactRepositories.DatasourceConnectorDocker(),
"harness_platform_connector_jdbc": connector.DatasourceConnectorJDBC(),
"harness_platform_connector_dynatrace": connector.DatasourceConnectorDynatrace(),
"harness_platform_connector_gcp": connector.DatasourceConnectorGcp(),
"harness_platform_connector_gcp": cdng_connector_cloudProviders.DatasourceConnectorGcp(),
"harness_platform_connector_gcp_secret_manager": pl_secretManagers.DatasourceConnectorGcpSM(),
"harness_platform_connector_git": connector.DatasourceConnectorGit(),
"harness_platform_connector_github": connector.DatasourceConnectorGithub(),
"harness_platform_connector_gitlab": connector.DatasourceConnectorGitlab(),
"harness_platform_connector_helm": connector.DatasourceConnectorHelm(),
"harness_platform_connector_oci_helm": connector.DatasourceConnectorOciHelm(),
"harness_platform_connector_git": cdng_connector_codeRepositories.DatasourceConnectorGit(),
"harness_platform_connector_github": cdng_connector_codeRepositories.DatasourceConnectorGithub(),
"harness_platform_connector_gitlab": cdng_connector_codeRepositories.DatasourceConnectorGitlab(),
"harness_platform_connector_helm": cdng_connector_artifactRepositories.DatasourceConnectorHelm(),
"harness_platform_connector_oci_helm": cdng_connector_artifactRepositories.DatasourceConnectorOciHelm(),
"harness_platform_connector_jira": connector.DatasourceConnectorJira(),
"harness_platform_connector_jenkins": connector.DataSourceConnectorJenkins(),
"harness_platform_connector_kubernetes": connector.DatasourceConnectorKubernetes(),
"harness_platform_connector_nexus": connector.DatasourceConnectorNexus(),
"harness_platform_connector_jenkins": cdng_connector_artifactRepositories.DataSourceConnectorJenkins(),
"harness_platform_connector_kubernetes": cdng_connector_cloudProviders.DatasourceConnectorKubernetes(),
"harness_platform_connector_nexus": cdng_connector_artifactRepositories.DatasourceConnectorNexus(),
"harness_platform_connector_pagerduty": connector.DatasourceConnectorPagerDuty(),
"harness_platform_connector_prometheus": connector.DatasourceConnectorPrometheus(),
"harness_platform_connector_rancher": connector.DatasourceConnectorRancher(),
"harness_platform_connector_rancher": cdng_connector_cloudProviders.DatasourceConnectorRancher(),
"harness_platform_connector_splunk": connector.DatasourceConnectorSplunk(),
"harness_platform_connector_spot": connector.DatasourceConnectorSpot(),
"harness_platform_connector_terraform_cloud": connector.DatasourceConnectorTerraformCloud(),
"harness_platform_connector_spot": cdng_connector_cloudProviders.DatasourceConnectorSpot(),
"harness_platform_connector_terraform_cloud": cdng_connector_cloudProviders.DatasourceConnectorTerraformCloud(),
"harness_platform_connector_sumologic": connector.DatasourceConnectorSumologic(),
"harness_platform_connector_pdc": connector.DatasourceConnectorPdc(),
"harness_platform_connector_pdc": cdng_connector_cloudProviders.DatasourceConnectorPdc(),
"harness_platform_connector_custom_secret_manager": pl_secretManagers.DatasourceConnectorCustomSM(),
"harness_platform_current_account": pl_account.DataSourceCurrentAccount(),
"harness_platform_current_user": pl_current_user.DataSourceCurrentUser(),
Expand Down Expand Up @@ -258,8 +261,8 @@ func Provider(version string) func() *schema.Provider {
"harness_user_group": user.DataSourceUserGroup(),
"harness_user": user.DataSourceUser(),
"harness_yaml_config": yamlconfig.DataSourceYamlConfig(),
"harness_platform_connector_azure_cloud_provider": connector.DataSourceConnectorAzureCloudProvider(),
"harness_platform_connector_tas": connector.DataSourceConnectorTas(),
"harness_platform_connector_azure_cloud_provider": cdng_connector_cloudProviders.DataSourceConnectorAzureCloudProvider(),
"harness_platform_connector_tas": cdng_connector_cloudProviders.DataSourceConnectorTas(),
"harness_trigger": cd_trigger.DataSourceTrigger(),
"harness_platform_policy": policy.DataSourcePolicy(),
"harness_platform_policyset": policyset.DataSourcePolicyset(),
Expand Down Expand Up @@ -300,37 +303,37 @@ func Provider(version string) func() *schema.Provider {
"harness_platform_connector_azure_cloud_cost": connector.ResourceConnectorAzureCloudCost(),
"harness_platform_connector_appdynamics": connector.ResourceConnectorAppDynamics(),
"harness_platform_connector_elasticsearch": connector.ResourceConnectorElasticSearch(),
"harness_platform_connector_artifactory": connector.ResourceConnectorArtifactory(),
"harness_platform_connector_artifactory": cdng_connector_artifactRepositories.ResourceConnectorArtifactory(),
"harness_platform_connector_aws_secret_manager": pl_secretManagers.ResourceConnectorAwsSM(),
"harness_platform_connector_aws": connector.ResourceConnectorAws(),
"harness_platform_connector_aws": cdng_connector_cloudProviders.ResourceConnectorAws(),
"harness_platform_connector_awscc": connector.ResourceConnectorAwsCC(),
"harness_platform_connector_awskms": pl_secretManagers.ResourceConnectorAwsKms(),
"harness_platform_connector_bitbucket": connector.ResourceConnectorBitbucket(),
"harness_platform_connector_bitbucket": cdng_connector_codeRepositories.ResourceConnectorBitbucket(),
"harness_platform_connector_customhealthsource": connector.ResourceConnectorCustomHealthSource(),
"harness_platform_connector_datadog": connector.ResourceConnectorDatadog(),
"harness_platform_connector_docker": connector.ResourceConnectorDocker(),
"harness_platform_connector_docker": cdng_connector_artifactRepositories.ResourceConnectorDocker(),
"harness_platform_connector_jdbc": connector.ResourceConnectorJDBC(),
"harness_platform_connector_dynatrace": connector.ResourceConnectorDynatrace(),
"harness_platform_connector_gcp": connector.ResourceConnectorGcp(),
"harness_platform_connector_gcp": cdng_connector_cloudProviders.ResourceConnectorGcp(),
"harness_platform_connector_gcp_secret_manager": pl_secretManagers.ResourceConnectorGCPSecretManager(),
"harness_platform_connector_git": connector.ResourceConnectorGit(),
"harness_platform_connector_github": connector.ResourceConnectorGithub(),
"harness_platform_connector_gitlab": connector.ResourceConnectorGitlab(),
"harness_platform_connector_helm": connector.ResourceConnectorHelm(),
"harness_platform_connector_oci_helm": connector.ResourceConnectorOciHelm(),
"harness_platform_connector_git": cdng_connector_codeRepositories.ResourceConnectorGit(),
"harness_platform_connector_github": cdng_connector_codeRepositories.ResourceConnectorGithub(),
"harness_platform_connector_gitlab": cdng_connector_codeRepositories.ResourceConnectorGitlab(),
"harness_platform_connector_helm": cdng_connector_artifactRepositories.ResourceConnectorHelm(),
"harness_platform_connector_oci_helm": cdng_connector_artifactRepositories.ResourceConnectorOciHelm(),
"harness_platform_connector_jira": connector.ResourceConnectorJira(),
"harness_platform_connector_jenkins": connector.ResourceConnectorJenkins(),
"harness_platform_connector_kubernetes": connector.ResourceConnectorK8s(),
"harness_platform_connector_jenkins": cdng_connector_artifactRepositories.ResourceConnectorJenkins(),
"harness_platform_connector_kubernetes": cdng_connector_cloudProviders.ResourceConnectorK8s(),
"harness_platform_connector_newrelic": connector.ResourceConnectorNewRelic(),
"harness_platform_connector_nexus": connector.ResourceConnectorNexus(),
"harness_platform_connector_nexus": cdng_connector_artifactRepositories.ResourceConnectorNexus(),
"harness_platform_connector_pagerduty": connector.ResourceConnectorPagerDuty(),
"harness_platform_connector_prometheus": connector.ResourceConnectorPrometheus(),
"harness_platform_connector_rancher": connector.ResourceConnectorK8sRancher(),
"harness_platform_connector_rancher": cdng_connector_cloudProviders.ResourceConnectorK8sRancher(),
"harness_platform_connector_splunk": connector.ResourceConnectorSplunk(),
"harness_platform_connector_spot": connector.ResourceConnectorSpot(),
"harness_platform_connector_terraform_cloud": connector.ResourceConnectorTerraformCloud(),
"harness_platform_connector_spot": cdng_connector_cloudProviders.ResourceConnectorSpot(),
"harness_platform_connector_terraform_cloud": cdng_connector_cloudProviders.ResourceConnectorTerraformCloud(),
"harness_platform_connector_sumologic": connector.ResourceConnectorSumologic(),
"harness_platform_connector_pdc": connector.ResourceConnectorPdc(),
"harness_platform_connector_pdc": cdng_connector_cloudProviders.ResourceConnectorPdc(),
"harness_platform_environment": pl_environment.ResourceEnvironment(),
"harness_platform_db_schema": dbschema.ResourceDBSchema(),
"harness_platform_db_instance": dbinstance.ResourceDBInstance(),
Expand Down Expand Up @@ -407,8 +410,8 @@ func Provider(version string) func() *schema.Provider {
"harness_user_group_permissions": user.ResourceUserGroupPermissions(),
"harness_user": user.ResourceUser(),
"harness_yaml_config": yamlconfig.ResourceYamlConfig(),
"harness_platform_connector_azure_cloud_provider": connector.ResourceConnectorAzureCloudProvider(),
"harness_platform_connector_tas": connector.ResourceConnectorTas(),
"harness_platform_connector_azure_cloud_provider": cdng_connector_cloudProviders.ResourceConnectorAzureCloudProvider(),
"harness_platform_connector_tas": cdng_connector_cloudProviders.ResourceConnectorTas(),
"harness_platform_policy": policy.ResourcePolicy(),
"harness_platform_policyset": policyset.ResourcePolicyset(),
"harness_platform_manual_freeze": manual_freeze.ResourceManualFreeze(),
Expand Down
50 changes: 50 additions & 0 deletions internal/service/cd_nextgen/_PreRequisites/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# main.tf

terraform {
required_providers {
harness = {
source = "harness/harness"
}
}
}

resource "harness_platform_secret_text" "TEST_spot_account_id" {
identifier = "TEST_spot_account_id"
name = "TEST_spot_account_id"
description = "This is a test Spot secret text"
tags = ["foo:bar"]
secret_manager_identifier = "harnessSecretManager"
value_type = "Inline"
value = "my_secret_value"
}
resource "harness_platform_secret_text" "TEST_spot_api_token" {
identifier = "TEST_spot_api_token"
name = "TEST_spot_api_token"
description = "This is a test Spot secret text"
tags = ["foo:bar"]
secret_manager_identifier = "harnessSecretManager"
value_type = "Inline"
value = "my_secret_value"
}

resource "harness_platform_secret_text" "TEST_api_token_ref" {
identifier = "TEST_api_token_ref"
name = "TEST_api_token_ref"
description = "This is a test Spot secret text"
tags = ["foo:bar"]
secret_manager_identifier = "harnessSecretManager"
value_type = "Inline"
value = "my_secret_value"
}

resource "harness_platform_secret_text" "doNotDeleteHSM" {
identifier = "doNotDeleteHSM"
name = "doNotDeleteHSM"
description = "This is a test secret text"
tags = ["foo:bar"]
secret_manager_identifier = "harnessSecretManager"
value_type = "Inline"
value = "my_secret_value"
}

# Additional resources can be added as needed
Loading

0 comments on commit ab568a4

Please sign in to comment.