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 | awscc.mediapackage.assets |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier for the Asset. |
region | string | AWS region. |
For more information, see AWS::MediaPackage::Asset.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | assets | INSERT | Id, PackagingGroupId, SourceArn, SourceRoleArn, region |
delete_resource | assets | DELETE | Identifier, region |
list_resources | assets_list_only | SELECT | region |
get_resource | assets | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 awscc.mediapackage.assets
WHERE
region = '{{ region }}' AND
Identifier = '{{ id }}';
Lists all assets in a region.
SELECT
region,
id
FROM awscc.mediapackage.assets_list_only
WHERE
region = '{{ region }}';
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 awscc.mediapackage.assets (
Id,
PackagingGroupId,
SourceArn,
SourceRoleArn,
region
)
SELECT
'{{ id }}',
'{{ packaging_group_id }}',
'{{ source_arn }}',
'{{ source_role_arn }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.mediapackage.assets (
EgressEndpoints,
Id,
PackagingGroupId,
ResourceId,
SourceArn,
SourceRoleArn,
Tags,
region
)
SELECT
'{{ egress_endpoints }}',
'{{ id }}',
'{{ packaging_group_id }}',
'{{ resource_id }}',
'{{ source_arn }}',
'{{ source_role_arn }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: asset
props:
- name: egress_endpoints
value:
- packaging_configuration_id: '{{ packaging_configuration_id }}'
url: '{{ url }}'
- name: id
value: '{{ id }}'
- name: packaging_group_id
value: '{{ packaging_group_id }}'
- name: resource_id
value: '{{ resource_id }}'
- name: source_arn
value: '{{ source_arn }}'
- name: source_role_arn
value: '{{ source_role_arn }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
DELETE example
/*+ delete */
DELETE FROM awscc.mediapackage.assets
WHERE
Identifier = '{{ id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the assets resource, the following permissions are required:
- Create
- Read
- Delete
- List
mediapackage-vod:CreateAsset,
mediapackage-vod:DescribeAsset,
mediapackage-vod:TagResource,
iam:PassRole
mediapackage-vod:DescribeAsset
mediapackage-vod:DescribeAsset,
mediapackage-vod:DeleteAsset
mediapackage-vod:ListAssets,
mediapackage-vod:DescribePackagingGroup