pulumi: Manage HostVDS instances
HostVDS provides public access to their OpenStack API, which we can use to manage cloud instances. This particular instance will be used to run the remote blackbox exporter/vmagent to monitor website availability.
This commit is contained in:
33
pulumi/dch/vps.py
Normal file
33
pulumi/dch/vps.py
Normal file
@@ -0,0 +1,33 @@
|
||||
import pulumi_openstack as os
|
||||
|
||||
key_pair = os.compute.Keypair(
|
||||
'default',
|
||||
name='dustin--rosalina',
|
||||
public_key='ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJsL5fSylmiJmBtW0DH/viAAmtU2E/2M17GPvysiyRs+',
|
||||
)
|
||||
|
||||
flavor = os.compute.get_flavor(
|
||||
vcpus=1,
|
||||
ram=1024,
|
||||
)
|
||||
|
||||
image = os.images.get_image(
|
||||
name='AlmaLinux-9-amd64',
|
||||
)
|
||||
|
||||
instance = os.compute.Instance(
|
||||
'vps',
|
||||
flavor_id=flavor.id,
|
||||
image_id=image.id,
|
||||
key_pair=key_pair.id,
|
||||
networks=[
|
||||
{'name': 'Internet-01'},
|
||||
],
|
||||
metadata={
|
||||
'os_distro': 'alma', # Sets the icon in the HostVDS Control Panel
|
||||
'groups': 'remote-blackbox',
|
||||
},
|
||||
security_groups=[
|
||||
'allow_all',
|
||||
],
|
||||
)
|
||||
Reference in New Issue
Block a user