- 最新
- 最多得票
- 最多評論
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
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 官方已更新 3 年前
- AWS 官方已更新 1 年前
- AWS 官方已更新 2 年前
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 :(.