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

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",
});
Copy
import pulumi
import pulumi_ionoscloud as ionoscloud

example = ionoscloud.get_cdn_distribution(id="distr_id")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: ionoscloud:getCdnDistribution
      arguments:
        id: distr_id
Copy

By Domain

import * as pulumi from "@pulumi/pulumi";
import * as ionoscloud from "@pulumi/ionoscloud";

const example = ionoscloud.getCdnDistribution({
    domain: "example.com",
});
Copy
import pulumi
import pulumi_ionoscloud as ionoscloud

example = ionoscloud.get_cdn_distribution(domain="example.com")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: ionoscloud:getCdnDistribution
      arguments:
        domain: example.com
Copy

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,
});
Copy
import pulumi
import pulumi_ionoscloud as ionoscloud

example = ionoscloud.get_cdn_distribution(domain="example",
    partial_match=True)
Copy
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
	})
}
Copy
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,
    });

});
Copy
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());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: ionoscloud:getCdnDistribution
      arguments:
        domain: example
        partialMatch: true
Copy

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>
Copy
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]
Copy
func LookupCdnDistribution(ctx *Context, args *LookupCdnDistributionArgs, opts ...InvokeOption) (*LookupCdnDistributionResult, error)
func LookupCdnDistributionOutput(ctx *Context, args *LookupCdnDistributionOutputArgs, opts ...InvokeOption) LookupCdnDistributionResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetCdnDistributionResult> getCdnDistribution(GetCdnDistributionArgs args, InvokeOptions options)
public static Output<GetCdnDistributionResult> getCdnDistribution(GetCdnDistributionArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: ionoscloud:index/getCdnDistribution:getCdnDistribution
  arguments:
    # arguments dictionary
Copy

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 This property is required. string
The prefix of the routing rule.
Scheme This property is required. string
The scheme of the routing rule.
Upstreams This property is required. List<GetCdnDistributionRoutingRuleUpstream>
A map of properties for the rule
Prefix This property is required. string
The prefix of the routing rule.
Scheme This property is required. string
The scheme of the routing rule.
Upstreams This property is required. []GetCdnDistributionRoutingRuleUpstream
A map of properties for the rule
prefix This property is required. String
The prefix of the routing rule.
scheme This property is required. String
The scheme of the routing rule.
upstreams This property is required. List<GetCdnDistributionRoutingRuleUpstream>
A map of properties for the rule
prefix This property is required. string
The prefix of the routing rule.
scheme This property is required. string
The scheme of the routing rule.
upstreams This property is required. GetCdnDistributionRoutingRuleUpstream[]
A map of properties for the rule
prefix This property is required. str
The prefix of the routing rule.
scheme This property is required. str
The scheme of the routing rule.
upstreams This property is required. Sequence[GetCdnDistributionRoutingRuleUpstream]
A map of properties for the rule
prefix This property is required. String
The prefix of the routing rule.
scheme This property is required. String
The scheme of the routing rule.
upstreams This property is required. List<Property Map>
A map of properties for the rule

GetCdnDistributionRoutingRuleUpstream

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

GetCdnDistributionRoutingRuleUpstreamGeoRestriction

AllowLists This property is required. List<string>
List of allowed countries
BlockLists This property is required. List<string>
List of blocked countries
AllowLists This property is required. []string
List of allowed countries
BlockLists This property is required. []string
List of blocked countries
allowLists This property is required. List<String>
List of allowed countries
blockLists This property is required. List<String>
List of blocked countries
allowLists This property is required. string[]
List of allowed countries
blockLists This property is required. string[]
List of blocked countries
allow_lists This property is required. Sequence[str]
List of allowed countries
block_lists This property is required. Sequence[str]
List of blocked countries
allowLists This property is required. List<String>
List of allowed countries
blockLists This property is required. 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.