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

ionoscloud.getCdnDistribution

Explore with Pulumi AI

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

    The Distribution data source can be used to search for and return an existing Distributions. You can provide a string for the domain parameter which will be compared with provisioned Distributions. If a single match is found, it will be returned. If your search results in multiple matches, an error will be returned. When this happens, please refine your search and make sure that your resources have unique domains.

    Example Usage

    By Id

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.getCdnDistribution({
        id: "distr_id",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.get_cdn_distribution(id="distr_id")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.LookupCdnDistribution(ctx, &ionoscloud.LookupCdnDistributionArgs{
    			Id: pulumi.StringRef("distr_id"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ionoscloud.GetCdnDistribution.Invoke(new()
        {
            Id = "distr_id",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.IonoscloudFunctions;
    import com.pulumi.ionoscloud.inputs.GetCdnDistributionArgs;
    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) {
            final var example = IonoscloudFunctions.getCdnDistribution(GetCdnDistributionArgs.builder()
                .id("distr_id")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:getCdnDistribution
          arguments:
            id: distr_id
    

    By Domain

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.getCdnDistribution({
        domain: "example.com",
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.get_cdn_distribution(domain="example.com")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.LookupCdnDistribution(ctx, &ionoscloud.LookupCdnDistributionArgs{
    			Domain: pulumi.StringRef("example.com"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ionoscloud.GetCdnDistribution.Invoke(new()
        {
            Domain = "example.com",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.IonoscloudFunctions;
    import com.pulumi.ionoscloud.inputs.GetCdnDistributionArgs;
    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) {
            final var example = IonoscloudFunctions.getCdnDistribution(GetCdnDistributionArgs.builder()
                .domain("example.com")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:getCdnDistribution
          arguments:
            domain: example.com
    

    By Domain with Partial Match

    import * as pulumi from "@pulumi/pulumi";
    import * as ionoscloud from "@pulumi/ionoscloud";
    
    const example = ionoscloud.getCdnDistribution({
        domain: "example",
        partialMatch: true,
    });
    
    import pulumi
    import pulumi_ionoscloud as ionoscloud
    
    example = ionoscloud.get_cdn_distribution(domain="example",
        partial_match=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ionoscloud/v6/ionoscloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ionoscloud.LookupCdnDistribution(ctx, &ionoscloud.LookupCdnDistributionArgs{
    			Domain:       pulumi.StringRef("example"),
    			PartialMatch: pulumi.BoolRef(true),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ionoscloud = Pulumi.Ionoscloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Ionoscloud.GetCdnDistribution.Invoke(new()
        {
            Domain = "example",
            PartialMatch = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ionoscloud.IonoscloudFunctions;
    import com.pulumi.ionoscloud.inputs.GetCdnDistributionArgs;
    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) {
            final var example = IonoscloudFunctions.getCdnDistribution(GetCdnDistributionArgs.builder()
                .domain("example")
                .partialMatch(true)
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: ionoscloud:getCdnDistribution
          arguments:
            domain: example
            partialMatch: true
    

    Using getCdnDistribution

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getCdnDistribution(args: GetCdnDistributionArgs, opts?: InvokeOptions): Promise<GetCdnDistributionResult>
    function getCdnDistributionOutput(args: GetCdnDistributionOutputArgs, opts?: InvokeOptions): Output<GetCdnDistributionResult>
    def get_cdn_distribution(domain: Optional[str] = None,
                             id: Optional[str] = None,
                             partial_match: Optional[bool] = None,
                             timeouts: Optional[GetCdnDistributionTimeouts] = None,
                             opts: Optional[InvokeOptions] = None) -> GetCdnDistributionResult
    def get_cdn_distribution_output(domain: Optional[pulumi.Input[str]] = None,
                             id: Optional[pulumi.Input[str]] = None,
                             partial_match: Optional[pulumi.Input[bool]] = None,
                             timeouts: Optional[pulumi.Input[GetCdnDistributionTimeoutsArgs]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetCdnDistributionResult]
    func LookupCdnDistribution(ctx *Context, args *LookupCdnDistributionArgs, opts ...InvokeOption) (*LookupCdnDistributionResult, error)
    func LookupCdnDistributionOutput(ctx *Context, args *LookupCdnDistributionOutputArgs, opts ...InvokeOption) LookupCdnDistributionResultOutput

    > Note: This function is named LookupCdnDistribution in the Go SDK.

    public static class GetCdnDistribution 
    {
        public static Task<GetCdnDistributionResult> InvokeAsync(GetCdnDistributionArgs args, InvokeOptions? opts = null)
        public static Output<GetCdnDistributionResult> Invoke(GetCdnDistributionInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetCdnDistributionResult> getCdnDistribution(GetCdnDistributionArgs args, InvokeOptions options)
    public static Output<GetCdnDistributionResult> getCdnDistribution(GetCdnDistributionArgs args, InvokeOptions options)
    
    fn::invoke:
      function: ionoscloud:index/getCdnDistribution:getCdnDistribution
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Domain string
    Domain of an existing distribution that you want to search for. Search by domain is case-insensitive. The whole resource domain is required if partial_match parameter is not set to true.
    Id string
    ID of the distribution you want to search for.
    PartialMatch bool

    Whether partial matching is allowed or not when using domain argument. Default value is false.

    Either domain or id must be provided. If none, or both of domain and id are provided, the datasource will return an error.

    Timeouts GetCdnDistributionTimeouts
    Domain string
    Domain of an existing distribution that you want to search for. Search by domain is case-insensitive. The whole resource domain is required if partial_match parameter is not set to true.
    Id string
    ID of the distribution you want to search for.
    PartialMatch bool

    Whether partial matching is allowed or not when using domain argument. Default value is false.

    Either domain or id must be provided. If none, or both of domain and id are provided, the datasource will return an error.

    Timeouts GetCdnDistributionTimeouts
    domain String
    Domain of an existing distribution that you want to search for. Search by domain is case-insensitive. The whole resource domain is required if partial_match parameter is not set to true.
    id String
    ID of the distribution you want to search for.
    partialMatch Boolean

    Whether partial matching is allowed or not when using domain argument. Default value is false.

    Either domain or id must be provided. If none, or both of domain and id are provided, the datasource will return an error.

    timeouts GetCdnDistributionTimeouts
    domain string
    Domain of an existing distribution that you want to search for. Search by domain is case-insensitive. The whole resource domain is required if partial_match parameter is not set to true.
    id string
    ID of the distribution you want to search for.
    partialMatch boolean

    Whether partial matching is allowed or not when using domain argument. Default value is false.

    Either domain or id must be provided. If none, or both of domain and id are provided, the datasource will return an error.

    timeouts GetCdnDistributionTimeouts
    domain str
    Domain of an existing distribution that you want to search for. Search by domain is case-insensitive. The whole resource domain is required if partial_match parameter is not set to true.
    id str
    ID of the distribution you want to search for.
    partial_match bool

    Whether partial matching is allowed or not when using domain argument. Default value is false.

    Either domain or id must be provided. If none, or both of domain and id are provided, the datasource will return an error.

    timeouts GetCdnDistributionTimeouts
    domain String
    Domain of an existing distribution that you want to search for. Search by domain is case-insensitive. The whole resource domain is required if partial_match parameter is not set to true.
    id String
    ID of the distribution you want to search for.
    partialMatch Boolean

    Whether partial matching is allowed or not when using domain argument. Default value is false.

    Either domain or id must be provided. If none, or both of domain and id are provided, the datasource will return an error.

    timeouts Property Map

    getCdnDistribution Result

    The following output properties are available:

    CertificateId string
    The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    Id string
    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 identifier.
    RoutingRules List<GetCdnDistributionRoutingRule>
    The routing rules for the distribution.
    Domain string
    The domain of the distribution.
    PartialMatch bool
    Timeouts GetCdnDistributionTimeouts
    CertificateId string
    The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    Id string
    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 identifier.
    RoutingRules []GetCdnDistributionRoutingRule
    The routing rules for the distribution.
    Domain string
    The domain of the distribution.
    PartialMatch bool
    Timeouts GetCdnDistributionTimeouts
    certificateId String
    The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    id String
    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 identifier.
    routingRules List<GetCdnDistributionRoutingRule>
    The routing rules for the distribution.
    domain String
    The domain of the distribution.
    partialMatch Boolean
    timeouts GetCdnDistributionTimeouts
    certificateId string
    The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    id string
    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 identifier.
    routingRules GetCdnDistributionRoutingRule[]
    The routing rules for the distribution.
    domain string
    The domain of the distribution.
    partialMatch boolean
    timeouts GetCdnDistributionTimeouts
    certificate_id str
    The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    id str
    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 identifier.
    routing_rules Sequence[GetCdnDistributionRoutingRule]
    The routing rules for the distribution.
    domain str
    The domain of the distribution.
    partial_match bool
    timeouts GetCdnDistributionTimeouts
    certificateId String
    The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
    id String
    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 identifier.
    routingRules List<Property Map>
    The routing rules for the distribution.
    domain String
    The domain of the distribution.
    partialMatch Boolean
    timeouts Property Map

    Supporting Types

    GetCdnDistributionRoutingRule

    Prefix string
    The prefix of the routing rule.
    Scheme string
    The scheme of the routing rule.
    Upstreams List<GetCdnDistributionRoutingRuleUpstream>
    A map of properties for the rule
    Prefix string
    The prefix of the routing rule.
    Scheme string
    The scheme of the routing rule.
    Upstreams []GetCdnDistributionRoutingRuleUpstream
    A map of properties for the rule
    prefix String
    The prefix of the routing rule.
    scheme String
    The scheme of the routing rule.
    upstreams List<GetCdnDistributionRoutingRuleUpstream>
    A map of properties for the rule
    prefix string
    The prefix of the routing rule.
    scheme string
    The scheme of the routing rule.
    upstreams GetCdnDistributionRoutingRuleUpstream[]
    A map of properties for the rule
    prefix str
    The prefix of the routing rule.
    scheme str
    The scheme of the routing rule.
    upstreams Sequence[GetCdnDistributionRoutingRuleUpstream]
    A map of properties for the rule
    prefix String
    The prefix of the routing rule.
    scheme String
    The scheme of the routing rule.
    upstreams List<Property Map>
    A map of properties for the rule

    GetCdnDistributionRoutingRuleUpstream

    Caching 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.
    GeoRestrictions List<GetCdnDistributionRoutingRuleUpstreamGeoRestriction>
    A map of geo_restrictions
    Host 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
    Rate limit class that will be applied to limit the number of incoming requests per IP.
    SniMode 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
    Enable or disable WAF to protect the upstream host.
    Caching 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.
    GeoRestrictions []GetCdnDistributionRoutingRuleUpstreamGeoRestriction
    A map of geo_restrictions
    Host 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
    Rate limit class that will be applied to limit the number of incoming requests per IP.
    SniMode 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
    Enable or disable WAF to protect the upstream host.
    caching Boolean
    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.
    geoRestrictions List<GetCdnDistributionRoutingRuleUpstreamGeoRestriction>
    A map of geo_restrictions
    host 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
    Rate limit class that will be applied to limit the number of incoming requests per IP.
    sniMode 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
    Enable or disable WAF to protect the upstream host.
    caching boolean
    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.
    geoRestrictions GetCdnDistributionRoutingRuleUpstreamGeoRestriction[]
    A map of geo_restrictions
    host 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
    Rate limit class that will be applied to limit the number of incoming requests per IP.
    sniMode 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
    Enable or disable WAF to protect the upstream host.
    caching 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.
    geo_restrictions Sequence[GetCdnDistributionRoutingRuleUpstreamGeoRestriction]
    A map of geo_restrictions
    host str
    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
    Rate limit class that will be applied to limit the number of incoming requests per IP.
    sni_mode str
    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
    Enable or disable WAF to protect the upstream host.
    caching Boolean
    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.
    geoRestrictions List<Property Map>
    A map of geo_restrictions
    host 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
    Rate limit class that will be applied to limit the number of incoming requests per IP.
    sniMode 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
    Enable or disable WAF to protect the upstream host.

    GetCdnDistributionRoutingRuleUpstreamGeoRestriction

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

    GetCdnDistributionTimeouts

    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

    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