!emulator
The !emulator Atmos YAML function retrieves live connection information (endpoint, credentials,
kubeconfig) from a running emulator component, referenced by name and
resolved relative to the current stack.
Usage
# Retrieve a connection value from a running emulator component.
!emulator <component-ref> <key>
<component-ref> is the emulator component's name (resolved in the current stack). <key> is one of:
endpointorurl— the emulator's base URLhost— the emulator's hostport— the emulator's primary bound host portregion— the emulator's configured region (cloud emulators)project— the emulator's configured project (cloud emulators)kubeconfig— materializes a kubeconfig file for a Kubernetes-target emulator and returns its pathenv.<VAR>— a single SDK environment variable from the emulator's connection profile (for example,env.AWS_ACCESS_KEY_ID)
Examples
vars:
# Point a component at a running LocalStack-style emulator instead of real AWS.
aws_endpoint: !emulator aws-emulator endpoint
env:
# Pass emulator credentials through to Terraform as environment variables.
AWS_ACCESS_KEY_ID: !emulator aws-emulator env.AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: !emulator aws-emulator env.AWS_SECRET_ACCESS_KEY
# Point kubectl/helm at a running k3s emulator.
KUBECONFIG: !emulator k3s-emulator kubeconfig
info
The referenced emulator component must be running (atmos emulator up) before the function can resolve a value.
Related
atmos emulator up— start emulator componentsatmos emulator list— list running emulators