MediaPackage and MediaPAckagev2 channel in CloudFormation problem

0

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 https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mediapackagev2-channel.html). 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개 답변
0

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:

Outputs:
  FirstIngestEndpointUrl:
    Description: URL of the first ingest endpoint
    Value: !Join
      - ''
      - - 'URL: '
        - !GetAtt
          - MyMediaPackageV2Channel
          - IngestEndpoints.0.Url
profile picture
전문가
답변함 한 달 전
profile picture
전문가
검토됨 한 달 전
  • 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 :(.

0

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. https://docs.aws.amazon.com/medialive/latest/ug/wizard.html

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.

AWS
Mike-ME
답변함 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠