Manage EC2
New in version Beryllium.
This module provides an interface to the Elastic Compute Cloud (EC2) service from AWS.
The below code creates a key pair:
create-key-pair:
boto_ec2.key_present:
- name: mykeypair
- save_private: /root/
- region: eu-west-1
- keyid: GKTADJGHEIQSXMKKRBJ08H
- key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
import-key-pair:
boto_ec2.key_present:
- name: mykeypair
- upload_public: 'ssh-rsa AAAA'
- keyid: GKTADJGHEIQSXMKKRBJ08H
- key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
You can also use salt:// in order to define the public key.
import-key-pair:
boto_ec2.key_present:
- name: mykeypair
- upload_public: salt://mybase/public_key.pub
- keyid: GKTADJGHEIQSXMKKRBJ08H
- key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
The below code deletes a key pair:
delete-key-pair:
boto_ec2.key_absent:
- name: mykeypair
- region: eu-west-1
- keyid: GKTADJGHEIQSXMKKRBJ08H
- key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
salt.states.boto_ec2.
key_absent
(name, region=None, key=None, keyid=None, profile=None)¶Deletes a key pair
salt.states.boto_ec2.
key_present
(name, save_private=None, upload_public=None, region=None, key=None, keyid=None, profile=None)¶Ensure key pair is present.