Pulumi Resources#
Pulumi components, dynamic resources, and functions available.
authority - TLS/X509 CA & Certs, DNSSEC, OpenSSH#
Resources for managing TLS/X509 CAs, certificates, DNSSEC keys, and OpenSSH keys.
Components#
CACertFactoryCreates a Certificate Authority using either HashiCorp Vault or the Pulumi TLS providerCASignedCertCreates a certificate signed by a Certificate Authority (CA)SelfSignedCertCreates a self-signed certificatePKCS12BundleCreates a PKCS12 bundle from a certificate and private keyEncryptedPrivateKeyCreates an encrypted private key in PEM formatNSFactoryManages DNSSEC keys and anchorsTSIGKeyGenerates a TSIG (Transaction Signature) keySSHFactoryManages SSH keys for provisioning
Functions#
create_host_certCreates a host certificate with both client and server authentication enabledcreate_client_certCreates a client certificate with only client authentication enabledcreate_selfsigned_certCreates a self-signed certificatecreate_sub_caCreates a subordinate Certificate Authority (CA)
Configuration#
The authority.py module is configured through the Pulumi.<stack>.yaml file. The following configuration values are available:
ca_name,ca_org,ca_unit,ca_locality,ca_country,ca_max_path_length,ca_create_using_vaultca_validity_period_hours,cert_validity_period_hoursca_permitted_domains,ca_dns_namesca_provision_name,ca_provision_unit,ca_provision_dns_namesca_alt_provision_name,ca_alt_provision_unit,ca_alt_provision_dns_namesca_extra_cert_bundlens_extra_ksk_bundlessh_provision_name
Example#
from infra.authority import create_host_cert
# Create a TLS host certificate
tls = create_host_cert(hostname, hostname, dns_names)
tools - Serve HTTPS, SSH-put/get/exec, SaltCall, ImgTransfer#
This module provides various tools for use with Pulumi.
Components#
ServePreparePrepares to serve a one-time web resource by generating a dynamic configurationServeOnceServes a one-time, secure web resource and shuts down after the first requestLocalSaltCallExecutes a local SaltStack callRemoteSaltCallExecutes a SaltStack call on a remote host-
BuildFromSaltExecutes a local SaltStack call to build an image or OS -
c: SSHPut
- c: SSHDeploy
- c: SSHGet
- c: SSHExecute
Dynamic Resources#
WaitForHostReadyWaits for a remote host to be ready by checking for the existence of a specific file over SSHTimedResourceRegenerates its value after a specified timeout has passed
Functions#
serve_simpleServes a one-time web resource with a simple configurationssh_putCopies files from the local machine to a remote host over SSHssh_deployDeploys string data as files to a remote host over SSHssh_executeExecutes a command on a remote host over SSH-
ssh_getCopies files from a remote host to the local machine over SSH -
write_removableWrites an image to a removable storage device encrypted_local_exportExports and encrypts data to a local file usingage-
public_local_exportExports data to a local file without encryption -
log_warnLogs a multi-line string to the Pulumi console with line numbers salt_configGenerates a SaltStack minion configurationget_ip_from_ifnameRetrieves the first IPv4 address from a network interfaceget_default_host_ipRetrieves the IP address of the default network interfaceget_default_gateway_ipRetrieves the IP address of the default gatewaysha256sum_fileCalculates the SHA256 checksum of a fileyaml_loadsDeserializes a YAML string into a Pulumi output
Example#
ServePrepare and ServeOnce#
from infra.tools import ServePrepare, ServeOnce
# Prepare the server configuration
serve_config = ServePrepare(
shortname, serve_interface="virbr0" if stack_name.endswith("sim") else ""
)
# Serve the Ignition config
serve_data = ServeOnce(
shortname,
config=serve_config.config,
payload=host_config.result,
opts=pulumi.ResourceOptions(ignore_changes=["stdin"]),
)
os - CoreOS Config, Deployment, Operation, Update#
Resources for managing CoreOS systems.
Components#
ButaneTranspilerTranspiles Jinja2-templated Butane files into Ignition JSON and a SaltStack stateSystemConfigUpdateUpdates the configuration of a remote system using a transpiled SaltStack stateFcosImageDownloaderDownloads and decompresses a Fedora CoreOS imageLibvirtIgniteFcosCreates a Fedora CoreOS virtual machine with LibvirtTangFingerprintRetrieves a Tang server’s fingerprintRemoteDownloadIgnitionConfigCreates a minimal Ignition configuration that downloads the full configuration from a remote URL
Functions#
get_localeRetrieves and merges locale settings from default and Pulumi configurationsbuild_raspberry_extrasBuilds extra files for Raspberry Pi, such as bootloader firmwarebutane_clevis_to_json_clevisParses a Butane config and extracts Clevis SSS (Shamir’s Secret Sharing) configurations for LUKS-encrypted devices
Example#
Translate Butane and create a Libvirt Machine from config#
from infra.os import ButaneTranspiler, LibvirtIgniteFcos
# Translate Butane into Ignition and SaltStack state
host_config = ButaneTranspiler(
shortname, hostname, tls, butane_yaml, files_basedir, host_environment
)
# Create a Libvirt virtual machine
host_machine = LibvirtIgniteFcos(
shortname,
public_config.result,
volumes=identifiers["storage"],
memory=4096,
)