CloudFormation return values for MediaLive Inputs

0

I have a CFn template that deploys a MediaLive pipeline that gets used by internal people that don't know a lot about the AWS Elemental Media Services. I would like to have the people that deploy this template refer to the Outputs of the CloudFormation template to determine the MediaLive Input destination that they need to push RTMP content to. Documentation (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-medialive-input.html#aws-resource-medialive-input-return-values) says that the "Destinations" return value should do what I need.

Consider the following CFn:

Outputs:
   MediaLiveInputDestination:
     Value: !GetAtt <Resource>.Destinations

The template errors when being deployed, stating "Template format error: Every Value member must be a string.". I presume that an array is being passed back to CFn, which means that I have to specify a sub-value under Destinations - but there is no documentation that I can find to determine what sub-values are returned (I've tried the obvious candidates of ".A" and ".0" to no avail).

Any suggestions?

已提問 4 年前檢視次數 448 次
1 個回答
0
已接受的答案

I just tested this and it works. Can you try it out?

AWSTemplateFormatVersion: 2010-09-09
Parameters:
  Stream1:
    Description: StreamName1
    Type: String
    Default: test/test1
  Stream2:
    Description: StreamName2
    Type: String
    Default: test/test2
Metadata:
  'AWS::CloudFormation::Designer':
    0c5c0850-c9e8-4019-97b0-d950aaf22611:
      size:
        width: 60
        height: 60
      position:
        x: 151
        'y': 145
      z: 0
Resources:
  MLI5AM0O:
    Type: 'AWS::MediaLive::Input'
    Properties:
      Type: RTMP_PUSH
      Name: Testing12345
      InputSecurityGroups:
        - 2461108
      Destinations:
        - StreamName: !Ref Stream1
        - StreamName: !Ref Stream2
    Metadata:
      'AWS::CloudFormation::Designer':
        id: 0c5c0850-c9e8-4019-97b0-d950aaf22611
Outputs:
  StreamingPrimaryURL:
    Description: Primary Ingest
    Value: !Select [ 0, !GetAtt MLI5AM0O.Destinations]
    
  StreamingSecondaryURL:
    Description: Secondary Ingest
    Value: !Select [ 1, !GetAtt MLI5AM0O.Destinations]
KeyValueDescriptionExport name
StreamingPrimaryURLrtmp://52.201.128.200:1935/test/test1Primary Ingest-
StreamingSecondaryURLrtmp://54.173.229.233:1935/test/test2Secondary Ingest-
AWS
已回答 4 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南