class OriginEndpointPolicy (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.MediaPackageV2.Alpha.OriginEndpointPolicy |
Go | github.com/aws/aws-cdk-go/awsmediapackagev2alpha/v2#OriginEndpointPolicy |
Java | software.amazon.awscdk.services.mediapackagev2.alpha.OriginEndpointPolicy |
Python | aws_cdk.aws_mediapackagev2_alpha.OriginEndpointPolicy |
TypeScript (source) | @aws-cdk/aws-mediapackagev2-alpha ยป OriginEndpointPolicy |
Implements
IConstruct, IDependable, IResource, IEnvironment
The origin endpoint policy for an AWS Elemental MediaPackage V2 Origin Endpoint.
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 origin endpoint policy method is implemented differently than addToResourcePolicy()
as OriginEndpointPolicy creates a new policy without knowing one earlier existed.
This will cause a resource conflict if both are invoked (or even multiple origin endpoint
policies are defined), so care is to be taken to ensure only 1 policy
is created per origin endpoint.
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';
import { aws_secretsmanager as secretsmanager } from 'aws-cdk-lib';
declare const originEndpoint: mediapackagev2_alpha.OriginEndpoint;
declare const policyDocument: iam.PolicyDocument;
declare const role: iam.Role;
declare const secret: secretsmanager.Secret;
const originEndpointPolicy = new mediapackagev2_alpha.OriginEndpointPolicy(this, 'MyOriginEndpointPolicy', {
originEndpoint: originEndpoint,
// the properties below are optional
cdnAuth: {
secrets: [secret],
// the properties below are optional
role: role,
},
policyDocument: policyDocument,
});
Initializer
new OriginEndpointPolicy(scope: Construct, id: string, props: OriginEndpointPolicyProps)
Parameters
- scope
Construct - id
string - props
OriginEndpoint Policy Props
Construct Props
| Name | Type | Description |
|---|---|---|
| origin | IOrigin | OriginEndpoint to apply the Origin Endpoint Policy to. |
| cdn | Cdn | Optional CDN Authorization configuration. |
| policy | Policy | Initial policy document to apply. |
originEndpoint
Type:
IOrigin
OriginEndpoint to apply the Origin Endpoint Policy to.
cdnAuth?
Type:
Cdn
(optional, default: No header based CDN authorization)
Optional CDN Authorization configuration.
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 Origin Endpoint. |
| 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 Origin Endpoint.
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 (