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:
3
pulumi/.gitignore
vendored
Normal file
3
pulumi/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*.egg-info/
|
||||
__pycache__/
|
||||
*.py[co]
|
||||
1
pulumi/.pulumi/meta.yaml
Normal file
1
pulumi/.pulumi/meta.yaml
Normal file
@@ -0,0 +1 @@
|
||||
version: 1
|
||||
1
pulumi/.pulumi/meta.yaml.attrs
Normal file
1
pulumi/.pulumi/meta.yaml.attrs
Normal file
@@ -0,0 +1 @@
|
||||
{"user.cache_control":"","user.content_disposition":"","user.content_encoding":"","user.content_language":"","user.content_type":"text/plain; charset=utf-8","user.metadata":null,"md5":"EaRWdV65+nlqCnYlI4a4Wg=="}
|
||||
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',
|
||||
],
|
||||
)
|
||||
1
pulumi/main.py
Normal file
1
pulumi/main.py
Normal file
@@ -0,0 +1 @@
|
||||
import dch.vps
|
||||
Reference in New Issue
Block a user