Skip to content

Commit a7af8da

Browse files
committed
set AWS API region when creating invalidations
1 parent 7fc074b commit a7af8da

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/cdn.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::Config;
22
use anyhow::{Context, Error, Result};
33
use aws_sdk_cloudfront::{
44
model::{InvalidationBatch, Paths},
5-
Client, RetryConfig,
5+
Client, Region, RetryConfig,
66
};
77
use chrono::{DateTime, Utc};
88
use serde::Serialize;
@@ -35,7 +35,8 @@ impl CdnBackend {
3535
CdnKind::CloudFront => {
3636
let shared_config = runtime.block_on(aws_config::load_from_env());
3737
let config_builder = aws_sdk_cloudfront::config::Builder::from(&shared_config)
38-
.retry_config(RetryConfig::standard().with_max_attempts(3));
38+
.retry_config(RetryConfig::standard().with_max_attempts(3))
39+
.region(Region::new(config.s3_region.clone()));
3940

4041
Self::CloudFront {
4142
runtime: runtime.clone(),

0 commit comments

Comments
 (0)