Class OriginEndpointPolicy
- All Implemented Interfaces:
IEnvironmentAware,IResource,software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
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();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class(experimental) A fluent builder forOriginEndpointPolicy.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IResource
IResource.Jsii$Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String(experimental) Uniquely identifies this class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOriginEndpointPolicy(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedOriginEndpointPolicy(software.amazon.jsii.JsiiObjectRef objRef) OriginEndpointPolicy(software.constructs.Construct scope, String id, OriginEndpointPolicyProps props) -
Method Summary
Modifier and TypeMethodDescription(experimental) A policy document containing permissions to add to the specified Origin Endpoint.Methods inherited from class software.amazon.awscdk.Resource
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResource, withMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
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
(experimental) A policy document containing permissions to add to the specified Origin Endpoint.
-