Skip to content

Commit

Permalink
fix: allow ResourceTargetDefinition without name for attribute `Pro…
Browse files Browse the repository at this point in the history
…perties`

This situation arose when describing the changeset of a nested stack.
It's not clear if this was triggered by an upstream change or has always
been an ommission.
  • Loading branch information
connec committed Apr 12, 2024
1 parent 87cc393 commit 161e51c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/change_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ pub enum ResourceTargetDefinition {
/// A change to the resource's properties.
Properties {
/// The name of the property.
name: String,
name: Option<String>,

/// Indicates whether a change to this property causes the resource to be recreated.
requires_recreation: RequiresRecreation,
Expand Down Expand Up @@ -641,9 +641,7 @@ impl ResourceTargetDefinition {
.expect("ResourceTargetDefinition without attribute");
match attribute {
aws_sdk_cloudformation::types::ResourceAttribute::Properties => Self::Properties {
name: target
.name
.expect("ResourceTargetDefinition with attribute \"Properties\" without name"),
name: target.name,
requires_recreation: target
.requires_recreation
.expect(concat!(
Expand Down
2 changes: 1 addition & 1 deletion tests/it/change_set_detail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async fn secrets_manager_secret_tags_only() -> Result<(), Box<dyn std::error::Er
assert!(!targets.is_empty());
assert!(targets.iter().all(|target| matches!(
target,
ResourceTargetDefinition::Properties { name, .. } if name == "Tags"
ResourceTargetDefinition::Properties { name, .. } if name.as_deref() == Some("Tags")
)));

clean_up(stack_name).await?;
Expand Down

0 comments on commit 161e51c

Please # to comment.