Resolved: Lambda deploy: The policy failed legacy parsing (Service: AmazonIdentityManagement

We just tried to replace #{AWS::AccountId} with ${AWS::AccountId} and are receiving the same errors still.

Specifically, our use case is in the following location:

provider:
  ...
  iamRoleStatements:
    - Action:
        - secretsmanager:GetSecretValue
      Effect: 'Allow'
      Resource: 'arn:aws:someservice:${AWS::Region}:${AWS::AccountId}:something:/*/*'

I upgraded our serverless version to 2.43.1