Trying to figure out how to deploy aws_ssm_association

I may have learned this whole thing backwards. But what I’m trying to do is to add deployed instances to the various SSM documents that are part of the “Quick Start” in SSM. These use AWS-managed documents.

So, using the example in the TF Registry for applying the AWS-AttachIAMToInstance document to all instances with a certain tag, I get an error saying Error: creating SSM association: InvalidParameters: Parameter "InstanceId" requires a value.

I’ve played around with this module a bunch, and I always seem to have this problem, where I get an error about a parameter that doesn’t appear to exist in the existing (manual) deployment of this document. The parameters on a working version I manually configured in the console do not include “InstanceId”. And if I’m trying to apply it to all instances with a tag, this would seem to be problematic anyway.

I remember seeing something when searching for a fix stating that InstanceId is deprecated in aws cli.

So: #1, has anyone had experience deploying SSM associations, and am I doing something conspicuously wrong? #2, Should I be creating separate versions of the AWS SSM documents for each resource block instead of using the existing AWS-managed ones?