Skip to content

Commit cbc4dda

Browse files
author
Sander van Harmelen
committed
Merge pull request hashicorp#5351 from svanharmelen/f-cloudstack
provider/cloudstack: small doc update
2 parents 7cbc9e3 + 5525772 commit cbc4dda

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

builtin/providers/cloudstack/resource_cloudstack_ssh_keypair.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,23 @@ func resourceCloudStackSSHKeyPairCreate(d *schema.ResourceData, meta interface{}
6262
}
6363

6464
p := cs.SSH.NewRegisterSSHKeyPairParams(name, string(key))
65+
6566
if err := setProjectid(p, cs, d); err != nil {
6667
return err
6768
}
69+
6870
_, err = cs.SSH.RegisterSSHKeyPair(p)
6971
if err != nil {
7072
return err
7173
}
7274
} else {
7375
// No key supplied, must create one and return the private key
7476
p := cs.SSH.NewCreateSSHKeyPairParams(name)
77+
7578
if err := setProjectid(p, cs, d); err != nil {
7679
return err
7780
}
81+
7882
r, err := cs.SSH.CreateSSHKeyPair(p)
7983
if err != nil {
8084
return err
@@ -95,6 +99,7 @@ func resourceCloudStackSSHKeyPairRead(d *schema.ResourceData, meta interface{})
9599

96100
p := cs.SSH.NewListSSHKeyPairsParams()
97101
p.SetName(d.Id())
102+
98103
if err := setProjectid(p, cs, d); err != nil {
99104
return err
100105
}
@@ -121,6 +126,7 @@ func resourceCloudStackSSHKeyPairDelete(d *schema.ResourceData, meta interface{}
121126

122127
// Create a new parameter struct
123128
p := cs.SSH.NewDeleteSSHKeyPairParams(d.Id())
129+
124130
if err := setProjectid(p, cs, d); err != nil {
125131
return err
126132
}

builtin/providers/cloudstack/resources.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,5 +196,6 @@ func setProjectid(p projectidSetter, cs *cloudstack.CloudStackClient, d *schema.
196196
}
197197
p.SetProjectid(projectid)
198198
}
199+
199200
return nil
200201
}

website/source/docs/providers/cloudstack/r/ssh_keypair.html.markdown

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ The following arguments are supported:
2828
within a CloudStack account. Changing this forces a new resource to be
2929
created.
3030

31-
* `public_key` - (Optional) The public key in OpenSSH
32-
`authorized_keys` format. If this is omitted, CloudStack will
33-
generate a new key pair. Changing this forces a new resource to be
34-
created.
31+
* `public_key` - (Optional) The public key to register with CloudStack. If
32+
this is omitted, CloudStack will generate a new key pair. The key can
33+
be loaded from a file on disk using the [`file()` interpolation
34+
function](/docs/configuration/interpolation.html#file_path_). Changing
35+
this forces a new resource to be created.
3536

3637
* `project` - (Optional) The name or ID of the project to register this
3738
key to. Changing this forces a new resource to be created.

0 commit comments

Comments
 (0)