【问题标题】:Mappings sections of the aws Cloudformation template and Serverless.ymlaws Cloudformation 模板和 Serverless.yml 的映射部分
【发布时间】:2018-08-30 19:28:56
【问题描述】:

我对 aws cloudformation 语法的“映射部分”有点怀疑:

示例:

...
Mappings:
  accounts:
    56565d644801:true
    986958470041:true
    090960219037:true
    05166767667:false

functions:
  MyFunction:
    handler: src/MyFunction/func.lambda_handler
    role: MyRole
    events:
      - schedule:
          rate: rate(12 hours)
          enabled: Fn::FindInMap
                - accounts
                - Ref "AWS::AccountId"
...

映射部分是否可以包含在 serverless.yml 文件中? 我的意思是,即使它是一个有效的 cloudformation 语法,是否可以将它包含在 serverless.yml 中,以便稍后我们可以实现它(serverless | sls deploy ...)?

谢谢,

【问题讨论】:

    标签: amazon-cloudformation serverless mappings


    【解决方案1】:

    您也许可以使用:

    functions:
      # ...
    
    resources:
      Mappings:
        accounts:
          56565d644801:true
          986958470041:true
          090960219037:true
          05166767667:false
    

    【讨论】:

    • 非常感谢!它在资源部分工作......我把它放在错误的地方;-)我需要继续努力。如果我还有其他疑问,我会提出一个新问题。
    猜你喜欢
    • 2017-02-14
    • 1970-01-01
    • 1970-01-01
    • 2018-02-03
    • 2022-01-20
    • 2018-07-31
    • 1970-01-01
    • 2020-07-10
    • 1970-01-01
    相关资源
    最近更新 更多