class ChannelPolicy (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.MediaPackageV2.Alpha.ChannelPolicy |
Go | github.com/aws/aws-cdk-go/awsmediapackagev2alpha/v2#ChannelPolicy |
Java | software.amazon.awscdk.services.mediapackagev2.alpha.ChannelPolicy |
Python | aws_cdk.aws_mediapackagev2_alpha.ChannelPolicy |
TypeScript (source) | @aws-cdk/aws-mediapackagev2-alpha ยป ChannelPolicy |
Implements
IConstruct, IDependable, IResource, IEnvironment
The channel policy for an AWS Elemental MediaPackage V2 channel.
Policies define the operations that are allowed on this resource.
You almost never need to define this construct directly.
All AWS resources that support resource policies have a method called
addToResourcePolicy(), which will automatically create a new resource
policy if one doesn't exist yet, otherwise it will add to the existing
policy.
The channel policy method is implemented differently than addToResourcePolicy()
as ChannelPolicy creates a new policy without knowing one earlier existed.
This will cause a resource conflict if both are invoked (or even multiple channel
policies are defined), so care is to be taken to ensure only 1 channel policy
is created per channel.
Hence it's strongly recommended to use addToResourcePolicy().
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as mediapackagev2_alpha from '@aws-cdk/aws-mediapackagev2-alpha';
import { aws_iam as iam } from 'aws-cdk-lib';
declare const channel: mediapackagev2_alpha.Channel;
declare const policyDocument: iam.PolicyDocument;
const channelPolicy = new mediapackagev2_alpha.ChannelPolicy(this, 'MyChannelPolicy', {
channel: channel,
// the properties below are optional
policyDocument: policyDocument,
});
Initializer
new ChannelPolicy(scope: Construct, id: string, props: ChannelPolicyProps)
Parameters
- scope
Construct - id
string - props
ChannelPolicy Props
Construct Props
| Name | Type | Description |
|---|---|---|
| channel | IChannel | Channel to apply the Channel Policy to. |
| policy | Policy | Initial policy document to apply. |
channel
Type:
IChannel
Channel to apply the Channel Policy to.
policyDocument?
Type:
Policy
(optional, default: empty policy document)
Initial policy document to apply.
Properties
| Name | Type | Description |
|---|---|---|
| document | Policy | A policy document containing permissions to add to the specified channel. |
| env | Resource | The environment this resource belongs to. |
| node | Node | The tree node. |
| stack | Stack | The stack in which this resource is defined. |
| static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
document
Type:
Policy
A policy document containing permissions to add to the specified channel.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
node
Type:
Node
The tree node.
stack
Type:
Stack
The stack in which this resource is defined.
static PROPERTY_INJECTION_ID
Type:
string
Uniquely identifies this class.
Methods
| Name | Description |
|---|---|
| apply | Apply the given removal policy to this resource. |
| to | Returns a string representation of this construct. |
| with(...mixins) | Applies one or more mixins to this construct. |
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
RemovalPolicy
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN).
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
with(...mixins)
public with(...mixins: IMixin[]): IConstruct
Parameters
- mixins
IMixin
Returns
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.

.NET
Go
Java
Python
TypeScript (