pub enum ExternalAi {
Ambient(AmbientAiBinding),
ApiKey(ExternalAiBinding),
}Expand description
What an installer supplies for an AI resource with an external binding.
Two inputs, told apart by whether the JSON carries a service tag (other than external-ai):
{ "provider", "apiKey" }— BYO key (the original input; stored deployments and Helm values carry it, so it parses exactly as before).{ "service": "external-ai", "provider", "apiKey" }also parses, as it did before the cloud-identity form existed.{ "service": "bedrock", "region" }— the cloud’s own AI service, called with the workload’s ambient identity (for example an EKS pod’s IRSA role). No key, no Secret.
The cloud-identity form needs the pod to have its own AWS identity: on Kubernetes, an IRSA role
on the service account (or an EKS Pod Identity association) with bedrock:InvokeModel and
bedrock:InvokeModelWithResponseStream. Without one the gateway refuses to sign and never uses
the node’s role. The region must be a plain AWS region name such as us-east-1.
Access is not checked at install time (the setup credentials cannot speak for the pod’s role):
it is checked on the first call, and a model the role cannot use fails with
provider_access_unavailable.
Untagged, because the BYO-key input has no tag and must keep parsing unchanged. The two shapes
cannot overlap: the ambient one requires service, the key one requires provider and apiKey.
Deserialize is hand-written (see below) so a typo gets an error naming both accepted forms, and
so an ambient input carrying an unused key such as apiKey is refused instead of dropped.
Variants§
Ambient(AmbientAiBinding)
A managed cloud AI service reached with the workload’s own identity.
ApiKey(ExternalAiBinding)
A provider reached with a key the installer supplies.
Implementations§
Source§impl ExternalAi
impl ExternalAi
Sourcepub fn to_ai_binding(&self) -> AiBinding
pub fn to_ai_binding(&self) -> AiBinding
The binding the workload SDK parses from ALIEN_<NAME>_BINDING.
Trait Implementations§
Source§impl Clone for ExternalAi
impl Clone for ExternalAi
Source§impl Debug for ExternalAi
impl Debug for ExternalAi
Source§impl<'de> Deserialize<'de> for ExternalAi
impl<'de> Deserialize<'de> for ExternalAi
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
impl Eq for ExternalAi
Source§impl From<ExternalAiBinding> for ExternalAi
impl From<ExternalAiBinding> for ExternalAi
Source§fn from(binding: ExternalAiBinding) -> Self
fn from(binding: ExternalAiBinding) -> Self
Source§impl PartialEq for ExternalAi
impl PartialEq for ExternalAi
Source§impl Serialize for ExternalAi
impl Serialize for ExternalAi
impl StructuralPartialEq for ExternalAi
Auto Trait Implementations§
impl Forget for ExternalAi
impl Freeze for ExternalAi
impl Move for ExternalAi
impl RefUnwindSafe for ExternalAi
impl Send for ExternalAi
impl Sync for ExternalAi
impl Unpin for ExternalAi
impl UnsafeUnpin for ExternalAi
impl UnwindSafe for ExternalAi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.