Skip to content

Commit

Permalink
Merge branch 'main' into PL-38818-allow-reading-of-aws-sm-with-name-a…
Browse files Browse the repository at this point in the history
…nd-identifier-both
  • Loading branch information
adiyaar24 committed May 16, 2023
2 parents 8543167 + 2a08351 commit 59b2e16
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 33 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# 0.20.0 (May 16,2023)

FEATURES:

* **New Resource:** `resource/harness_platform_apikey: Added ApiKey resource.` ([#532](https://github.com/harness/terraform-provider-harness/issues/532))

ENHANCEMENTS:

* resources/platform_role_assignments: Made resource_group_identifier, role_identifier and type under principal schema required.
resources/platform_secret_sshkey: Updated the Behaviour of referencing the secrets at account, project and org Level. Made Key Field Required in SSH credential of type keyReference ([#509](https://github.com/harness/terraform-provider-harness/issues/509))

# 0.19.2 (May 11,2023)

FEATURES:
Expand Down
12 changes: 6 additions & 6 deletions internal/service/platform/api_key/apiKey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestAccResourceApiKey(t *testing.T) {
apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5))
updatedName := apiKeyName + "updated"

resourceName := "harness_platform_apiKey.test"
resourceName := "harness_platform_apikey.test"

resource.UnitTest(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
Expand Down Expand Up @@ -57,7 +57,7 @@ func TestAccResourceApiKeyOrgLevel(t *testing.T) {
apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5))
updatedName := apiKeyName + "updated"

resourceName := "harness_platform_apiKey.test"
resourceName := "harness_platform_apikey.test"

resource.UnitTest(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
Expand Down Expand Up @@ -92,7 +92,7 @@ func TestAccResourceApiKeyProjectLevel(t *testing.T) {
apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5))
updatedName := apiKeyName + "updated"

resourceName := "harness_platform_apiKey.test"
resourceName := "harness_platform_apikey.test"

resource.UnitTest(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
Expand Down Expand Up @@ -141,7 +141,7 @@ func testAccGetResourceApiKey(resourceName string, state *terraform.State) (*nex

func testAccResourceApiKey(id string, name string, parentId string, accountId string) string {
return fmt.Sprintf(`
resource "harness_platform_apiKey" "test" {
resource "harness_platform_apikey" "test" {
identifier = "%[1]s"
name = "%[2]s"
description="Test Description"
Expand All @@ -160,7 +160,7 @@ func testOrgResourceApiKey(id string, name string, parentId string, accountId st
name = "%[2]s"
}
resource "harness_platform_apiKey" "test" {
resource "harness_platform_apikey" "test" {
identifier = "%[1]s"
name = "%[2]s"
description="Test Description"
Expand All @@ -187,7 +187,7 @@ func testProjectResourceApiKey(id string, name string, parentId string, accountI
color = "#472848"
}
resource "harness_platform_apiKey" "test" {
resource "harness_platform_apikey" "test" {
identifier = "%[1]s"
name = "%[2]s"
description="Test Description"
Expand Down
54 changes: 27 additions & 27 deletions internal/service/platform/api_key/data_source_apiKey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestAccDataSourceApiKey(t *testing.T) {

apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5))

resourceName := "data.harness_platform_apiKey.test"
resourceName := "data.harness_platform_apikey.test"

resource.UnitTest(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
Expand All @@ -41,7 +41,7 @@ func TestAccDataSourceApiKeyOrgLevel(t *testing.T) {

apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5))

resourceName := "data.harness_platform_apiKey.test"
resourceName := "data.harness_platform_apikey.test"

resource.UnitTest(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
Expand All @@ -66,7 +66,7 @@ func TestAccDataSourceApiKeyProjectLevel(t *testing.T) {

apiKeyName := fmt.Sprintf("%s_%s", t.Name(), utils.RandStringBytes(5))

resourceName := "data.harness_platform_apiKey.test"
resourceName := "data.harness_platform_apikey.test"

resource.UnitTest(t, resource.TestCase{
PreCheck: func() { acctest.TestAccPreCheck(t) },
Expand All @@ -87,7 +87,7 @@ func TestAccDataSourceApiKeyProjectLevel(t *testing.T) {

func testAccDataSourceApiKey(id string, name string, parentId string, accountId string) string {
return fmt.Sprintf(`
resource "harness_platform_apiKey" "test" {
resource "harness_platform_apikey" "test" {
identifier = "%[1]s"
name = "%[2]s"
description="Test Description"
Expand All @@ -97,12 +97,12 @@ func testAccDataSourceApiKey(id string, name string, parentId string, accountId
default_time_to_expire_token = 1000
}
data "harness_platform_apiKey" "test" {
identifier = harness_platform_apiKey.test.identifier
parent_id = harness_platform_apiKey.test.parent_id
apikey_type = harness_platform_apiKey.test.apikey_type
account_id = harness_platform_apiKey.test.account_id
name = harness_platform_apiKey.test.name
data "harness_platform_apikey" "test" {
identifier = harness_platform_apikey.test.identifier
parent_id = harness_platform_apikey.test.parent_id
apikey_type = harness_platform_apikey.test.apikey_type
account_id = harness_platform_apikey.test.account_id
name = harness_platform_apikey.test.name
}
`, id, name, parentId, accountId)
}
Expand All @@ -115,7 +115,7 @@ func testAccDataSourceApiKeyOrgLevel(id string, name string, parentId string, ac
name = "%[2]s"
}
resource "harness_platform_apiKey" "test" {
resource "harness_platform_apikey" "test" {
identifier = "%[1]s"
name = "%[2]s"
description="Test Description"
Expand All @@ -126,13 +126,13 @@ func testAccDataSourceApiKeyOrgLevel(id string, name string, parentId string, ac
default_time_to_expire_token = 1000
}
data "harness_platform_apiKey" "test" {
identifier = harness_platform_apiKey.test.identifier
parent_id = harness_platform_apiKey.test.parent_id
apikey_type = harness_platform_apiKey.test.apikey_type
account_id = harness_platform_apiKey.test.account_id
org_id = harness_platform_apiKey.test.org_id
name = harness_platform_apiKey.test.name
data "harness_platform_apikey" "test" {
identifier = harness_platform_apikey.test.identifier
parent_id = harness_platform_apikey.test.parent_id
apikey_type = harness_platform_apikey.test.apikey_type
account_id = harness_platform_apikey.test.account_id
org_id = harness_platform_apikey.test.org_id
name = harness_platform_apikey.test.name
}
`, id, name, parentId, accountId)
}
Expand All @@ -151,7 +151,7 @@ func testAccDataSourceApiKeyProjectLevel(id string, name string, parentId string
color = "#472848"
}
resource "harness_platform_apiKey" "test" {
resource "harness_platform_apikey" "test" {
identifier = "%[1]s"
name = "%[2]s"
description="Test Description"
Expand All @@ -163,14 +163,14 @@ func testAccDataSourceApiKeyProjectLevel(id string, name string, parentId string
default_time_to_expire_token = 1000
}
data "harness_platform_apiKey" "test" {
identifier = harness_platform_apiKey.test.identifier
parent_id = harness_platform_apiKey.test.parent_id
apikey_type = harness_platform_apiKey.test.apikey_type
account_id = harness_platform_apiKey.test.account_id
org_id = harness_platform_apiKey.test.org_id
project_id = harness_platform_apiKey.test.project_id
name = harness_platform_apiKey.test.name
data "harness_platform_apikey" "test" {
identifier = harness_platform_apikey.test.identifier
parent_id = harness_platform_apikey.test.parent_id
apikey_type = harness_platform_apikey.test.apikey_type
account_id = harness_platform_apikey.test.account_id
org_id = harness_platform_apikey.test.org_id
project_id = harness_platform_apikey.test.project_id
name = harness_platform_apikey.test.name
}
`, id, name, parentId, accountId)
}

0 comments on commit 59b2e16

Please sign in to comment.