Closed arq-anthonyw closed 3 years ago
Looking at source for Get-SSMResourceTag CmdLet and .NET SDK ListTagsForResourceRequest, I do not see any RegEx validation for ResourceId
.
P49034715
Hi @arq-anthonyw,
Good afternoon.
Based on , the Get-SSMResourceTag
uses AWS SDK for .NET to invoke ListTagsForResource service API action. As per SSM service team, ListTagsForResource
API action does not support EC2 instances as EC2 has their own API for tagging. SSM only supports the tagging for the managed instances (and few other resources).
You may try using Get-EC2Tag-Cmdlet
for EC2 instances. Hope this helps.
Thanks, Ashish
This issue has not recieved a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
Description
Get-SSMResourceTag for
ManagedInstance
types is failing with error messageresourceId i-0edbbb6e54088396a should be in format mi-[0-9a-f]{17} for resource type ManagedInstance
. Which in a sense is somewhat correct however not all instances registered to SSM as a managed instance are in that format. I have old instances with instance Id's ofi-xxxxxxxx
and new instances with id's ofi-xxxxxxxxxxxxxxxxx
. The only instances I have usingmi-
are actually on-prem hybrid instances I have registered via a hybrid activation.Reproduction Steps
Spin up a new Windows instance using an AWS provided AMI that has SSM baked in and a suitable role attached and it will register with SSM automatically using it's instance ID and not something starting with
mi-
Logs
Environment
Resolution
I haven't checked the source code yet for the cmdlet to see if the restriction is based on the module itself or the AWS API but if it's a restriction controlled from the module it should be amended to allow for other scenarios supported by SSM. If it's the API... I'm guessing someone needs to be advised their stuff doesn't work like how they think it does?
This is a :bug: bug-report