(
config: &Deploy,
name: &str,
sdk_config: &SdkConfig,
binary_archive: &BinaryArchive,
progress: &Progress,
)
| 65 | } |
| 66 | |
| 67 | pub(crate) async fn deploy( |
| 68 | config: &Deploy, |
| 69 | name: &str, |
| 70 | sdk_config: &SdkConfig, |
| 71 | binary_archive: &BinaryArchive, |
| 72 | progress: &Progress, |
| 73 | ) -> Result<DeployOutput> { |
| 74 | let client = LambdaClient::new(sdk_config); |
| 75 | |
| 76 | let (function_arn, version) = |
| 77 | upsert_function(config, name, &client, sdk_config, binary_archive, progress).await?; |
| 78 | |
| 79 | let alias = config.deploy_alias(); |
| 80 | |
| 81 | if let Some(alias) = &alias { |
| 82 | progress.set_message("updating alias version"); |
| 83 | |
| 84 | upsert_alias(name, alias, &version, &client).await?; |
| 85 | } |
| 86 | |
| 87 | let function_url = if config.function_config.enable_function_url { |
| 88 | progress.set_message("configuring function url"); |
| 89 | |
| 90 | Some(upsert_function_url_config(name, &alias, &client).await?) |
| 91 | } else { |
| 92 | None |
| 93 | }; |
| 94 | |
| 95 | if config.function_config.disable_function_url { |
| 96 | progress.set_message("deleting function url configuration"); |
| 97 | |
| 98 | delete_function_url_config(name, &alias, &client).await?; |
| 99 | } |
| 100 | |
| 101 | if let Some(retention) = config.function_config.log_retention { |
| 102 | progress.set_message("setting log retention"); |
| 103 | set_log_retention(sdk_config, retention, name).await?; |
| 104 | } |
| 105 | |
| 106 | Ok(DeployOutput { |
| 107 | function_arn, |
| 108 | function_url, |
| 109 | version, |
| 110 | alias, |
| 111 | binary_modified_at: binary_archive.binary_modified_at.clone(), |
| 112 | }) |
| 113 | } |
| 114 | |
| 115 | #[allow(clippy::too_many_arguments)] |
| 116 | async fn upsert_function( |
no test coverage detected