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",
});
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.
- Partial
Match bool Whether partial matching is allowed or not when using domain argument. Default value is false.
Either
domain
orid
must be provided. If none, or both ofdomain
andid
are provided, the datasource will return an error.- Timeouts
Get
Cdn Distribution Timeouts
- 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.
- Partial
Match bool Whether partial matching is allowed or not when using domain argument. Default value is false.
Either
domain
orid
must be provided. If none, or both ofdomain
andid
are provided, the datasource will return an error.- Timeouts
Get
Cdn Distribution Timeouts
- 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.
- partial
Match Boolean Whether partial matching is allowed or not when using domain argument. Default value is false.
Either
domain
orid
must be provided. If none, or both ofdomain
andid
are provided, the datasource will return an error.- timeouts
Get
Cdn Distribution Timeouts
- 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.
- partial
Match boolean Whether partial matching is allowed or not when using domain argument. Default value is false.
Either
domain
orid
must be provided. If none, or both ofdomain
andid
are provided, the datasource will return an error.- timeouts
Get
Cdn Distribution Timeouts
- 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
orid
must be provided. If none, or both ofdomain
andid
are provided, the datasource will return an error.- timeouts
Get
Cdn Distribution Timeouts
- 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.
- partial
Match Boolean Whether partial matching is allowed or not when using domain argument. Default value is false.
Either
domain
orid
must be provided. If none, or both ofdomain
andid
are provided, the datasource will return an error.- timeouts Property Map
getCdnDistribution Result
The following output properties are available:
- Certificate
Id string - The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
- Id string
- Public
Endpoint stringV4 - IP of the distribution, it has to be included on the domain DNS Zone as A record.
- Public
Endpoint stringV6 - IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
- Resource
Urn string - Unique resource identifier.
- Routing
Rules List<GetCdn Distribution Routing Rule> - The routing rules for the distribution.
- Domain string
- The domain of the distribution.
- Partial
Match bool - Timeouts
Get
Cdn Distribution Timeouts
- Certificate
Id string - The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
- Id string
- Public
Endpoint stringV4 - IP of the distribution, it has to be included on the domain DNS Zone as A record.
- Public
Endpoint stringV6 - IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
- Resource
Urn string - Unique resource identifier.
- Routing
Rules []GetCdn Distribution Routing Rule - The routing rules for the distribution.
- Domain string
- The domain of the distribution.
- Partial
Match bool - Timeouts
Get
Cdn Distribution Timeouts
- certificate
Id String - The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
- id String
- public
Endpoint StringV4 - IP of the distribution, it has to be included on the domain DNS Zone as A record.
- public
Endpoint StringV6 - IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
- resource
Urn String - Unique resource identifier.
- routing
Rules List<GetCdn Distribution Routing Rule> - The routing rules for the distribution.
- domain String
- The domain of the distribution.
- partial
Match Boolean - timeouts
Get
Cdn Distribution Timeouts
- certificate
Id string - The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
- id string
- public
Endpoint stringV4 - IP of the distribution, it has to be included on the domain DNS Zone as A record.
- public
Endpoint stringV6 - IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
- resource
Urn string - Unique resource identifier.
- routing
Rules GetCdn Distribution Routing Rule[] - The routing rules for the distribution.
- domain string
- The domain of the distribution.
- partial
Match boolean - timeouts
Get
Cdn Distribution Timeouts
- 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_ strv4 - IP of the distribution, it has to be included on the domain DNS Zone as A record.
- public_
endpoint_ strv6 - 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[GetCdn Distribution Routing Rule] - The routing rules for the distribution.
- domain str
- The domain of the distribution.
- partial_
match bool - timeouts
Get
Cdn Distribution Timeouts
- certificate
Id String - The ID of the certificate to use for the distribution. You can create certificates with the certificate resource.
- id String
- public
Endpoint StringV4 - IP of the distribution, it has to be included on the domain DNS Zone as A record.
- public
Endpoint StringV6 - IP of the distribution, it has to be included on the domain DNS Zone as AAAA record.
- resource
Urn String - Unique resource identifier.
- routing
Rules List<Property Map> - The routing rules for the distribution.
- domain String
- The domain of the distribution.
- partial
Match 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<Get
Cdn Distribution Routing Rule Upstream> - A map of properties for the rule
- Prefix string
- The prefix of the routing rule.
- Scheme string
- The scheme of the routing rule.
- Upstreams
[]Get
Cdn Distribution Routing Rule Upstream - 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<Get
Cdn Distribution Routing Rule Upstream> - A map of properties for the rule
- prefix string
- The prefix of the routing rule.
- scheme string
- The scheme of the routing rule.
- upstreams
Get
Cdn Distribution Routing Rule Upstream[] - 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[Get
Cdn Distribution Routing Rule Upstream] - 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.
- Geo
Restrictions List<GetCdn Distribution Routing Rule Upstream Geo Restriction> - 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.
- Rate
Limit stringClass - Rate limit class that will be applied to limit the number of incoming requests per IP.
- Sni
Mode 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.
- Geo
Restrictions []GetCdn Distribution Routing Rule Upstream Geo Restriction - 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.
- Rate
Limit stringClass - Rate limit class that will be applied to limit the number of incoming requests per IP.
- Sni
Mode 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.
- geo
Restrictions List<GetCdn Distribution Routing Rule Upstream Geo Restriction> - 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.
- rate
Limit StringClass - Rate limit class that will be applied to limit the number of incoming requests per IP.
- sni
Mode 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.
- geo
Restrictions GetCdn Distribution Routing Rule Upstream Geo Restriction[] - 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.
- rate
Limit stringClass - Rate limit class that will be applied to limit the number of incoming requests per IP.
- sni
Mode 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[GetCdn Distribution Routing Rule Upstream Geo Restriction] - 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_ strclass - 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.
- geo
Restrictions 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.
- rate
Limit StringClass - Rate limit class that will be applied to limit the number of incoming requests per IP.
- sni
Mode 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
- Allow
Lists List<string> - List of allowed countries
- Block
Lists List<string> - List of blocked countries
- Allow
Lists []string - List of allowed countries
- Block
Lists []string - List of blocked countries
- allow
Lists List<String> - List of allowed countries
- block
Lists List<String> - List of blocked countries
- allow
Lists string[] - List of allowed countries
- block
Lists string[] - List of blocked countries
- allow_
lists Sequence[str] - List of allowed countries
- block_
lists Sequence[str] - List of blocked countries
- allow
Lists List<String> - List of allowed countries
- block
Lists List<String> - List of blocked countries
GetCdnDistributionTimeouts
Package Details
- Repository
- ionoscloud ionos-cloud/terraform-provider-ionoscloud
- License
- Notes
- This Pulumi package is based on the
ionoscloud
Terraform Provider.