1. Packages
  2. Ionoscloud Provider
  3. API Docs
  4. CdnDistribution
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

ionoscloud.CdnDistribution

Explore with Pulumi AI

ionoscloud logo
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

    Manages a CDN Distribution on IonosCloud.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as fs from "fs";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    //optionally you can add a certificate to the distribution
    const cert = new ionoscloud.Certificate("cert", {
        certificate: fs.readFileSync("path_to_cert", "utf8"),
        certificateChain: fs.readFileSync("path_to_cert_chain", "utf8"),
        privateKey: fs.readFileSync("path_to_private_key", "utf8"),
    });
    const example = new ionoscloud.CdnDistribution("example", {
        domain: "example.com",
        certificateId: cert.certificateId,
        routingRules: [
            {
                scheme: "https",
                prefix: "/api",
                upstream: {
                    host: "server.example.com",
                    caching: true,
                    waf: true,
                    sniMode: "distribution",
                    rateLimitClass: "R500",
                    geoRestrictions: {
                        allowLists: [
                            "CN",
                            "RU",
                        ],
                    },
                },
            },
            {
                scheme: "http/https",
                prefix: "/api2",
                upstream: {
                    host: "server2.example.com",
                    caching: false,
                    waf: false,
                    sniMode: "origin",
                    rateLimitClass: "R10",
                    geoRestrictions: {
                        blockLists: [
                            "CN",
                            "RU",
                        ],
                    },
                },
            },
        ],
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    #optionally you can add a certificate to the distribution
    cert = ionoscloud.Certificate("cert",
        certificate=(lambda path: open(path).read())("path_to_cert"),
        certificate_chain=(lambda path: open(path).read())("path_to_cert_chain"),
        private_key=(lambda path: open(path).read())("path_to_private_key"))
    example = ionoscloud.CdnDistribution("example",
        domain="example.com",
        certificate_id=cert.certificate_id,
        routing_rules=[
            {
                "scheme": "https",
                "prefix": "/api",
                "upstream": {
                    "host": "server.example.com",
                    "caching": True,
                    "waf": True,
                    "sni_mode": "distribution",
                    "rate_limit_class": "R500",
                    "geo_restrictions": {
                        "allow_lists": [
                            "CN",
                            "RU",
                        ],
                    },
                },
            },
            {
                "scheme": "http/https",
                "prefix": "/api2",
                "upstream": {
                    "host": "server2.example.com",
                    "caching": False,
                    "waf": False,
                    "sni_mode": "origin",
                    "rate_limit_class": "R10",
                    "geo_restrictions": {
                        "block_lists": [
                            "CN",
                            "RU",
                        ],
                    },
                },
            },
        ])
    
    package main
    
    import (
    	"os"
    
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func readFileOrPanic(path string) pulumi.StringPtrInput {
    	data, err := os.ReadFile(path)
    	if err != nil {
    		panic(err.Error())
    	}
    	return pulumi.String(string(data))
    }
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// optionally you can add a certificate to the distribution
    		cert, err := ionoscloud.NewCertificate(ctx, "cert", &ionoscloud.CertificateArgs{
    			Certificate:      pulumi.String(readFileOrPanic("path_to_cert")),
    			CertificateChain: pulumi.String(readFileOrPanic("path_to_cert_chain")),
    			PrivateKey:       pulumi.String(readFileOrPanic("path_to_private_key")),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ionoscloud.NewCdnDistribution(ctx, "example", &ionoscloud.CdnDistributionArgs{
    			Domain:        pulumi.String("example.com"),
    			CertificateId: cert.CertificateId,
    			RoutingRules: ionoscloud.CdnDistributionRoutingRuleArray{
    				&ionoscloud.CdnDistributionRoutingRuleArgs{
    					Scheme: pulumi.String("https"),
    					Prefix: pulumi.String("/api"),
    					Upstream: &ionoscloud.CdnDistributionRoutingRuleUpstreamArgs{
    						Host:           pulumi.String("server.example.com"),
    						Caching:        pulumi.Bool(true),
    						Waf:            pulumi.Bool(true),
    						SniMode:        pulumi.String("distribution"),
    						RateLimitClass: pulumi.String("R500"),
    						GeoRestrictions: &ionoscloud.CdnDistributionRoutingRuleUpstreamGeoRestrictionsArgs{
    							AllowLists: pulumi.StringArray{
    								pulumi.String("CN"),
    								pulumi.String("RU"),
    							},
    						},
    					},
    				},
    				&ionoscloud.CdnDistributionRoutingRuleArgs{
    					Scheme: pulumi.String("http/https"),
    					Prefix: pulumi.String("/api2"),
    					Upstream: &ionoscloud.CdnDistributionRoutingRuleUpstreamArgs{
    						Host:           pulumi.String("server2.example.com"),
    						Caching:        pulumi.Bool(false),
    						Waf:            pulumi.Bool(false),
    						SniMode:        pulumi.String("origin"),
    						RateLimitClass: pulumi.String("R10"),
    						GeoRestrictions: &ionoscloud.CdnDistributionRoutingRuleUpstreamGeoRestrictionsArgs{
    							BlockLists: pulumi.StringArray{
    								pulumi.String("CN"),
    								pulumi.String("RU"),
    							},
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        //optionally you can add a certificate to the distribution
        var cert = new Ionoscloud.Certificate("cert", new()
        {
            Certificate = File.ReadAllText("path_to_cert"),
            CertificateChain = File.ReadAllText("path_to_cert_chain"),
            PrivateKey = File.ReadAllText("path_to_private_key"),
        });
    
        var example = new Ionoscloud.CdnDistribution("example", new()
        {
            Domain = "example.com",
            CertificateId = cert.CertificateId,
            RoutingRules = new[]
            {
                new Ionoscloud.Inputs.CdnDistributionRoutingRuleArgs
                {
                    Scheme = "https",
                    Prefix = "/api",
                    Upstream = new Ionoscloud.Inputs.CdnDistributionRoutingRuleUpstreamArgs
                    {
                        Host = "server.example.com",
                        Caching = true,
                        Waf = true,
                        SniMode = "distribution",
                        RateLimitClass = "R500",
                        GeoRestrictions = new Ionoscloud.Inputs.CdnDistributionRoutingRuleUpstreamGeoRestrictionsArgs
                        {
                            AllowLists = new[]
                            {
                                "CN",
                                "RU",
                            },
                        },
                    },
                },
                new Ionoscloud.Inputs.CdnDistributionRoutingRuleArgs
                {
                    Scheme = "http/https",
                    Prefix = "/api2",
                    Upstream = new Ionoscloud.Inputs.CdnDistributionRoutingRuleUpstreamArgs
                    {
                        Host = "server2.example.com",
                        Caching = false,
                        Waf = false,
                        SniMode = "origin",
                        RateLimitClass = "R10",
                        GeoRestrictions = new Ionoscloud.Inputs.CdnDistributionRoutingRuleUpstreamGeoRestrictionsArgs
                        {
                            BlockLists = new[]
                            {
                                "CN",
                                "RU",
                            },
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.Certificate;
    import com.pulumi.ionoscloud.CertificateArgs;
    import com.pulumi.ionoscloud.CdnDistribution;
    import com.pulumi.ionoscloud.CdnDistributionArgs;
    import com.pulumi.ionoscloud.inputs.CdnDistributionRoutingRuleArgs;
    import com.pulumi.ionoscloud.inputs.CdnDistributionRoutingRuleUpstreamArgs;
    import com.pulumi.ionoscloud.inputs.CdnDistributionRoutingRuleUpstreamGeoRestrictionsArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            //optionally you can add a certificate to the distribution
            var cert = new Certificate("cert", CertificateArgs.builder()
                .certificate(Files.readString(Paths.get("path_to_cert")))
                .certificateChain(Files.readString(Paths.get("path_to_cert_chain")))
                .privateKey(Files.readString(Paths.get("path_to_private_key")))
                .build());
    
            var example = new CdnDistribution("example", CdnDistributionArgs.builder()
                .domain("example.com")
                .certificateId(cert.certificateId())
                .routingRules(            
                    CdnDistributionRoutingRuleArgs.builder()
                        .scheme("https")
                        .prefix("/api")
                        .upstream(CdnDistributionRoutingRuleUpstreamArgs.builder()
                            .host("server.example.com")
                            .caching(true)
                            .waf(true)
                            .sniMode("distribution")
                            .rateLimitClass("R500")
                            .geoRestrictions(CdnDistributionRoutingRuleUpstreamGeoRestrictionsArgs.builder()
                                .allowLists(                            
                                    "CN",
                                    "RU")
                                .build())
                            .build())
                        .build(),
                    CdnDistributionRoutingRuleArgs.builder()
                        .scheme("http/https")
                        .prefix("/api2")
                        .upstream(CdnDistributionRoutingRuleUpstreamArgs.builder()
                            .host("server2.example.com")
                            .caching(false)
                            .waf(false)
                            .sniMode("origin")
                            .rateLimitClass("R10")
                            .geoRestrictions(CdnDistributionRoutingRuleUpstreamGeoRestrictionsArgs.builder()
                                .blockLists(                            
                                    "CN",
                                    "RU")
                                .build())
                            .build())
                        .build())
                .build());
    
        }
    }
    
    resources:
      example:
        type: ionoscloud:CdnDistribution
        properties:
          domain: example.com
          certificateId: ${cert.certificateId}
          routingRules:
            - scheme: https
              prefix: /api
              upstream:
                host: server.example.com
                caching: true
                waf: true
                sniMode: distribution
                rateLimitClass: R500
                geoRestrictions:
                  allowLists:
                    - CN
                    - RU
            - scheme: http/https
              prefix: /api2
              upstream:
                host: server2.example.com
                caching: false
                waf: false
                sniMode: origin
                rateLimitClass: R10
                geoRestrictions:
                  blockLists:
                    - CN
                    - RU
      #optionally you can add a certificate to the distribution
      cert:
        type: ionoscloud:Certificate
        properties:
          certificate:
            fn::readFile: path_to_cert
          certificateChain:
            fn::readFile: path_to_cert_chain
          privateKey:
            fn::readFile: path_to_private_key
    

    Create CdnDistribution Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CdnDistribution(name: string, args: CdnDistributionArgs, opts?: CustomResourceOptions);
    @overload
    def CdnDistribution(resource_name: str,
                        args: CdnDistributionArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def CdnDistribution(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        domain: Optional[str] = None,
                        routing_rules: Optional[Sequence[CdnDistributionRoutingRuleArgs]] = None,
                        cdn_distribution_id: Optional[str] = None,
                        certificate_id: Optional[str] = None,
                        timeouts: Optional[CdnDistributionTimeoutsArgs] = None)
    func NewCdnDistribution(ctx *Context, name string, args CdnDistributionArgs, opts ...ResourceOption) (*CdnDistribution, error)
    public CdnDistribution(string name, CdnDistributionArgs args, CustomResourceOptions? opts = null)
    public CdnDistribution(String name, CdnDistributionArgs args)
    public CdnDistribution(String name, CdnDistributionArgs args, CustomResourceOptions options)
    
    type: ionoscloud:CdnDistribution
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CdnDistributionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args CdnDistributionArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args CdnDistributionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CdnDistributionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CdnDistributionArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var cdnDistributionResource = new Ionoscloud.CdnDistribution("cdnDistributionResource", new()
    {
        Domain = "string",
        RoutingRules = new[]
        {
            new Ionoscloud.Inputs.CdnDistributionRoutingRuleArgs
            {
                Prefix = "string",
                Scheme = "string",
                Upstream = new Ionoscloud.Inputs.CdnDistributionRoutingRuleUpstreamArgs
                {
                    Caching = false,
                    Host = "string",
                    RateLimitClass = "string",
                    SniMode = "string",
                    Waf = false,
                    GeoRestrictions = new Ionoscloud.Inputs.CdnDistributionRoutingRuleUpstreamGeoRestrictionsArgs
                    {
                        AllowLists = new[]
                        {
                            "string",
                        },
                        BlockLists = new[]
                        {
                            "string",
                        },
                    },
                },
            },
        },
        CdnDistributionId = "string",
        CertificateId = "string",
        Timeouts = new Ionoscloud.Inputs.CdnDistributionTimeoutsArgs
        {
            Create = "string",
            Default = "string",
            Delete = "string",
            Update = "string",
        },
    });
    
    example, err := ionoscloud.NewCdnDistribution(ctx, "cdnDistributionResource", &ionoscloud.CdnDistributionArgs{
    	Domain: pulumi.String("string"),
    	RoutingRules: ionoscloud.CdnDistributionRoutingRuleArray{
    		&ionoscloud.CdnDistributionRoutingRuleArgs{
    			Prefix: pulumi.String("string"),
    			Scheme: pulumi.String("string"),
    			Upstream: &ionoscloud.CdnDistributionRoutingRuleUpstreamArgs{
    				Caching:        pulumi.Bool(false),
    				Host:           pulumi.String("string"),
    				RateLimitClass: pulumi.String("string"),
    				SniMode:        pulumi.String("string"),
    				Waf:            pulumi.Bool(false),
    				GeoRestrictions: &ionoscloud.CdnDistributionRoutingRuleUpstreamGeoRestrictionsArgs{
    					AllowLists: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    					BlockLists: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    				},
    			},
    		},
    	},
    	CdnDistributionId: pulumi.String("string"),
    	CertificateId:     pulumi.String("string"),
    	Timeouts: &ionoscloud.CdnDistributionTimeoutsArgs{
    		Create:  pulumi.String("string"),
    		Default: pulumi.String("string"),
    		Delete:  pulumi.String("string"),
    		Update:  pulumi.String("string"),
    	},
    })
    
    var cdnDistributionResource = new CdnDistribution("cdnDistributionResource", CdnDistributionArgs.builder()
        .domain("string")
        .routingRules(CdnDistributionRoutingRuleArgs.builder()
            .prefix("string")
            .scheme("string")
            .upstream(CdnDistributionRoutingRuleUpstreamArgs.builder()
                .caching(false)
                .host("string")
                .rateLimitClass("string")
                .sniMode("string")
                .waf(false)
                .geoRestrictions(CdnDistributionRoutingRuleUpstreamGeoRestrictionsArgs.builder()
                    .allowLists("string")
                    .blockLists("string")
                    .build())
                .build())
            .build())
        .cdnDistributionId("string")
        .certificateId("string")
        .timeouts(CdnDistributionTimeoutsArgs.builder()
            .create("string")
            .default_("string")
            .delete("string")
            .update("string")
            .build())
        .build());
    
    cdn_distribution_resource = ionoscloud.CdnDistribution("cdnDistributionResource",
        domain="string",
        routing_rules=[{
            "prefix": "string",
            "scheme": "string",
            "upstream": {
                "caching": False,
                "host": "string",
                "rate_limit_class": "string",
                "sni_mode": "string",
                "waf": False,
                "geo_restrictions": {
                    "allow_lists": ["string"],
                    "block_lists": ["string"],
                },
            },
        }],
        cdn_distribution_id="string",
        certificate_id="string",
        timeouts={
            "create": "string",
            "default": "string",
            "delete": "string",
            "update": "string",
        })
    
    const cdnDistributionResource = new ionoscloud.CdnDistribution("cdnDistributionResource", {
        domain: "string",
        routingRules: [{
            prefix: "string",
            scheme: "string",
            upstream: {
                caching: false,
                host: "string",
                rateLimitClass: "string",
                sniMode: "string",
                waf: false,
                geoRestrictions: {
                    allowLists: ["string"],
                    blockLists: ["string"],
                },
            },
        }],
        cdnDistributionId: "string",
        certificateId: "string",
        timeouts: {
            create: "string",
            "default": "string",
            "delete": "string",
            update: "string",
        },
    });
    
    type: ionoscloud:CdnDistribution
    properties:
        cdnDistributionId: string
        certificateId: string
        domain: string
        routingRules:
            - prefix: string
              scheme: string
              upstream:
                caching: false
                geoRestrictions:
                    allowLists:
                        - string
                    blockLists:
                        - string
                host: string
                rateLimitClass: string
                sniMode: string
                waf: false
        timeouts:
            create: string
            default: string
            delete: string
            update: string
    

    CdnDistribution Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The CdnDistribution resource accepts the following input properties:

    Domain string
    [string] The domain of the distribution.
    RoutingRules List<CdnDistributionRoutingRule>
    [list] The routing rules for the distribution.
    CdnDistributionId string
    CertificateId string
    [string] The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    Timeouts CdnDistributionTimeouts
    Domain string
    [string] The domain of the distribution.
    RoutingRules []CdnDistributionRoutingRuleArgs
    [list] The routing rules for the distribution.
    CdnDistributionId string
    CertificateId string
    [string] The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    Timeouts CdnDistributionTimeoutsArgs
    domain String
    [string] The domain of the distribution.
    routingRules List<CdnDistributionRoutingRule>
    [list] The routing rules for the distribution.
    cdnDistributionId String
    certificateId String
    [string] The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    timeouts CdnDistributionTimeouts
    domain string
    [string] The domain of the distribution.
    routingRules CdnDistributionRoutingRule[]
    [list] The routing rules for the distribution.
    cdnDistributionId string
    certificateId string
    [string] The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    timeouts CdnDistributionTimeouts
    domain str
    [string] The domain of the distribution.
    routing_rules Sequence[CdnDistributionRoutingRuleArgs]
    [list] The routing rules for the distribution.
    cdn_distribution_id str
    certificate_id str
    [string] The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    timeouts CdnDistributionTimeoutsArgs
    domain String
    [string] The domain of the distribution.
    routingRules List<Property Map>
    [list] The routing rules for the distribution.
    cdnDistributionId String
    certificateId String
    [string] The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    timeouts Property Map

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CdnDistribution resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    PublicEndpointV4 string
    IP of the distribution, it has to be included on the domain DNS Zone as A record.
    PublicEndpointV6 string
    IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
    ResourceUrn string
    Unique resource indentifier.
    Id string
    The provider-assigned unique ID for this managed resource.
    PublicEndpointV4 string
    IP of the distribution, it has to be included on the domain DNS Zone as A record.
    PublicEndpointV6 string
    IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
    ResourceUrn string
    Unique resource indentifier.
    id String
    The provider-assigned unique ID for this managed resource.
    publicEndpointV4 String
    IP of the distribution, it has to be included on the domain DNS Zone as A record.
    publicEndpointV6 String
    IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
    resourceUrn String
    Unique resource indentifier.
    id string
    The provider-assigned unique ID for this managed resource.
    publicEndpointV4 string
    IP of the distribution, it has to be included on the domain DNS Zone as A record.
    publicEndpointV6 string
    IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
    resourceUrn string
    Unique resource indentifier.
    id str
    The provider-assigned unique ID for this managed resource.
    public_endpoint_v4 str
    IP of the distribution, it has to be included on the domain DNS Zone as A record.
    public_endpoint_v6 str
    IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
    resource_urn str
    Unique resource indentifier.
    id String
    The provider-assigned unique ID for this managed resource.
    publicEndpointV4 String
    IP of the distribution, it has to be included on the domain DNS Zone as A record.
    publicEndpointV6 String
    IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
    resourceUrn String
    Unique resource indentifier.

    Look up Existing CdnDistribution Resource

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

    public static get(name: string, id: Input<ID>, state?: CdnDistributionState, opts?: CustomResourceOptions): CdnDistribution
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cdn_distribution_id: Optional[str] = None,
            certificate_id: Optional[str] = None,
            domain: Optional[str] = None,
            public_endpoint_v4: Optional[str] = None,
            public_endpoint_v6: Optional[str] = None,
            resource_urn: Optional[str] = None,
            routing_rules: Optional[Sequence[CdnDistributionRoutingRuleArgs]] = None,
            timeouts: Optional[CdnDistributionTimeoutsArgs] = None) -> CdnDistribution
    func GetCdnDistribution(ctx *Context, name string, id IDInput, state *CdnDistributionState, opts ...ResourceOption) (*CdnDistribution, error)
    public static CdnDistribution Get(string name, Input<string> id, CdnDistributionState? state, CustomResourceOptions? opts = null)
    public static CdnDistribution get(String name, Output<String> id, CdnDistributionState state, CustomResourceOptions options)
    resources:  _:    type: ionoscloud:CdnDistribution    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CdnDistributionId string
    CertificateId string
    [string] The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    Domain string
    [string] The domain of the distribution.
    PublicEndpointV4 string
    IP of the distribution, it has to be included on the domain DNS Zone as A record.
    PublicEndpointV6 string
    IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
    ResourceUrn string
    Unique resource indentifier.
    RoutingRules List<CdnDistributionRoutingRule>
    [list] The routing rules for the distribution.
    Timeouts CdnDistributionTimeouts
    CdnDistributionId string
    CertificateId string
    [string] The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    Domain string
    [string] The domain of the distribution.
    PublicEndpointV4 string
    IP of the distribution, it has to be included on the domain DNS Zone as A record.
    PublicEndpointV6 string
    IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
    ResourceUrn string
    Unique resource indentifier.
    RoutingRules []CdnDistributionRoutingRuleArgs
    [list] The routing rules for the distribution.
    Timeouts CdnDistributionTimeoutsArgs
    cdnDistributionId String
    certificateId String
    [string] The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    domain String
    [string] The domain of the distribution.
    publicEndpointV4 String
    IP of the distribution, it has to be included on the domain DNS Zone as A record.
    publicEndpointV6 String
    IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
    resourceUrn String
    Unique resource indentifier.
    routingRules List<CdnDistributionRoutingRule>
    [list] The routing rules for the distribution.
    timeouts CdnDistributionTimeouts
    cdnDistributionId string
    certificateId string
    [string] The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    domain string
    [string] The domain of the distribution.
    publicEndpointV4 string
    IP of the distribution, it has to be included on the domain DNS Zone as A record.
    publicEndpointV6 string
    IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
    resourceUrn string
    Unique resource indentifier.
    routingRules CdnDistributionRoutingRule[]
    [list] The routing rules for the distribution.
    timeouts CdnDistributionTimeouts
    cdn_distribution_id str
    certificate_id str
    [string] The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    domain str
    [string] The domain of the distribution.
    public_endpoint_v4 str
    IP of the distribution, it has to be included on the domain DNS Zone as A record.
    public_endpoint_v6 str
    IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
    resource_urn str
    Unique resource indentifier.
    routing_rules Sequence[CdnDistributionRoutingRuleArgs]
    [list] The routing rules for the distribution.
    timeouts CdnDistributionTimeoutsArgs
    cdnDistributionId String
    certificateId String
    [string] The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    domain String
    [string] The domain of the distribution.
    publicEndpointV4 String
    IP of the distribution, it has to be included on the domain DNS Zone as A record.
    publicEndpointV6 String
    IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
    resourceUrn String
    Unique resource indentifier.
    routingRules List<Property Map>
    [list] The routing rules for the distribution.
    timeouts Property Map

    Supporting Types

    CdnDistributionRoutingRule, CdnDistributionRoutingRuleArgs

    Prefix string
    [string] The prefix of the routing rule.
    Scheme string
    [string] The scheme of the routing rule.
    Upstream CdnDistributionRoutingRuleUpstream
    [map] - A map of properties for the rule
    Prefix string
    [string] The prefix of the routing rule.
    Scheme string
    [string] The scheme of the routing rule.
    Upstream CdnDistributionRoutingRuleUpstream
    [map] - A map of properties for the rule
    prefix String
    [string] The prefix of the routing rule.
    scheme String
    [string] The scheme of the routing rule.
    upstream CdnDistributionRoutingRuleUpstream
    [map] - A map of properties for the rule
    prefix string
    [string] The prefix of the routing rule.
    scheme string
    [string] The scheme of the routing rule.
    upstream CdnDistributionRoutingRuleUpstream
    [map] - A map of properties for the rule
    prefix str
    [string] The prefix of the routing rule.
    scheme str
    [string] The scheme of the routing rule.
    upstream CdnDistributionRoutingRuleUpstream
    [map] - A map of properties for the rule
    prefix String
    [string] The prefix of the routing rule.
    scheme String
    [string] The scheme of the routing rule.
    upstream Property Map
    [map] - A map of properties for the rule

    CdnDistributionRoutingRuleUpstream, CdnDistributionRoutingRuleUpstreamArgs

    Caching bool
    [bool] Enable or disable caching. If enabled, the CDN will cache the responses from the upstream host. Subsequent requests for the same resource will be served from the cache.
    Host string
    [string] The upstream host that handles the requests if not already cached. This host will be protected by the WAF if the option is enabled.
    RateLimitClass string
    [string] Rate limit class that will be applied to limit the number of incoming requests per IP.
    SniMode string
    [string] The SNI (Server Name Indication) mode of the upstream. It supports two modes: 1) distribution: for outgoing connections to the upstream host, the CDN requires the upstream host to present a valid certificate that matches the configured domain of the CDN distribution; 2) origin: for outgoing connections to the upstream host, the CDN requires the upstream host to present a valid certificate that matches the configured upstream/origin hostname.
    Waf bool
    [bool] Enable or disable WAF to protect the upstream host.
    GeoRestrictions CdnDistributionRoutingRuleUpstreamGeoRestrictions
    [map] - A map of geo_restrictions
    Caching bool
    [bool] Enable or disable caching. If enabled, the CDN will cache the responses from the upstream host. Subsequent requests for the same resource will be served from the cache.
    Host string
    [string] The upstream host that handles the requests if not already cached. This host will be protected by the WAF if the option is enabled.
    RateLimitClass string
    [string] Rate limit class that will be applied to limit the number of incoming requests per IP.
    SniMode string
    [string] The SNI (Server Name Indication) mode of the upstream. It supports two modes: 1) distribution: for outgoing connections to the upstream host, the CDN requires the upstream host to present a valid certificate that matches the configured domain of the CDN distribution; 2) origin: for outgoing connections to the upstream host, the CDN requires the upstream host to present a valid certificate that matches the configured upstream/origin hostname.
    Waf bool
    [bool] Enable or disable WAF to protect the upstream host.
    GeoRestrictions CdnDistributionRoutingRuleUpstreamGeoRestrictions
    [map] - A map of geo_restrictions
    caching Boolean
    [bool] Enable or disable caching. If enabled, the CDN will cache the responses from the upstream host. Subsequent requests for the same resource will be served from the cache.
    host String
    [string] The upstream host that handles the requests if not already cached. This host will be protected by the WAF if the option is enabled.
    rateLimitClass String
    [string] Rate limit class that will be applied to limit the number of incoming requests per IP.
    sniMode String
    [string] The SNI (Server Name Indication) mode of the upstream. It supports two modes: 1) distribution: for outgoing connections to the upstream host, the CDN requires the upstream host to present a valid certificate that matches the configured domain of the CDN distribution; 2) origin: for outgoing connections to the upstream host, the CDN requires the upstream host to present a valid certificate that matches the configured upstream/origin hostname.
    waf Boolean
    [bool] Enable or disable WAF to protect the upstream host.
    geoRestrictions CdnDistributionRoutingRuleUpstreamGeoRestrictions
    [map] - A map of geo_restrictions
    caching boolean
    [bool] Enable or disable caching. If enabled, the CDN will cache the responses from the upstream host. Subsequent requests for the same resource will be served from the cache.
    host string
    [string] The upstream host that handles the requests if not already cached. This host will be protected by the WAF if the option is enabled.
    rateLimitClass string
    [string] Rate limit class that will be applied to limit the number of incoming requests per IP.
    sniMode string
    [string] The SNI (Server Name Indication) mode of the upstream. It supports two modes: 1) distribution: for outgoing connections to the upstream host, the CDN requires the upstream host to present a valid certificate that matches the configured domain of the CDN distribution; 2) origin: for outgoing connections to the upstream host, the CDN requires the upstream host to present a valid certificate that matches the configured upstream/origin hostname.
    waf boolean
    [bool] Enable or disable WAF to protect the upstream host.
    geoRestrictions CdnDistributionRoutingRuleUpstreamGeoRestrictions
    [map] - A map of geo_restrictions
    caching bool
    [bool] Enable or disable caching. If enabled, the CDN will cache the responses from the upstream host. Subsequent requests for the same resource will be served from the cache.
    host str
    [string] The upstream host that handles the requests if not already cached. This host will be protected by the WAF if the option is enabled.
    rate_limit_class str
    [string] Rate limit class that will be applied to limit the number of incoming requests per IP.
    sni_mode str
    [string] The SNI (Server Name Indication) mode of the upstream. It supports two modes: 1) distribution: for outgoing connections to the upstream host, the CDN requires the upstream host to present a valid certificate that matches the configured domain of the CDN distribution; 2) origin: for outgoing connections to the upstream host, the CDN requires the upstream host to present a valid certificate that matches the configured upstream/origin hostname.
    waf bool
    [bool] Enable or disable WAF to protect the upstream host.
    geo_restrictions CdnDistributionRoutingRuleUpstreamGeoRestrictions
    [map] - A map of geo_restrictions
    caching Boolean
    [bool] Enable or disable caching. If enabled, the CDN will cache the responses from the upstream host. Subsequent requests for the same resource will be served from the cache.
    host String
    [string] The upstream host that handles the requests if not already cached. This host will be protected by the WAF if the option is enabled.
    rateLimitClass String
    [string] Rate limit class that will be applied to limit the number of incoming requests per IP.
    sniMode String
    [string] The SNI (Server Name Indication) mode of the upstream. It supports two modes: 1) distribution: for outgoing connections to the upstream host, the CDN requires the upstream host to present a valid certificate that matches the configured domain of the CDN distribution; 2) origin: for outgoing connections to the upstream host, the CDN requires the upstream host to present a valid certificate that matches the configured upstream/origin hostname.
    waf Boolean
    [bool] Enable or disable WAF to protect the upstream host.
    geoRestrictions Property Map
    [map] - A map of geo_restrictions

    CdnDistributionRoutingRuleUpstreamGeoRestrictions, CdnDistributionRoutingRuleUpstreamGeoRestrictionsArgs

    AllowLists List<string>
    [string] List of allowed countries
    BlockLists List<string>
    [string] List of blocked countries
    AllowLists []string
    [string] List of allowed countries
    BlockLists []string
    [string] List of blocked countries
    allowLists List<String>
    [string] List of allowed countries
    blockLists List<String>
    [string] List of blocked countries
    allowLists string[]
    [string] List of allowed countries
    blockLists string[]
    [string] List of blocked countries
    allow_lists Sequence[str]
    [string] List of allowed countries
    block_lists Sequence[str]
    [string] List of blocked countries
    allowLists List<String>
    [string] List of allowed countries
    blockLists List<String>
    [string] List of blocked countries

    CdnDistributionTimeouts, CdnDistributionTimeoutsArgs

    Create string
    Default string
    Delete string
    Update string
    Create string
    Default string
    Delete string
    Update string
    create String
    default_ String
    delete String
    update String
    create string
    default string
    delete string
    update string
    create String
    default String
    delete String
    update String

    Import

    Resource Distribution can be imported using the resource id, e.g.

    $ pulumi import ionoscloud:index/cdnDistribution:CdnDistribution myDistribution distribution uuid
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    ionoscloud ionos-cloud/terraform-provider-ionoscloud
    License
    Notes
    This Pulumi package is based on the ionoscloud Terraform Provider.
    ionoscloud logo
    ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud