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,
});
}
}
Inherited Members
Namespace: Pulumi.DigitalOcean
Assembly: Pulumi.DigitalOcean.dll
Syntax
public class Cdn : CustomResource
Constructors
View SourceCdn(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 SourceCertificateId
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> |
CreatedAt
The date and time when the CDN Endpoint was created.
Declaration
public Output<string> CreatedAt { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
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> |
Origin
The fully qualified domain name, (FQDN) for a Space.
Declaration
public Output<string> Origin { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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 SourceGet(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 |