diff --git a/tools/pubsys/src/aws/ami/mod.rs b/tools/pubsys/src/aws/ami/mod.rs index 1340654b6cc..d7911734a91 100644 --- a/tools/pubsys/src/aws/ami/mod.rs +++ b/tools/pubsys/src/aws/ami/mod.rs @@ -71,9 +71,7 @@ pub(crate) async fn run(args: &Args, ami_args: &AmiArgs) -> Result<()> { let infra_config = InfraConfig::from_path(&args.infra_config_path).context(error::Config)?; trace!("Parsed infra config: {:?}", infra_config); - let aws = infra_config.aws.context(error::MissingConfig { - missing: "aws section", - })?; + let aws = infra_config.aws.unwrap_or_else(|| Default::default()); // If the user gave an override list of regions, use that, otherwise use what's in the config. let mut regions = if !ami_args.regions.is_empty() { diff --git a/tools/pubsys/src/config.rs b/tools/pubsys/src/config.rs index 962ea62922f..d4489a4362a 100644 --- a/tools/pubsys/src/config.rs +++ b/tools/pubsys/src/config.rs @@ -34,11 +34,13 @@ impl InfraConfig { } /// AWS-specific infrastructure configuration -#[derive(Debug, Deserialize)] +#[derive(Debug, Default, Deserialize)] pub(crate) struct AwsConfig { + #[serde(default)] pub(crate) regions: VecDeque, pub(crate) role: Option, pub(crate) profile: Option, + #[serde(default)] pub(crate) region: HashMap, }