Skip to content

Commit 0812f3b

Browse files
Fix issue IBM-Cloud#2388
1 parent cfc596d commit 0812f3b

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

ibm/data_source_ibm_is_ssh_key.go

+12
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ func dataSourceIBMISSSHKey() *schema.Resource {
3434
Description: "The ssh key Fingerprint",
3535
},
3636

37+
isKeyPublicKey: {
38+
Type: schema.TypeString,
39+
Computed: true,
40+
Description: "SSH Public key data",
41+
},
42+
3743
isKeyLength: {
3844
Type: schema.TypeInt,
3945
Computed: true,
@@ -126,6 +132,9 @@ func classicKeyGetByName(d *schema.ResourceData, meta interface{}, name string)
126132
if key.ResourceGroup != nil {
127133
d.Set(ResourceGroupName, *key.ResourceGroup.ID)
128134
}
135+
if key.PublicKey != nil {
136+
d.Set(isKeyPublicKey, *key.PublicKey)
137+
}
129138
return nil
130139
}
131140
}
@@ -159,6 +168,9 @@ func keyGetByName(d *schema.ResourceData, meta interface{}, name string) error {
159168
if key.ResourceGroup != nil {
160169
d.Set(ResourceGroupName, *key.ResourceGroup.ID)
161170
}
171+
if key.PublicKey != nil {
172+
d.Set(isKeyPublicKey, *key.PublicKey)
173+
}
162174
return nil
163175
}
164176
}

website/docs/d/is_ssh_key.html.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ The following attributes are exported:
3535
* `fingerprint` - The SHA256 fingerprint of the public key.
3636
* `length` - The length of this key.
3737
* `type` - The cryptosystem used by this key.
38+
* `public_key` - SSH Public key data.

0 commit comments

Comments
 (0)