Closed shalen-n closed 3 years ago
@shalen-n kindly filed this on behalf of my support case, ID 7914332281. 😊
Hi,
The reason why we don't support url in cloudformation is because of we want to keep consistent with our MediaPackage API response. If you call describe_origin_endpoint in aws CLI, the url
field is also empty. But you can get the value from the url
field in HlsManifest
section of the response. url
will be ambiguous in the long term so that's why we only use it for HLS manifest URL. Due to the addition of hlsmanifests with CMAF, CMAF is different from HLS endpoints.
For getting the url of cmafPackage based on OriginEndpoint, what you can do is, create an aws lambda in the console or via cloudformation. In this lambda code, you can call MediaPackage API to describe the origin endpoint. In the API response, it will contain the url of cmafPackage.
For example, if your lambda code is python, you can use Boto3 to call describe_origin_endpoint
: https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/mediapackage.html#MediaPackage.Client.describe_origin_endpoint
In this response, you can find the url in the HlsManifest section of CmafPackage like following, but one thing worth noting is, the url
in CmafPackage will be empty, you can only get the valid url from HlsManifests section:
"Arn": "arn:aws:mediapackage:us-west-2:account_id:origin_endpoints/guid",
"ChannelId": "channel_id",
"CmafPackage": {
"HlsManifests": [
{
"AdMarkers": "DATERANGE",
"Id": " endpoint_id ",
"IncludeIframeOnlyStream": true,
"PlaylistType": "EVENT",
"PlaylistWindowSeconds": 60,
"ProgramDateTimeIntervalSeconds": 6,
"Url": "https://egress.your_profile.babelfish-us-west-2.com/out/v1/guid/endpoint_id/index.m3u8"
}
],
"SegmentDurationSeconds": 6,
"SegmentPrefix": "cmaf",
"StreamSelection": {
"MaxVideoBitsPerSecond": 2147483647,
"MinVideoBitsPerSecond": 0,
"StreamOrder": "ORIGINAL"
}
},
"Id": "endpoint_id",
"ManifestName": "index",
"Origination": "ALLOW",
"StartoverWindowSeconds": 0,
"Tags": {},
"TimeDelaySeconds": 0,
"Url": "",
"Whitelist": []
}
@liyuanliu1991 I've had to write quite a few custom resources for Media* products… this is incredibly inconvenient for users of CloudFormation. Return values from CloudFormation don't always directly reflect the structure of the data in the API – solving this in the existing MediaPackage OriginEndpoint resource is possible.
1. Title
[Feature Request] AWS::MediaPackage::OriginEndpoint - Support for Url retrieval of CmafPackage based OriginEndpoint resources
2. Scope of request
The "AWS::MediaPackage::OriginEndpoint" [1] CloudFormation resource supports the Url return value. Upon further investigation it seems that this only supports the retrieval of Urls for DASH and HLS based package OriginEndpoints and not CmafPackage based OriginEndpoint. Consequently, when attempting to return the Url for CmafPackage based OriginEndpoints via stack outputs, the result is an empty Url field.
3. Expected behavior
To return the Url associated with creating CmafPackage based "AWS::MediaPackage::OriginEndpoint" resources in CloudFormation via the Fn::GetAtt intrinsic function associated with this resource.
4. Suggest specific test cases
Test Case 1: For example the following template does not return a Url for the CmafPackage based OrginEndpoint:
Test Case 2: The following template will return a Url for the DashPackage based OriginEndpoint
5. Helpful Links to speed up research and evaluation
[1] AWS::MediaPackage::OriginEndpoint - https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-mediapackage-originendpoint.html
6. Category (required) - Will help with tagging and be easier to find by other users to +1