最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Using CloudFormation ForEach to create list of indefinite size - Stack Overflow

programmeradmin2浏览0评论

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'>
发布评论

评论列表(0)

  1. 暂无评论