pub struct Email {
pub id: String,
pub domains: Vec<String>,
pub inbound: Option<EmailInbound>,
pub events: Option<EmailEvents>,
}Expand description
Email infrastructure for sending and receiving mail on customer-owned domains. On AWS this is backed by SES: a shared configuration set, optional inbound/event wiring, and one email identity (Easy DKIM) per seed domain.
§Infrastructure vs runtime data
This resource owns the email infrastructure and the capability to use it,
not the domain lifecycle. Deployment manages the configuration set, the
event topology, the inbound receipt topology, and any seed identities
listed in domains. Email identities created at runtime through the
email/manage-identities grant are application data: they are not tracked
by the deployment, are not removed when the stack is deleted, and their
lifecycle — including deletion — belongs to the application.
The operator (or the application, for runtime-created identities) owns DNS:
the per-domain DKIM CNAME records surfaced in EmailOutputs must be
created before SES verifies a domain and allows sending from it.
§Inbound mail (AWS)
When inbound is set, a SES receipt rule set is provisioned that writes
raw incoming mail into the linked Storage bucket. The receipt rule is a
catch-all (no recipient filter), so mail for identities verified at runtime
lands in the bucket without any infrastructure change.
Alien activates the provisioned receipt rule set as part of setup. Because
SES permits only one active receipt rule set per AWS account and region, an
AWS stack may contain only one email resource with inbound delivery, and
installing it makes its rule set the account’s active rule set. SES email
receiving is available only in a subset of AWS regions; deploying inbound
to an unsupported region fails during setup.
§Update semantics
domains is append-friendly: adding a domain provisions a new identity,
removing a domain deletes its identity (and its DKIM verification state).
The list may be empty. inbound and events may be added, removed, or
repointed; removing them tears down the corresponding receipt rule set /
event destination wiring.
Fields§
§id: StringIdentifier for the email resource. Must contain only alphanumeric characters, hyphens, and underscores ([A-Za-z0-9-_]). Maximum 64 characters.
domains: Vec<String>Seed mail domains provisioned at deploy time (one SES identity each).
Useful for day-0 bootstrap and products with a static domain set.
May be empty (the default): products that create and verify domains
dynamically should manage identities at runtime through the
email/manage-identities grant instead of listing them here.
inbound: Option<EmailInbound>Optional inbound-mail configuration: raw incoming mail (for any identity the account receives mail for — the receipt rule is a catch-all) is written to the linked Storage bucket.
events: Option<EmailEvents>Optional sending-event configuration: send / delivery / bounce / complaint / delivery-delay / reject events are delivered to the linked Queue.
Implementations§
Source§impl Email
impl Email
Sourcepub fn new(id: String) -> EmailBuilder
pub fn new(id: String) -> EmailBuilder
Create an instance of Email using the builder syntax
Source§impl Email
impl Email
Sourcepub const RESOURCE_TYPE: ResourceType
pub const RESOURCE_TYPE: ResourceType
The resource type identifier for Email.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Email
impl<'de> Deserialize<'de> for Email
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Email
Source§impl ResourceDefinition for Email
impl ResourceDefinition for Email
Source§fn get_resource_type(&self) -> ResourceType
fn get_resource_type(&self) -> ResourceType
Source§fn get_dependencies(&self) -> Vec<ResourceRef>
fn get_dependencies(&self) -> Vec<ResourceRef>
Source§fn validate_update(&self, new_config: &dyn ResourceDefinition) -> Result<()>
fn validate_update(&self, new_config: &dyn ResourceDefinition) -> Result<()>
Source§fn as_any_mut(&mut self) -> &mut dyn Any
fn as_any_mut(&mut self) -> &mut dyn Any
Source§fn box_clone(&self) -> Box<dyn ResourceDefinition>
fn box_clone(&self) -> Box<dyn ResourceDefinition>
Source§fn resource_eq(&self, other: &dyn ResourceDefinition) -> bool
fn resource_eq(&self, other: &dyn ResourceDefinition) -> bool
Source§fn to_json_value(&self) -> Result<Value>
fn to_json_value(&self) -> Result<Value>
impl StructuralPartialEq for Email
Auto Trait Implementations§
impl Freeze for Email
impl RefUnwindSafe for Email
impl Send for Email
impl Sync for Email
impl Unpin for Email
impl UnsafeUnpin for Email
impl UnwindSafe for Email
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.