Skip to content

Use the AWS account's friendly name (not just base36 account ID) in DNS and elsewhere #121

Closed

Description

@scttfrdmn

Summary

Use an AWS account's friendly name (when it has one) instead of — or as an alias for — the base36-encoded account ID we currently embed in DNS and elsewhere.

Today, an instance's FQDN is {name}.{base36}.spore.host, where {base36} is intToBase36(accountID) (pkg/provider/ec2.go). That's stable but opaque — e.g. my-job.5k0zfnmq.spore.host. If the account has a human name like hpc-burst-prod, my-job.hpc-burst-prod.spore.host is far more legible and is what users actually think in.

The account name source

AWS exposes a settable account name via the Account API:

aws account put-account-name --account-id 123456789012 --account-name "hpc-burst-prod"
aws account get-account-information --account-id 123456789012   # reads it back

(SDK: aws-sdk-go-v2/service/account — PutAccountName / GetAccountInformation. For the calling account, --account-id is optional; for a member account it requires org-management or delegated-admin creds.)

Proposed behavior

  • On launch, resolve the account's friendly name via account.GetAccountInformation. If set and DNS-label-safe, use a slugified form as the DNS segment: {name}.{account-name-slug}.spore.host.
  • Fall back to the existing base36 segment when there's no account name, the name isn't resolvable (permissions), or it doesn't slugify to a valid DNS label.
  • Treat the account name as an alias, not a replacement: the base36 record should keep working so existing FQDNs don't break (register both, or CNAME). Decide whether base36 or name is canonical.
  • Persist the chosen segment in a tag (today: spawn:account-base36) so the in-instance daemon and the DNS updater agree without re-querying. Add e.g. spawn:account-name / spawn:account-segment.

Scope / where it touches

  • spawn (pkg/provider/ec2.go): resolve the name, slugify, choose the DNS segment, write the tag. New IAM permission: account:GetAccountInformation (and account:PutAccountName only if we ever set it — probably out of scope; we only read).
  • umbrella spore-host (DNS updater + spore-bot display, lambda/): the FQDN is assembled from the account-base36 tag in a couple of places — they'd need to honor the new segment tag and the Route53 zone layout would need name-based records. Companion issue to follow on that repo.

Open questions

  • Slugification rules + collision handling (two accounts could pick the same name across orgs — but within one org/zone, names are unique enough; confirm).
  • Is the name canonical or just an alias? (Recommend: alias, base36 stays canonical, to avoid breaking existing DNS.)
  • Permissions: GetAccountInformation on a member account needs management/delegated-admin creds — for a single flat account it's self-readable. Degrade gracefully when not permitted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions