Skip to content

Commit

Permalink
Update plumbing to use values from the ApiGateway struct
Browse files Browse the repository at this point in the history
  • Loading branch information
EricGhildyal committed Nov 25, 2024
1 parent 69d1c5c commit 9155a97
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/adapters/ingresses/apig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,18 +173,25 @@ async fn read_file(artifact_path: PathBuf) -> Result<Vec<u8>> {
impl Ingress for AwsApiGateway {
async fn deploy(&mut self) -> Result<()> {
// First, we need to deploy the new version of the lambda
let lambda_version = self.upload_lambda("releases").await?;
let lambda_version = self.upload_lambda(&self.lambda_name).await?;

// Next, we need to create a new deployment, pointing at our
// new lambda version with canary settings
self.create_apig_deployment("Releases", "prod", "releases", &lambda_version, 0.0)
.await?;
self.create_apig_deployment(
&self.gateway_name,
&self.stage_name,
&self.lambda_name,
&lambda_version,
0.0,
)
.await?;

Ok(())
}

async fn rollback_canary(&mut self) -> Result<()> {
self.delete_canary("Releases", "prod").await?;
self.delete_canary(&self.gateway_name, &self.stage_name)
.await?;

Ok(())
}
Expand Down

0 comments on commit 9155a97

Please sign in to comment.