Class CloudFrontWebDistribution
(deprecated) Amazon CloudFront is a global content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to your viewers with low latency and high transfer speeds.
Inherited Members
Namespace: Amazon.CDK.AWS.CloudFront
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CloudFrontWebDistribution : Resource, IDistribution, IResource
Syntax (vb)
Public Class CloudFrontWebDistribution
Inherits Resource
Implements IDistribution, IResource
Remarks
CloudFront fronts user provided content and caches it at edge locations across the world.
Here's how you can use this construct:
var sourceBucket = new Bucket(this, "Bucket");
var distribution = new CloudFrontWebDistribution(this, "MyDistribution", new CloudFrontWebDistributionProps {
OriginConfigs = new [] { new SourceConfiguration {
S3OriginSource = new S3OriginConfig {
S3BucketSource = sourceBucket
},
Behaviors = new [] { new Behavior { IsDefaultBehavior = true } }
} }
});
This will create a CloudFront distribution that uses your S3Bucket as its origin.
You can customize the distribution using additional properties from the CloudFrontWebDistributionProps interface.
Stability: Deprecated
Resource: AWS::CloudFront::Distribution
ExampleMetadata: infused
Examples
Bucket sourceBucket;
var viewerCertificate = ViewerCertificate.FromIamCertificate("MYIAMROLEIDENTIFIER", new ViewerCertificateOptions {
Aliases = new [] { "MYALIAS" }
});
new CloudFrontWebDistribution(this, "MyCfWebDistribution", new CloudFrontWebDistributionProps {
OriginConfigs = new [] { new SourceConfiguration {
S3OriginSource = new S3OriginConfig {
S3BucketSource = sourceBucket
},
Behaviors = new [] { new Behavior { IsDefaultBehavior = true } }
} },
ViewerCertificate = viewerCertificate
});
Synopsis
Constructors
CloudFrontWebDistribution(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CloudFrontWebDistribution(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
CloudFrontWebDistribution(Construct, String, ICloudFrontWebDistributionProps) |
Properties
DistributionDomainName | (deprecated) The domain name created by CloudFront for this distribution. |
DistributionId | (deprecated) The distribution ID for this distribution. |
LoggingBucket | (deprecated) The logging bucket for this CloudFront distribution. |
Methods
FromDistributionAttributes(Construct, String, ICloudFrontWebDistributionAttributes) | (deprecated) Creates a construct that represents an external (imported) distribution. |
Grant(IGrantable, String[]) | (deprecated) Adds an IAM policy statement associated with this distribution to an IAM principal's policy. |
GrantCreateInvalidation(IGrantable) | (deprecated) Grant to create invalidations for this bucket to an IAM principal (Role/Group/User). |
Constructors
CloudFrontWebDistribution(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CloudFrontWebDistribution(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CloudFrontWebDistribution(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CloudFrontWebDistribution(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
CloudFrontWebDistribution(Construct, String, ICloudFrontWebDistributionProps)
public CloudFrontWebDistribution(Construct scope, string id, ICloudFrontWebDistributionProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props ICloudFrontWebDistributionProps
Remarks
Stability: Deprecated
Properties
DistributionDomainName
(deprecated) The domain name created by CloudFront for this distribution.
public virtual string DistributionDomainName { get; }
Property Value
System.String
Remarks
If you are using aliases for your distribution, this is the domainName your DNS records should point to. (In Route53, you could create an ALIAS record to this value, for example.)
Stability: Deprecated
DistributionId
(deprecated) The distribution ID for this distribution.
public virtual string DistributionId { get; }
Property Value
System.String
Remarks
Stability: Deprecated
LoggingBucket
(deprecated) The logging bucket for this CloudFront distribution.
public virtual IBucket LoggingBucket { get; }
Property Value
Remarks
If logging is not enabled for this distribution - this property will be undefined.
Stability: Deprecated
Methods
FromDistributionAttributes(Construct, String, ICloudFrontWebDistributionAttributes)
(deprecated) Creates a construct that represents an external (imported) distribution.
public static IDistribution FromDistributionAttributes(Construct scope, string id, ICloudFrontWebDistributionAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs ICloudFrontWebDistributionAttributes
Returns
Remarks
Stability: Deprecated
Grant(IGrantable, String[])
(deprecated) Adds an IAM policy statement associated with this distribution to an IAM principal's policy.
public virtual Grant Grant(IGrantable identity, params string[] actions)
Parameters
- identity IGrantable
The principal.
- actions System.String[]
The set of actions to allow (i.e. "cloudfront:ListInvalidations").
Returns
Remarks
Stability: Deprecated
GrantCreateInvalidation(IGrantable)
(deprecated) Grant to create invalidations for this bucket to an IAM principal (Role/Group/User).
public virtual Grant GrantCreateInvalidation(IGrantable identity)
Parameters
- identity IGrantable
The principal.
Returns
Remarks
Stability: Deprecated