I want this resource to work with the !Sub
(or Fn::Sub
) intrinsic function
Resource: !Sub 'arn:aws:iam::${AWS::AccountId}:user/${aws:username}'
The aws:username
is a pollicy variable that mustn't be replaced.
One solution would be to use Fn::Join
instead and write a bit more boilerplate code.
Better: Can you escape the ${aws:username}
so that !Sub
will work here? Unfortunately, the documentation does not mention anything about escaping.