Hello,
I get the following error:
The CloudFormation template is invalid: Template format error: Every Mappings attribute must be a String or a List.
When I try to deploy the following resource
---
AWSTemplateFormatVersion: "2010-09-09"
Description: IAM Roles and Policies
Mappings:
roles:
office:
administrator:
Fn::Join:
- ''
- - 'arn:aws:iam::'
- '#{AWS::AccountId}'
- ':role/Administrator'
Resources:
PolicyGroupAdmin:
Type: AWS::IAM::Policy
DependsOn:
- GroupAdmin
Properties:
Groups:
- Ref: GroupAdmin
PolicyName: Admin
PolicyDocument:
Version: "2012-10-17"
Statement:
- Sid: AllowSwitchRoleToAdmin
Effect: Allow
Action:
- sts:AssumeRole
Resource:
- !FindInMap [roles, office, administrator]
If I use:
Mappings:
roles:
office:
administrator: 'arn:aws:iam::****:role/Administrator'
this works, so how do i pass the AWS::AccountId inside a mapping correctly?
any advise is much appreciated