1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! AWS SSM client wrapper
use aws_sdk_ssm::Client;
use std::sync::Arc;
/// Wrapper around AWS SSM client with additional utilities
#[allow(dead_code)] // Reserved for future direct SSM API integration
pub struct SsmClient {
/// Internal AWS SDK client
client: Arc<Client>,
}
#[allow(dead_code)] // Reserved for future direct SSM API integration
impl SsmClient {
/// Create a new SSM client from AWS config
pub fn new(config: &aws_config::SdkConfig) -> Self {
Self {
client: Arc::new(Client::new(config)),
}
}
/// Create from default AWS config
pub async fn from_env() -> Self {
let config = aws_config::load_from_env().await;
Self::new(&config)
}
/// Get reference to the underlying AWS SDK client
pub fn inner(&self) -> &Client {
&self.client
}
/// Get Arc clone of the client (for sharing across threads)
pub fn clone_client(&self) -> Arc<Client> {
Arc::clone(&self.client)
}
}
impl From<Client> for SsmClient {
fn from(client: Client) -> Self {
Self {
client: Arc::new(client),
}
}
}
impl From<Arc<Client>> for SsmClient {
fn from(client: Arc<Client>) -> Self {
Self { client }
}
}
#[cfg(test)]
mod tests {
// Note: These tests would require AWS credentials or mocking
}