mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-07 22:53:08 -06:00
Merge pull request #10987 from zendesk/fix_10983
aws_key_pair: Ensure key_name attribute is set
This commit is contained in:
commit
3b4866042b
@ -75,8 +75,10 @@ func resourceAwsKeyPairCreate(d *schema.ResourceData, meta interface{}) error {
|
||||
keyName = v.(string)
|
||||
} else if v, ok := d.GetOk("key_name_prefix"); ok {
|
||||
keyName = resource.PrefixedUniqueId(v.(string))
|
||||
d.Set("key_name", keyName)
|
||||
} else {
|
||||
keyName = resource.UniqueId()
|
||||
d.Set("key_name", keyName)
|
||||
}
|
||||
|
||||
publicKey := d.Get("public_key").(string)
|
||||
|
Loading…
Reference in New Issue
Block a user