diff --git a/.changelog/24530.txt b/.changelog/24530.txt new file mode 100644 index 00000000000..1eee2e0dd9b --- /dev/null +++ b/.changelog/24530.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_ssm_document: Always include `attachment_sources` when updating SSM documents +``` diff --git a/internal/service/ssm/document.go b/internal/service/ssm/document.go index ee3091e8f52..617a6d8e7bd 100644 --- a/internal/service/ssm/document.go +++ b/internal/service/ssm/document.go @@ -673,8 +673,8 @@ func updateDocument(d *schema.ResourceData, meta interface{}) error { updateDocInput.VersionName = aws.String(v.(string)) } - if d.HasChange("attachments_source") { - updateDocInput.Attachments = expandSsmAttachmentsSources(d.Get("attachments_source").([]interface{})) + if v, ok := d.GetOk("attachments_source"); ok { + updateDocInput.Attachments = expandSsmAttachmentsSources(v.([]interface{})) } newDefaultVersion := d.Get("default_version").(string)