Show / Hide Table of Contents

Class Cdn

Provides a DigitalOcean CDN Endpoint resource for use with Spaces.

Example Usage

Basic Example

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
public MyStack()
{
    // Create a new Spaces Bucket
    var mybucket = new DigitalOcean.SpacesBucket("mybucket", new DigitalOcean.SpacesBucketArgs
    {
        Region = "sfo2",
        Acl = "public-read",
    });
    // Add a CDN endpoint to the Spaces Bucket
    var mycdn = new DigitalOcean.Cdn("mycdn", new DigitalOcean.CdnArgs
    {
        Origin = mybucket.BucketDomainName,
    });
    this.Fqdn = mycdn.Endpoint;
}

[Output("fqdn")]
public Output<string> Fqdn { get; set; }
}

Custom Sub-Domain Example

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
public MyStack()
{
    // Create a new Spaces Bucket
    var mybucket = new DigitalOcean.SpacesBucket("mybucket", new DigitalOcean.SpacesBucketArgs
    {
        Region = "sfo2",
        Acl = "public-read",
    });
    // Create a DigitalOcean managed Let's Encrypt Certificate
    var cert = new DigitalOcean.Certificate("cert", new DigitalOcean.CertificateArgs
    {
        Type = "lets_encrypt",
        Domains = 
        {
            "static.example.com",
        },
    });
    // Add a CDN endpoint with a custom sub-domain to the Spaces Bucket
    var mycdn = new DigitalOcean.Cdn("mycdn", new DigitalOcean.CdnArgs
    {
        Origin = mybucket.BucketDomainName,
        CustomDomain = "static.example.com",
        CertificateId = cert.Id,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Cdn
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.DigitalOcean
Assembly: Pulumi.DigitalOcean.dll
Syntax
public class Cdn : CustomResource

Constructors

View Source

Cdn(String, CdnArgs, CustomResourceOptions)

Create a Cdn resource with the given unique name, arguments, and options.

Declaration
public Cdn(string name, CdnArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

CdnArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

CertificateId

The ID of a DigitalOcean managed TLS certificate used for SSL when a custom subdomain is provided.

Declaration
public Output<string> CertificateId { get; }
Property Value
Type Description
Output<System.String>
View Source

CreatedAt

The date and time when the CDN Endpoint was created.

Declaration
public Output<string> CreatedAt { get; }
Property Value
Type Description
Output<System.String>
View Source

CustomDomain

The fully qualified domain name (FQDN) of the custom subdomain used with the CDN Endpoint.

Declaration
public Output<string> CustomDomain { get; }
Property Value
Type Description
Output<System.String>
View Source

Endpoint

The fully qualified domain name (FQDN) from which the CDN-backed content is served.

Declaration
public Output<string> Endpoint { get; }
Property Value
Type Description
Output<System.String>
View Source

Origin

The fully qualified domain name, (FQDN) for a Space.

Declaration
public Output<string> Origin { get; }
Property Value
Type Description
Output<System.String>
View Source

Ttl

The time to live for the CDN Endpoint, in seconds. Default is 3600 seconds.

Declaration
public Output<int> Ttl { get; }
Property Value
Type Description
Output<System.Int32>

Methods

View Source

Get(String, Input<String>, CdnState, CustomResourceOptions)

Get an existing Cdn resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static Cdn Get(string name, Input<string> id, CdnState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

CdnState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Cdn
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.