Show / Hide Table of Contents

Class AddBehaviorOptions

Options for adding a new behavior to a Distribution.

Inheritance
object
AddBehaviorOptions
Implements
IAddBehaviorOptions
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class AddBehaviorOptions : IAddBehaviorOptions
Syntax (vb)
Public Class AddBehaviorOptions Implements IAddBehaviorOptions
Remarks

ExampleMetadata: infused

Examples
// Add a behavior to a Distribution after initial creation.
            Bucket myBucket;
            Distribution myWebDistribution;

            myWebDistribution.AddBehavior("/images/*.jpg", new S3Origin(myBucket), new AddBehaviorOptions {
                ViewerProtocolPolicy = ViewerProtocolPolicy.REDIRECT_TO_HTTPS
            });

Synopsis

Constructors

AddBehaviorOptions()

Options for adding a new behavior to a Distribution.

Properties

AllowedMethods

HTTP methods to allow for this behavior.

CachePolicy

The cache policy for this behavior.

CachedMethods

HTTP methods to cache for this behavior.

Compress

Whether you want CloudFront to automatically compress certain files for this cache behavior.

EdgeLambdas

The Lambda@Edge functions to invoke before serving the contents.

EnableGrpc

Enables your CloudFront distribution to receive gRPC requests and to proxy them directly to your origins.

FunctionAssociations

The CloudFront functions to invoke before serving the contents.

OriginRequestPolicy

The origin request policy for this behavior.

RealtimeLogConfig

The real-time log configuration to be attached to this cache behavior.

ResponseHeadersPolicy

The response headers policy for this behavior.

SmoothStreaming

Set this to true to indicate you want to distribute media files in the Microsoft Smooth Streaming format using this behavior.

TrustedKeyGroups

A list of Key Groups that CloudFront can use to validate signed URLs or signed cookies.

ViewerProtocolPolicy

The protocol that viewers can use to access the files controlled by this behavior.

Constructors

AddBehaviorOptions()

Options for adding a new behavior to a Distribution.

public AddBehaviorOptions()
Remarks

ExampleMetadata: infused

Examples
// Add a behavior to a Distribution after initial creation.
            Bucket myBucket;
            Distribution myWebDistribution;

            myWebDistribution.AddBehavior("/images/*.jpg", new S3Origin(myBucket), new AddBehaviorOptions {
                ViewerProtocolPolicy = ViewerProtocolPolicy.REDIRECT_TO_HTTPS
            });

Properties

AllowedMethods

HTTP methods to allow for this behavior.

public AllowedMethods? AllowedMethods { get; set; }
Property Value

AllowedMethods

Remarks

Default: AllowedMethods.ALLOW_GET_HEAD

CachePolicy

The cache policy for this behavior.

public ICachePolicy? CachePolicy { get; set; }
Property Value

ICachePolicy

Remarks

The cache policy determines what values are included in the cache key, and the time-to-live (TTL) values for the cache.

Default: CachePolicy.CACHING_OPTIMIZED

See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/controlling-the-cache-key.html.

CachedMethods

HTTP methods to cache for this behavior.

public CachedMethods? CachedMethods { get; set; }
Property Value

CachedMethods

Remarks

Default: CachedMethods.CACHE_GET_HEAD

Compress

Whether you want CloudFront to automatically compress certain files for this cache behavior.

public bool? Compress { get; set; }
Property Value

bool?

Remarks

See https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ServingCompressedFiles.html#compressed-content-cloudfront-file-types for file types CloudFront will compress.

Default: true

EdgeLambdas

The Lambda@Edge functions to invoke before serving the contents.

public IEdgeLambda[]? EdgeLambdas { get; set; }
Property Value

IEdgeLambda[]

Remarks

Default: - no Lambda functions will be invoked

See: https://aws.amazon.com/lambda/edge

EnableGrpc

Enables your CloudFront distribution to receive gRPC requests and to proxy them directly to your origins.

public bool? EnableGrpc { get; set; }
Property Value

bool?

Remarks

If the enableGrpc is set to true, the following restrictions apply:

    Default: false

    See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-using-grpc.html

    FunctionAssociations

    The CloudFront functions to invoke before serving the contents.

    public IFunctionAssociation[]? FunctionAssociations { get; set; }
    Property Value

    IFunctionAssociation[]

    Remarks

    Default: - no functions will be invoked

    OriginRequestPolicy

    The origin request policy for this behavior.

    public IOriginRequestPolicy? OriginRequestPolicy { get; set; }
    Property Value

    IOriginRequestPolicy

    Remarks

    The origin request policy determines which values (e.g., headers, cookies) are included in requests that CloudFront sends to the origin.

    Default: - none

    RealtimeLogConfig

    The real-time log configuration to be attached to this cache behavior.

    public IRealtimeLogConfig? RealtimeLogConfig { get; set; }
    Property Value

    IRealtimeLogConfig

    Remarks

    Default: - none

    ResponseHeadersPolicy

    The response headers policy for this behavior.

    public IResponseHeadersPolicy? ResponseHeadersPolicy { get; set; }
    Property Value

    IResponseHeadersPolicy

    Remarks

    The response headers policy determines which headers are included in responses

    Default: - none

    SmoothStreaming

    Set this to true to indicate you want to distribute media files in the Microsoft Smooth Streaming format using this behavior.

    public bool? SmoothStreaming { get; set; }
    Property Value

    bool?

    Remarks

    Default: false

    TrustedKeyGroups

    A list of Key Groups that CloudFront can use to validate signed URLs or signed cookies.

    public IKeyGroup[]? TrustedKeyGroups { get; set; }
    Property Value

    IKeyGroup[]

    Remarks

    Default: - no KeyGroups are associated with cache behavior

    See: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html

    ViewerProtocolPolicy

    The protocol that viewers can use to access the files controlled by this behavior.

    public ViewerProtocolPolicy? ViewerProtocolPolicy { get; set; }
    Property Value

    ViewerProtocolPolicy?

    Remarks

    Default: ViewerProtocolPolicy.ALLOW_ALL

    Implements

    IAddBehaviorOptions
    Back to top Generated by DocFX