Class OriginEndpointPolicy

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.mediapackagev2.alpha.OriginEndpointPolicy
All Implemented Interfaces:
IEnvironmentAware, IResource, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.127.0 (build 2117ad5)", date="2026-04-02T21:55:36.085Z") @Stability(Experimental) public class OriginEndpointPolicy extends Resource
(experimental) 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 software.amazon.awscdk.services.mediapackagev2.alpha.*;
 import software.amazon.awscdk.services.iam.*;
 import software.amazon.awscdk.services.secretsmanager.*;
 OriginEndpoint originEndpoint;
 PolicyDocument policyDocument;
 Role role;
 Secret secret;
 OriginEndpointPolicy originEndpointPolicy = OriginEndpointPolicy.Builder.create(this, "MyOriginEndpointPolicy")
         .originEndpoint(originEndpoint)
         // the properties below are optional
         .cdnAuth(CdnAuthConfiguration.builder()
                 .secrets(List.of(secret))
                 // the properties below are optional
                 .role(role)
                 .build())
         .policyDocument(policyDocument)
         .build();
 
  • Field Details

    • PROPERTY_INJECTION_ID

      @Stability(Experimental) public static final String PROPERTY_INJECTION_ID
      (experimental) Uniquely identifies this class.
  • Constructor Details

    • OriginEndpointPolicy

      protected OriginEndpointPolicy(software.amazon.jsii.JsiiObjectRef objRef)
    • OriginEndpointPolicy

      protected OriginEndpointPolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • OriginEndpointPolicy

      @Stability(Experimental) public OriginEndpointPolicy(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull OriginEndpointPolicyProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • getDocument

      @Stability(Experimental) @NotNull public PolicyDocument getDocument()
      (experimental) A policy document containing permissions to add to the specified Origin Endpoint.