assets
Creates, updates, deletes or gets an asset
resource or lists assets
in a region
Overview
Name | assets |
Type | Resource |
Description | Resource schema for AWS::MediaPackage::Asset |
Id | aws.mediapackage.assets |
Fields
Name | Datatype | Description |
---|---|---|
arn | string | The ARN of the Asset. |
created_at | string | The time the Asset was initially submitted for Ingest. |
egress_endpoints | array | The list of egress endpoints available for the Asset. |
id | string | The unique identifier for the Asset. |
packaging_group_id | string | The ID of the PackagingGroup for the Asset. |
resource_id | string | The resource ID to include in SPEKE key requests. |
source_arn | string | ARN of the source object in S3. |
source_role_arn | string | The IAM role_arn used to access the source S3 bucket. |
tags | array | A collection of tags associated with a resource |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Id, PackagingGroupId, SourceArn, SourceRoleArn, region |
delete_resource | DELETE | data__Identifier, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all assets
in a region.
SELECT
region,
arn,
created_at,
egress_endpoints,
id,
packaging_group_id,
resource_id,
source_arn,
source_role_arn,
tags
FROM aws.mediapackage.assets
WHERE region = 'us-east-1';
Gets all properties from an individual asset
.
SELECT
region,
arn,
created_at,
egress_endpoints,
id,
packaging_group_id,
resource_id,
source_arn,
source_role_arn,
tags
FROM aws.mediapackage.assets
WHERE region = 'us-east-1' AND data__Identifier = '<Id>';
INSERT
example
Use the following StackQL query and manifest file to create a new asset
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.mediapackage.assets (
Id,
PackagingGroupId,
SourceArn,
SourceRoleArn,
region
)
SELECT
'{{ Id }}',
'{{ PackagingGroupId }}',
'{{ SourceArn }}',
'{{ SourceRoleArn }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.mediapackage.assets (
EgressEndpoints,
Id,
PackagingGroupId,
ResourceId,
SourceArn,
SourceRoleArn,
Tags,
region
)
SELECT
'{{ EgressEndpoints }}',
'{{ Id }}',
'{{ PackagingGroupId }}',
'{{ ResourceId }}',
'{{ SourceArn }}',
'{{ SourceRoleArn }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: asset
props:
- name: EgressEndpoints
value:
- PackagingConfigurationId: '{{ PackagingConfigurationId }}'
Url: '{{ Url }}'
- name: Id
value: '{{ Id }}'
- name: PackagingGroupId
value: '{{ PackagingGroupId }}'
- name: ResourceId
value: '{{ ResourceId }}'
- name: SourceArn
value: '{{ SourceArn }}'
- name: SourceRoleArn
value: '{{ SourceRoleArn }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.mediapackage.assets
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';
Permissions
To operate on the assets
resource, the following permissions are required:
Create
mediapackage-vod:CreateAsset,
mediapackage-vod:DescribeAsset,
mediapackage-vod:TagResource,
iam:PassRole
Read
mediapackage-vod:DescribeAsset
Delete
mediapackage-vod:DescribeAsset,
mediapackage-vod:DeleteAsset
List
mediapackage-vod:ListAssets,
mediapackage-vod:DescribePackagingGroup