MediaPackage and MediaPAckagev2 channel in CloudFormation problem


Hi Guys, I tried to use CloudFormation to establish automatically all media services. However, when I tried to get output from MediaPackage channel resource or MediaPackagev2 channel I could not get it. The objects I used were: "AWS::MediaPackage::Channel" and "AWS::MediaPackageV2::Channel". According to CloudFormation at least version 2 should provide outputs for Ingest urls: **IngestEndpoints **(see details I got response like: "Template format error: Every Value member must be a string." Tried various tricks in CloudFormation but seem like non of them was work. These HLS ingest endpoints along with user and password are needed by MediaLive configuration. Do you know any workaround? Thanks

2 Answers

When you want to output something like IngestEndpoints, which is a list of objects, you need to specifically reference the attributes of the object you want to output and ensure they are converted to a string format. Unfortunately, CloudFormation does not natively support complex structures (like lists or maps) as outputs directly. You can only output strings.

However, you can work around this limitation by using a combination of intrinsic functions such as !Join, !Select, and !GetAtt to construct a string from the parts of the IngestEndpoints you need. For example, if you want to extract the URL of the first ingest endpoint, you could do something like this in your CloudFormation template:

    Description: URL of the first ingest endpoint
    Value: !Join
      - ''
      - - 'URL: '
        - !GetAtt
          - MyMediaPackageV2Channel
          - IngestEndpoints.0.Url
profile picture
answered 2 months ago
profile picture
reviewed 2 months ago
  • Hi Mina, Thank you for the prompt answer. I tried it but get: "Requested attribute IngestEndpoints.0.Url does not exist in schema for AWS::MediaPackageV2::Channel". When I use awscli it returns two endpoints. Ah...this is CloudFormation weirdness. It cannot deal with arrays :(.


If you are creating a live streaming channel with AWS Elemental MediaLive, AWS Elemental MediaPackage and CloudFront, you may want to investigate the Workflow Wizard feature with MediaLive. This will create all the components needed in a live channel.

It will also create a CloudFormation template for additional channels. This may be useful as a reference to how MediaPackage is detailed in the template. Including a CloudFront distribution, when stepping through Workflow Wizard, will automatically connect MediaPackage Endpoints to CloudFront. The Endpoints will list the CloudFront URL associated with that output.

answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions