Skip to main content

AwsManager

Struct AwsManager 

Source
pub struct AwsManager { /* private fields */ }

Implementations§

Source§

impl AwsManager

Source

pub async fn new(aws_region: &str) -> Result<Self>

Source

pub async fn create_lambda_execution_role(&self) -> Result<String>

Source

pub async fn create_lambda_execution_role_with_name( &self, role_name: &str, ) -> Result<String>

Source

pub async fn deploy_lambda_function( &self, zip_content: Vec<u8>, ) -> Result<String>

Source

pub async fn create_cloudwatch_alarm(&self, function_name: &str) -> Result<()>

Source

pub async fn create_bedrock_eventbridge_rule(&self) -> Result<String>

Source

pub async fn add_lambda_target_to_eventbridge(&self) -> Result<()>

Source

pub async fn test_lambda_function(&self, payload: &str) -> Result<String>

Source

pub async fn create_lambda_function_url(&self) -> Result<String>

Source

pub async fn setup_cloudtrail_for_bedrock(&self) -> Result<String>

Source

pub async fn add_eventbridge_lambda_permission(&self) -> Result<()>

Source

pub async fn create_sns_topic(&self) -> Result<String>

创建SNS主题用于Bedrock告警通知

Source

pub async fn create_bedrock_cloudwatch_alarms( &self, sns_topic_arn: &str, ) -> Result<()>

创建完整的Bedrock监控CloudWatch告警

Source

pub async fn configure_sns_lambda_trigger( &self, sns_topic_arn: &str, ) -> Result<()>

配置SNS到Lambda的触发器

Source

pub async fn deploy_complete_monitoring_stack( &self, zip_content: Vec<u8>, ) -> Result<()>

部署完整的监控基础设施

Source

pub async fn update_lambda_environment(&self) -> Result<()>

更新Lambda函数环境变量

Source

pub async fn update_iam_credentials_policy(&self) -> Result<()>

更新IAM角色权限以支持us-east-1

Source

pub async fn fix_ak_sk_auto_disable(&self) -> Result<()>

修复AK/SK自动关闭功能

Source

pub async fn delete_lambda_function(&self) -> Result<()>

仅删除Lambda函数

Source

pub async fn uninstall_complete_monitoring_stack(&self) -> Result<()>

卸载完整的监控基础设施

Source

pub async fn delete_all_bedrock_alarms(&self) -> Result<()>

Source

pub async fn delete_eventbridge_rule(&self) -> Result<()>

Source

pub async fn delete_sns_topic(&self) -> Result<()>

Source

pub async fn delete_iam_role(&self) -> Result<()>

Trait Implementations§

Source§

impl Debug for AwsManager

Source§

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

Formats the value using the given formatter. 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<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