Skip to main content

Ec2State

Struct Ec2State 

Source
pub struct Ec2State {
Show 101 fields pub account_id: String, pub region: String, pub tags: BTreeMap<String, Vec<Tag>>, pub vpcs: BTreeMap<String, Vpc>, pub dhcp_options: BTreeMap<String, DhcpOptions>, pub subnets: BTreeMap<String, Subnet>, pub subnet_cidr_reservations: BTreeMap<String, SubnetCidrReservation>, pub security_groups: BTreeMap<String, SecurityGroup>, pub route_tables: BTreeMap<String, RouteTable>, pub internet_gateways: BTreeMap<String, InternetGateway>, pub egress_only_igws: BTreeMap<String, InternetGateway>, pub nat_gateways: BTreeMap<String, NatGateway>, pub elastic_ips: BTreeMap<String, ElasticIp>, pub key_pairs: BTreeMap<String, KeyPair>, pub placement_groups: BTreeMap<String, PlacementGroup>, pub network_interfaces: BTreeMap<String, NetworkInterface>, pub eni_permissions: BTreeMap<String, NetworkInterfacePermission>, pub instances: BTreeMap<String, Instance>, pub volumes: BTreeMap<String, Volume>, pub ebs_encryption_default: bool, pub ebs_default_kms_key_id: Option<String>, pub snapshots: BTreeMap<String, Snapshot>, pub snapshot_block_public_access: String, pub images: BTreeMap<String, Image>, pub image_watermarks: BTreeMap<String, BTreeMap<String, String>>, pub image_block_public_access: String, pub allowed_images_settings: String, pub allowed_image_criteria: Vec<Vec<String>>, pub network_acls: BTreeMap<String, NetworkAcl>, pub vpc_peerings: BTreeMap<String, VpcPeering>, pub vpc_endpoints: BTreeMap<String, VpcEndpoint>, pub endpoint_services: BTreeMap<String, EndpointService>, pub connection_notifications: BTreeMap<String, ConnectionNotification>, pub flow_logs: BTreeMap<String, FlowLog>, pub launch_templates: BTreeMap<String, LaunchTemplate>, pub spot_requests: BTreeMap<String, SpotRequest>, pub spot_fleets: BTreeMap<String, SpotFleet>, pub fleets: BTreeMap<String, Fleet>, pub spot_datafeed: Option<(String, String)>, pub capacity_reservations: BTreeMap<String, CapacityReservation>, pub capacity_reservation_fleets: BTreeMap<String, String>, pub reserved_instances: BTreeMap<String, ReservedInstances>, pub reserved_instances_listings: BTreeMap<String, ReservedInstancesListing>, pub reserved_instances_modifications: BTreeMap<String, ReservedInstancesModification>, pub dedicated_hosts: BTreeMap<String, DedicatedHost>, pub transit_gateways: BTreeMap<String, TransitGateway>, pub tgw_attachments: BTreeMap<String, TgwAttachment>, pub tgw_route_tables: BTreeMap<String, TgwRouteTable>, pub tgw_routes: BTreeMap<String, Vec<TgwRoute>>, pub tgw_rt_associations: BTreeMap<String, Vec<String>>, pub tgw_rt_propagations: BTreeMap<String, Vec<String>>, pub tgw_prefix_list_refs: BTreeMap<String, Vec<String>>, pub tgw_peerings: BTreeMap<String, TgwPeering>, pub tgw_connects: BTreeMap<String, (String, String)>, pub tgw_connect_peers: BTreeMap<String, String>, pub tgw_policy_tables: BTreeMap<String, String>, pub tgw_policy_table_associations: BTreeMap<String, Vec<String>>, pub tgw_announcements: BTreeMap<String, (String, String)>, pub tgw_multicast_domains: BTreeMap<String, TgwMulticastDomain>, pub tgw_metering_policies: BTreeMap<String, TgwMeteringPolicy>, pub customer_gateways: BTreeMap<String, CustomerGateway>, pub vpn_gateways: BTreeMap<String, VpnGateway>, pub vpn_connections: BTreeMap<String, VpnConnection>, pub vpn_concentrators: BTreeMap<String, VpnConcentrator>, pub client_vpn_endpoints: BTreeMap<String, ClientVpnEndpoint>, pub ipams: BTreeMap<String, Ipam>, pub ipam_scopes: BTreeMap<String, IpamScope>, pub ipam_pools: BTreeMap<String, IpamPool>, pub ipam_pool_cidrs: BTreeMap<String, Vec<(String, String)>>, pub ipam_pool_allocations: BTreeMap<String, Vec<(String, String)>>, pub ipam_resource_discoveries: BTreeMap<String, IpamResourceDiscovery>, pub ipam_rd_associations: BTreeMap<String, (String, String)>, pub ipam_byoasns: BTreeMap<String, String>, pub ipam_ext_tokens: BTreeMap<String, String>, pub ipam_policies: BTreeMap<String, IpamPolicy>, pub ipam_pl_resolvers: BTreeMap<String, IpamPrefixListResolver>, pub ipam_pl_resolver_targets: BTreeMap<String, IpamPrefixListResolverTarget>, pub ipam_policy_alloc_rules: BTreeMap<String, Vec<(String, String)>>, pub ipam_enabled_policy: Option<String>, pub va_instances: BTreeMap<String, VerifiedAccessInstance>, pub va_trust_providers: BTreeMap<String, VerifiedAccessTrustProvider>, pub va_groups: BTreeMap<String, VerifiedAccessGroup>, pub va_endpoints: BTreeMap<String, VerifiedAccessEndpoint>, pub va_group_policies: BTreeMap<String, String>, pub va_endpoint_policies: BTreeMap<String, String>, pub ni_paths: BTreeMap<String, NetworkInsightsPath>, pub ni_analyses: BTreeMap<String, NetworkInsightsAnalysis>, pub ni_access_scopes: BTreeMap<String, NetworkInsightsAccessScope>, pub ni_scope_analyses: BTreeMap<String, NetworkInsightsAccessScopeAnalysis>, pub carrier_gateways: BTreeMap<String, CarrierGateway>, pub coip_pools: BTreeMap<String, CoipPool>, pub coip_pool_cidrs: BTreeMap<String, Vec<String>>, pub lg_route_tables: BTreeMap<String, LocalGatewayRouteTable>, pub lg_routes: BTreeMap<String, Vec<String>>, pub lg_rt_vpc_assocs: BTreeMap<String, LocalGatewayRouteTableVpcAssoc>, pub lg_virtual_interfaces: BTreeMap<String, LocalGatewayVif>, pub lg_vif_groups: BTreeMap<String, LocalGatewayVifGroup>, pub lg_rt_vifg_assocs: BTreeMap<String, LocalGatewayRouteTableVifgAssoc>, pub instance_connect_endpoints: BTreeMap<String, InstanceConnectEndpoint>, pub fast_launch_images: HashSet<String>, pub serial_console_access: bool,
}
Expand description

Per-account, per-region EC2 state. Resource families are added to this struct as their batches land.

Fields§

§account_id: String§region: String§tags: BTreeMap<String, Vec<Tag>>

resource-id -> tags. Shared by every Describe* tag: filter.

§vpcs: BTreeMap<String, Vpc>§dhcp_options: BTreeMap<String, DhcpOptions>§subnets: BTreeMap<String, Subnet>§subnet_cidr_reservations: BTreeMap<String, SubnetCidrReservation>§security_groups: BTreeMap<String, SecurityGroup>§route_tables: BTreeMap<String, RouteTable>§internet_gateways: BTreeMap<String, InternetGateway>§egress_only_igws: BTreeMap<String, InternetGateway>§nat_gateways: BTreeMap<String, NatGateway>§elastic_ips: BTreeMap<String, ElasticIp>

keyed by allocation id.

§key_pairs: BTreeMap<String, KeyPair>

keyed by key name.

§placement_groups: BTreeMap<String, PlacementGroup>

keyed by group name.

§network_interfaces: BTreeMap<String, NetworkInterface>§eni_permissions: BTreeMap<String, NetworkInterfacePermission>

keyed by permission id.

§instances: BTreeMap<String, Instance>§volumes: BTreeMap<String, Volume>§ebs_encryption_default: bool

Account-level EBS default encryption toggle.

§ebs_default_kms_key_id: Option<String>

Account-level EBS default KMS key (None = alias/aws/ebs).

§snapshots: BTreeMap<String, Snapshot>§snapshot_block_public_access: String

Account-level snapshot block-public-access state.

§images: BTreeMap<String, Image>§image_watermarks: BTreeMap<String, BTreeMap<String, String>>

Watermarks attached to AMIs: image_id -> watermark_key -> watermark_name.

§image_block_public_access: String

Account-level image block-public-access state.

§allowed_images_settings: String

Account-level allowed-images settings state.

§allowed_image_criteria: Vec<Vec<String>>

Allowed-images imageCriterionSet: each criterion is its list of ImageProviders, persisted by ReplaceImageCriteriaInAllowedImagesSettings and reported by GetAllowedImagesSettings.

§network_acls: BTreeMap<String, NetworkAcl>§vpc_peerings: BTreeMap<String, VpcPeering>§vpc_endpoints: BTreeMap<String, VpcEndpoint>§endpoint_services: BTreeMap<String, EndpointService>§connection_notifications: BTreeMap<String, ConnectionNotification>§flow_logs: BTreeMap<String, FlowLog>§launch_templates: BTreeMap<String, LaunchTemplate>§spot_requests: BTreeMap<String, SpotRequest>§spot_fleets: BTreeMap<String, SpotFleet>§fleets: BTreeMap<String, Fleet>§spot_datafeed: Option<(String, String)>

Account-level spot datafeed subscription (bucket, prefix).

§capacity_reservations: BTreeMap<String, CapacityReservation>§capacity_reservation_fleets: BTreeMap<String, String>

Capacity reservation fleet ids (metadata-only).

§reserved_instances: BTreeMap<String, ReservedInstances>§reserved_instances_listings: BTreeMap<String, ReservedInstancesListing>§reserved_instances_modifications: BTreeMap<String, ReservedInstancesModification>§dedicated_hosts: BTreeMap<String, DedicatedHost>§transit_gateways: BTreeMap<String, TransitGateway>§tgw_attachments: BTreeMap<String, TgwAttachment>§tgw_route_tables: BTreeMap<String, TgwRouteTable>§tgw_routes: BTreeMap<String, Vec<TgwRoute>>

route-table-id -> static routes.

§tgw_rt_associations: BTreeMap<String, Vec<String>>

route-table-id -> associated attachment ids.

§tgw_rt_propagations: BTreeMap<String, Vec<String>>

route-table-id -> propagated attachment ids.

§tgw_prefix_list_refs: BTreeMap<String, Vec<String>>

route-table-id -> prefix-list ids referenced.

§tgw_peerings: BTreeMap<String, TgwPeering>§tgw_connects: BTreeMap<String, (String, String)>

connect-attachment-id -> (transport attachment id, tgw id).

§tgw_connect_peers: BTreeMap<String, String>

connect-peer-id -> attachment id.

§tgw_policy_tables: BTreeMap<String, String>

policy-table-id -> tgw id.

§tgw_policy_table_associations: BTreeMap<String, Vec<String>>

policy-table-id -> associated attachment ids.

§tgw_announcements: BTreeMap<String, (String, String)>

announcement-id -> (route-table id, peering-attachment id).

§tgw_multicast_domains: BTreeMap<String, TgwMulticastDomain>§tgw_metering_policies: BTreeMap<String, TgwMeteringPolicy>§customer_gateways: BTreeMap<String, CustomerGateway>§vpn_gateways: BTreeMap<String, VpnGateway>§vpn_connections: BTreeMap<String, VpnConnection>§vpn_concentrators: BTreeMap<String, VpnConcentrator>§client_vpn_endpoints: BTreeMap<String, ClientVpnEndpoint>§ipams: BTreeMap<String, Ipam>§ipam_scopes: BTreeMap<String, IpamScope>§ipam_pools: BTreeMap<String, IpamPool>§ipam_pool_cidrs: BTreeMap<String, Vec<(String, String)>>

pool-id -> provisioned (cidr, cidr-id).

§ipam_pool_allocations: BTreeMap<String, Vec<(String, String)>>

pool-id -> allocations (cidr, allocation-id).

§ipam_resource_discoveries: BTreeMap<String, IpamResourceDiscovery>§ipam_rd_associations: BTreeMap<String, (String, String)>

association-id -> (discovery-id, ipam-id).

§ipam_byoasns: BTreeMap<String, String>

asn -> associated cidr.

§ipam_ext_tokens: BTreeMap<String, String>

external-token-id -> ipam-id.

§ipam_policies: BTreeMap<String, IpamPolicy>§ipam_pl_resolvers: BTreeMap<String, IpamPrefixListResolver>§ipam_pl_resolver_targets: BTreeMap<String, IpamPrefixListResolverTarget>§ipam_policy_alloc_rules: BTreeMap<String, Vec<(String, String)>>

policy-id -> (locale, resource-type) allocation-rule documents.

§ipam_enabled_policy: Option<String>

The single enabled IPAM policy id, if any.

§va_instances: BTreeMap<String, VerifiedAccessInstance>§va_trust_providers: BTreeMap<String, VerifiedAccessTrustProvider>§va_groups: BTreeMap<String, VerifiedAccessGroup>§va_endpoints: BTreeMap<String, VerifiedAccessEndpoint>§va_group_policies: BTreeMap<String, String>

group-id -> policy document.

§va_endpoint_policies: BTreeMap<String, String>

endpoint-id -> policy document.

§ni_paths: BTreeMap<String, NetworkInsightsPath>§ni_analyses: BTreeMap<String, NetworkInsightsAnalysis>§ni_access_scopes: BTreeMap<String, NetworkInsightsAccessScope>§ni_scope_analyses: BTreeMap<String, NetworkInsightsAccessScopeAnalysis>§carrier_gateways: BTreeMap<String, CarrierGateway>§coip_pools: BTreeMap<String, CoipPool>§coip_pool_cidrs: BTreeMap<String, Vec<String>>

coip-pool-id -> CIDRs.

§lg_route_tables: BTreeMap<String, LocalGatewayRouteTable>§lg_routes: BTreeMap<String, Vec<String>>

route-table-id -> destination CIDRs.

§lg_rt_vpc_assocs: BTreeMap<String, LocalGatewayRouteTableVpcAssoc>§lg_virtual_interfaces: BTreeMap<String, LocalGatewayVif>§lg_vif_groups: BTreeMap<String, LocalGatewayVifGroup>§lg_rt_vifg_assocs: BTreeMap<String, LocalGatewayRouteTableVifgAssoc>§instance_connect_endpoints: BTreeMap<String, InstanceConnectEndpoint>§fast_launch_images: HashSet<String>

Image ids with fast-launch enabled.

§serial_console_access: bool

Implementations§

Source§

impl Ec2State

Source

pub fn new(account_id: &str, region: &str) -> Self

Source

pub fn ensure_public_images_seeded(&mut self)

Idempotently (re)seed the public AMI catalogue into this account. Used on snapshot restore so accounts persisted by a binary that predated the catalogue (#1964) still get it after an upgrade+restart — without it, aws_ami { owners=["amazon"] } returns empty for legacy accounts. Seeds have deterministic ids, so re-seeding an already-seeded account is a no-op.

Source

pub fn upsert_tags(&mut self, resource_id: &str, new_tags: &[Tag])

Replace the tag set for resource_id with tags merged over any existing tags (CreateTags is upsert-by-key, matching AWS).

Source

pub fn remove_tags( &mut self, resource_id: &str, to_remove: &[(String, Option<String>)], )

Remove tags for resource_id. When a tag’s value is None, the key is removed regardless of value; when Some, only a key+value match is removed (AWS DeleteTags semantics).

Source

pub fn tags_for(&self, resource_id: &str) -> &[Tag]

Tags for resource_id, or an empty slice when none.

Trait Implementations§

Source§

impl AccountState for Ec2State

Source§

fn new_for_account(account_id: &str, region: &str, _endpoint: &str) -> Self

Create a fresh, empty state for the given account.
Source§

fn inherit_from(&mut self, _sibling: &Self)

Called after a new account state is created via MultiAccountState::get_or_create, with a reference to an existing sibling state. Services can override this to propagate shared resources (e.g. body caches) to the new state.
Source§

impl Clone for Ec2State

Source§

fn clone(&self) -> Ec2State

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Ec2State

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Ec2State

Source§

fn default() -> Ec2State

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Ec2State

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Ec2State

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more