Skip to content

Commit 614aade

Browse files
committed
Adjust to PR feedback
1 parent 7aa1591 commit 614aade

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Vault Secrets Integration can be imported by specifying the name of the integration
2-
terraform import hcp_vault_secrets_sync.example gitlab-proj-sync
2+
terraform import hcp_vault_secrets_sync.example_gitlab_project_sync gitlab-proj-sync

internal/provider/vaultsecrets/resource_vault_secrets_sync_test.go

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ import (
1212
func TestAccVaultSecretsResourceSync(t *testing.T) {
1313
syncName := generateRandomSlug()
1414
integrationName := generateRandomSlug()
15+
gitLabToken := checkRequiredEnvVarOrFail(t, "GITLAB_ACCESS_TOKEN")
1516

1617
resource.Test(t, resource.TestCase{
1718
ProtoV6ProviderFactories: acctest.ProtoV6ProviderFactories,
1819
Steps: []resource.TestStep{
1920
{
20-
Config: syncConfig(syncName, integrationName),
21+
Config: syncConfig(integrationName, syncName, gitLabToken),
2122
Check: resource.ComposeTestCheckFunc(
2223
resource.TestCheckResourceAttrSet("hcp_vault_secrets_sync.acc_test_gitlab_group", "organization_id"),
2324
resource.TestCheckResourceAttr("hcp_vault_secrets_sync.acc_test_gitlab_group", "project_id", os.Getenv("HCP_PROJECT_ID")),
@@ -28,14 +29,23 @@ func TestAccVaultSecretsResourceSync(t *testing.T) {
2829
})
2930
}
3031

31-
func syncConfig(syncName, integrationName string) string {
32+
func syncConfig(integrationName, syncName, accessToken string) string {
3233
return fmt.Sprintf(`
33-
resource "hcp_vault_secrets_sync" "acc_test_gitlab_group" {
34+
resource "hcp_vault_secrets_integration" "acc_test" {
35+
name = %q
36+
capabilities = ["SYNC"]
37+
provider_type = "gitlab"
38+
gitlab_access = {
39+
token = %q
40+
}
41+
}
42+
43+
resource "hcp_vault_secrets_sync" "acc_test_gitlab_group" {
3444
name = %q
3545
integration_name = %q
3646
gitlab_config = {
3747
scope = "GROUP"
3848
group_id = 123456
3949
}
40-
}`, syncName, integrationName)
50+
}`, integrationName, accessToken, syncName, integrationName)
4151
}

0 commit comments

Comments
 (0)