输出 JobQueueName 而不是 AWS::Batch::JobQueue 资源的 ARN



是否可以导出 CloudFormation Outputs部分中的JobQueue Name而不是AWS::Batch::JobQueue资源的 ARN(实际上是serverless.yml(?

这是我导出 ARN 的方式:

Outputs:
  epJobQueueMedium:
    Description: Batch Job Queue 50 - medium priority
    Value:
      Ref: epJobQueue50
    Export:
      Name: epJobQueueMediumArn

Fn::GetAtt 不会为 AWS::Batch::JobQueue 返回任何内容,请参阅页面底部的表格。

Fn::Ref返回 AWS::Batch::JobQueue 的 Arn,请参阅页面底部的表。

是否可以直接获取资源的JobQueueName以避免任何进一步的拆分(Fn::Split(并在ARN上选择(Fn::Select(?

使用参数怎么样?

---
AWSTemplateFormatVersion: '2010-09-09'
Description: API Template
Parameters:
  JobQueueName:
    Description: The name of the job queue
    Type: String
    Default: MyJobQueueName
JobQueue:
  Type: AWS::Batch::JobQueue
  Properties:
    ...
    JobQueueName: !Ref JobQueueName
Outputs:
  epJobQueueMediumName:
    Description: The name of this job queue
    Value: !Ref JobQueueName
    Export:
      Name: epJobQueueMediumName

否则,可以选择/拆分可以整齐地完成:

Value: !Select [ "1", !Split [ "/", !Ref epJobQueue50 ] ]

最新更新