That feature was recently added to SSM https://aws.amazon.com/about-aws/whats-new/2022/05/aws-syste...
Using something like gossm which I just put a PR in for this feature also makes this easier https://github.com/gjbae1212/gossm/pull/54
Using something like gossm which I just put a PR in for this feature also makes this easier https://github.com/gjbae1212/gossm/pull/54