Skip to content

Commit

Permalink
Fix issue IBM-Cloud#2388
Browse files Browse the repository at this point in the history
  • Loading branch information
VaishnaviGopal committed Mar 24, 2021
1 parent cfc596d commit 0812f3b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ibm/data_source_ibm_is_ssh_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ func dataSourceIBMISSSHKey() *schema.Resource {
Description: "The ssh key Fingerprint",
},

isKeyPublicKey: {
Type: schema.TypeString,
Computed: true,
Description: "SSH Public key data",
},

isKeyLength: {
Type: schema.TypeInt,
Computed: true,
Expand Down Expand Up @@ -126,6 +132,9 @@ func classicKeyGetByName(d *schema.ResourceData, meta interface{}, name string)
if key.ResourceGroup != nil {
d.Set(ResourceGroupName, *key.ResourceGroup.ID)
}
if key.PublicKey != nil {
d.Set(isKeyPublicKey, *key.PublicKey)
}
return nil
}
}
Expand Down Expand Up @@ -159,6 +168,9 @@ func keyGetByName(d *schema.ResourceData, meta interface{}, name string) error {
if key.ResourceGroup != nil {
d.Set(ResourceGroupName, *key.ResourceGroup.ID)
}
if key.PublicKey != nil {
d.Set(isKeyPublicKey, *key.PublicKey)
}
return nil
}
}
Expand Down
1 change: 1 addition & 0 deletions website/docs/d/is_ssh_key.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ The following attributes are exported:
* `fingerprint` - The SHA256 fingerprint of the public key.
* `length` - The length of this key.
* `type` - The cryptosystem used by this key.
* `public_key` - SSH Public key data.

0 comments on commit 0812f3b

Please sign in to comment.