Skip to content

Commit

Permalink
chore: Fix OAI (#14)
Browse files Browse the repository at this point in the history
* Changes to fix OAI

* Missed a bit
  • Loading branch information
scottgerring authored Dec 12, 2023
1 parent c47e0ed commit 724c93c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/cfn_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,12 @@ Resources:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
OwnershipControls:
Rules:
- ObjectOwnership: BucketOwnerPreferred
DeletionPolicy: Delete


#
# The DNS record pointing from our zone at the CDN
#
Expand Down
7 changes: 5 additions & 2 deletions src/cloudformation_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use aws_sdk_cloudformation::types::{Parameter, StackStatus};
use std::time::Duration;
use aws_sdk_cloudformation::error::SdkError;
use tracing::{error, event, Level};
use aws_sdk_cloudformation::error::ProvideErrorMetadata;

///
/// Waits indefinitely for a stack to be complete - either following an update, or an
Expand Down Expand Up @@ -111,7 +112,9 @@ pub async fn stack_exists_and_is_complete(
// TODO - clean this up, once the 'kind' on describe_stats structures the errors properly, rather
// than just string matching
// https://github.com/awslabs/aws-sdk-rust/issues/678
return if e.to_string().contains("does not exist") {
let svc_error = &e.message().expect("DescribeStacks contains an error message");

return if svc_error.contains("does not exist") {
Ok(false)
} else {
Err(Error::DescribeStacksError { source: e })
Expand Down Expand Up @@ -185,7 +188,7 @@ pub async fn update_stack(
match update_stack_response {
Ok(_) => Ok(()),
Err(e) => {
let error_txt = format!("{:?}", e);
let error_txt = format!("{:?}", e.message());
return if error_txt.to_string().contains("No updates are to be performed.") {
Ok(())
} else {
Expand Down

0 comments on commit 724c93c

Please sign in to comment.