Skip to main content

teleport_app_name

Function teleport_app_name 

Source
fn teleport_app_name(
    cloud_provider: CloudProvider,
    region: &str,
    environment_id: Uuid,
    ordinal: &str,
) -> Result<String, String>
Expand description

The Teleport app resource name: mz-{cloud_provider}-{region}-{base32(org_uuid)}-{ordinal}.

The mz- prefix lets this registration coexist with the app environment-controller registers under the un-prefixed name. Add the prefix only here, never in Materialize::environment_id, which other consumers (the --environment-id flag, KMS key aliases) rely on staying stable.

Returns an error when the result is not a valid DNS-1035 label, which Teleport requires. A long enough cloud provider and region can exceed the 63-character limit: generic plus a 23-character region leaves room for a single-digit ordinal and no more.