pub mod cfn_provision;
pub mod defaults;
pub mod runtime;
pub mod service;
pub mod service_helpers;
pub mod state;
pub use runtime::Ec2Runtime;
pub use service::Ec2Service;
pub use state::{Ec2Snapshot, Ec2State, SharedEc2State, EC2_SNAPSHOT_SCHEMA_VERSION};
#[cfg(test)]
pub(crate) mod test_support {
use fakecloud_core::service::{AwsRequest, AwsResponse, AwsServiceError};
pub(crate) fn err_of(r: Result<AwsResponse, AwsServiceError>) -> AwsServiceError {
match r {
Ok(_) => panic!("expected an error, got Ok"),
Err(e) => e,
}
}
pub(crate) fn ec2_request(action: &str, query: &[(&str, &str)]) -> AwsRequest {
AwsRequest {
service: "ec2".into(),
action: action.into(),
region: "us-east-1".into(),
account_id: "000000000000".into(),
request_id: "rid".into(),
headers: http::HeaderMap::new(),
query_params: query
.iter()
.map(|(k, v)| (k.to_string(), v.to_string()))
.collect(),
body: bytes::Bytes::new(),
body_stream: parking_lot::Mutex::new(None),
path_segments: Vec::new(),
raw_path: "/".into(),
raw_query: String::new(),
method: http::Method::POST,
is_query_protocol: true,
access_key_id: None,
principal: None,
}
}
}