Skip to content

Commit 5648962

Browse files
committed
fix linter
1 parent 7580642 commit 5648962

File tree

5 files changed

+29
-14
lines changed

5 files changed

+29
-14
lines changed

.changelog/1196.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ Add support for sync resource in HCP Vault Secrets
33
```
44

55
```release-note:improvement
6-
Associate a sync with an HCP Vault Secrets App
6+
Allow users to assign one or more syncs with an HCP Vault Secrets App
77
```
Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1-
# the provider is derived from the integration name
2-
resource "hcp_vault_secrets_sync" "example_aws_sync" {
3-
name = "my-aws-1"
4-
integration_name = "my-integration-1"
1+
resource "hcp_vault_secrets_integration" "example_gitlab_integration" {
2+
name = "gitlab-integration"
3+
capabilities = ["SYNC"]
4+
provider_type = "gitlab"
5+
gitlab_access = {
6+
token = "myaccesstoken"
7+
}
8+
}
9+
10+
resource "hcp_vault_secrets_sync" "example_gitlab_project_sync" {
11+
name = "gitlab-proj-sync"
12+
integration_name = hcp_vault_secrets_integration.example_gitlab_integration.name
13+
gitlab_config = {
14+
scope = "PROJECT"
15+
project_id = "123456"
16+
}
517
}

internal/provider/vaultsecrets/resource_vault_secrets_app_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func TestAccVaultSecretsResourceApp(t *testing.T) {
7676
integration_name = hcp_vault_secrets_integration.acc_test.name
7777
gitlab_config = {
7878
scope = "GROUP"
79-
project_id = "987654321"
79+
group_id = "987654321"
8080
}
8181
}
8282
resource "hcp_vault_secrets_app" "acc_test_app" {

internal/provider/vaultsecrets/resource_vault_secrets_sync.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ package vaultsecrets
33
import (
44
"context"
55
"fmt"
6-
"github.com/hashicorp/terraform-plugin-framework/attr"
6+
77
"golang.org/x/exp/maps"
88

99
"github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-secrets/stable/2023-11-28/client/secret_service"
1010
secretmodels "github.com/hashicorp/hcp-sdk-go/clients/cloud-vault-secrets/stable/2023-11-28/models"
1111
"github.com/hashicorp/terraform-plugin-framework-validators/objectvalidator"
12+
"github.com/hashicorp/terraform-plugin-framework/attr"
1213
"github.com/hashicorp/terraform-plugin-framework/diag"
1314
"github.com/hashicorp/terraform-plugin-framework/path"
1415
"github.com/hashicorp/terraform-plugin-framework/resource"
@@ -177,12 +178,10 @@ func (r *resourceVaultSecretsSync) Schema(_ context.Context, _ resource.SchemaRe
177178
},
178179
"group_id": schema.StringAttribute{
179180
Description: "ID of the group, if the scope is GROUP",
180-
Sensitive: false,
181181
Optional: true,
182182
},
183183
"project_id": schema.StringAttribute{
184184
Description: "ID of the project, if the scope is PROJECT",
185-
Sensitive: false,
186185
Optional: true,
187186
},
188187
},

internal/provider/vaultsecrets/resource_vault_secrets_sync_test.go

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,23 @@ func TestAccVaultSecretsResourceSync(t *testing.T) {
1919
{
2020
Config: syncConfig(syncName, integrationName),
2121
Check: resource.ComposeTestCheckFunc(
22-
resource.TestCheckResourceAttrSet("hcp_vault_secrets_sync.acc_test_gitlab", "organization_id"),
23-
resource.TestCheckResourceAttr("hcp_vault_secrets_sync.acc_test_gitlab", "project_id", os.Getenv("HCP_PROJECT_ID")),
24-
resource.TestCheckResourceAttr("hcp_vault_secrets_sync.acc_test_gitlab", "name", syncName),
25-
resource.TestCheckResourceAttr("hcp_vault_secrets_sync.acc_test_gitlab", "integration_name", integrationName)),
22+
resource.TestCheckResourceAttrSet("hcp_vault_secrets_sync.acc_test_gitlab_group", "organization_id"),
23+
resource.TestCheckResourceAttr("hcp_vault_secrets_sync.acc_test_gitlab_group", "project_id", os.Getenv("HCP_PROJECT_ID")),
24+
resource.TestCheckResourceAttr("hcp_vault_secrets_sync.acc_test_gitlab_group", "name", syncName),
25+
resource.TestCheckResourceAttr("hcp_vault_secrets_sync.acc_test_gitlab_group", "integration_name", integrationName)),
2626
},
2727
},
2828
})
2929
}
3030

3131
func syncConfig(syncName, integrationName string) string {
3232
return fmt.Sprintf(`
33-
resource "hcp_vault_secrets_sync" "acc_test_gitlab" {
33+
resource "hcp_vault_secrets_sync" "acc_test_gitlab_group" {
3434
name = %q
3535
integration_name = %q
36+
gitlab_config = {
37+
scope = "GROUP"
38+
group_id = 123456
39+
}
3640
}`, syncName, integrationName)
3741
}

0 commit comments

Comments
 (0)