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.
Added support for import of harness_ssh_credential
- Loading branch information
1 parent
88f6b7a
commit 2bcedf4
Showing
4 changed files
with
45 additions
and
11 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,2 @@ | ||
# Import using the Harness ssh credential id | ||
terraform import harness_ssh_credential.example <credential_id> |
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,32 @@ | ||
resource "tls_private_key" "harness_deploy_key" { | ||
algorithm = "RSA" | ||
rsa_bits = 4096 | ||
} | ||
|
||
data "harness_secret_manager" "secret_manager" { | ||
default = true | ||
} | ||
|
||
resource "harness_encrypted_text" "my_secret" { | ||
name = "my_secret" | ||
value = tls_private_key.harness_deploy_key.private_key_pem | ||
secret_manager_id = data.harness_secret_manager.secret_manager.id | ||
} | ||
|
||
resource "harness_ssh_credential" "ssh_creds" { | ||
name = "ssh-test" | ||
|
||
ssh_authentication { | ||
port = 22 | ||
username = "git" | ||
inline_ssh { | ||
ssh_key_file_id = harness_encrypted_text.my_secret.id | ||
} | ||
} | ||
|
||
// This is a workaround until https://harness.atlassian.net/browse/PL-17967 is resolved | ||
// The graphql API currently doesn't return all the fields in the query. | ||
lifecycle { | ||
ignore_changes = ["ssh_authentication"] | ||
} | ||
} |
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