I want a CloudFormation template to be able to create a list of repositories in a role's Trust relationship, to look like this:
Effect": "Allow",
"Principal": { "Federated": "arn:aws:iam::01234567890:oidc-provider/token.actions.githubusercontent" },
"Action": "sts:AssumeRoleWithWebIdentity",
"Condition":
{ "StringLike": { "token.actions.githubusercontent:sub": [ "repo:repo1", "repo:repo2", "repo:repo3" ] }
This is my latest attempt
Condition:
StringLike:
token.actions.githubusercontent:sub:
Fn::ForEach::MultiRep:
- Repos
- !Ref $GitHubRepo
-- ${Repos}
Here $GitHubRepo is a parameter of type List<String> or CommaDelimitedList. I get the error
invalid type for parameter Parameters[2].ParameterValue, value: ['repo1', 'repo2', 'repo3'], type: <class 'list'>, valid types: <class 'str'>