published on Friday, Feb 20, 2026 by stackitcloud
published on Friday, Feb 20, 2026 by stackitcloud
CDN distribution data source schema.
This resource is in beta and may be subject to breaking changes in the future. Use with caution. See our guide for how to opt-in to use beta resources.
Example Usage
resource "stackit_cdn_distribution" "example_distribution" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
config = {
backend = {
type = "http"
origin_url = "https://mybackend.onstackit.cloud"
geofencing = {
"https://mybackend.onstackit.cloud" = ["DE"]
}
}
regions = ["EU", "US", "ASIA", "AF", "SA"]
blocked_countries = ["DE", "AT", "CH"]
optimizer = {
enabled = true
}
}
}
resource "stackit_cdn_distribution" "example_bucket_distribution" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
config = {
backend = {
type = "bucket"
bucket_url = "https://my-test.object.storage.eu01.onstackit.cloud"
region = "eu01"
# Credentials are required for bucket backends
# It is strongly recommended to use variables for secrets
credentials = {
access_key_id = var.bucket_access_key
secret_access_key = var.bucket_secret_key
}
}
regions = ["EU", "US"]
blocked_countries = ["CN", "RU"]
optimizer = {
enabled = false
}
}
}
# Only use the import statement, if you want to import an existing cdn distribution
import {
to = stackit_cdn_distribution.import-example
id = "${var.project_id},${var.distribution_id}"
}
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,
config: Optional[CdnDistributionConfigArgs] = None,
project_id: Optional[str] = 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: stackit: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 Stackit.CdnDistribution("cdnDistributionResource", new()
{
Config = new Stackit.Inputs.CdnDistributionConfigArgs
{
Backend = new Stackit.Inputs.CdnDistributionConfigBackendArgs
{
Type = "string",
BucketUrl = "string",
Credentials = new Stackit.Inputs.CdnDistributionConfigBackendCredentialsArgs
{
AccessKeyId = "string",
SecretAccessKey = "string",
},
Geofencing =
{
{ "string", new[]
{
"string",
} },
},
OriginRequestHeaders =
{
{ "string", "string" },
},
OriginUrl = "string",
Region = "string",
},
Regions = new[]
{
"string",
},
BlockedCountries = new[]
{
"string",
},
Optimizer = new Stackit.Inputs.CdnDistributionConfigOptimizerArgs
{
Enabled = false,
},
},
ProjectId = "string",
});
example, err := stackit.NewCdnDistribution(ctx, "cdnDistributionResource", &stackit.CdnDistributionArgs{
Config: &stackit.CdnDistributionConfigArgs{
Backend: &stackit.CdnDistributionConfigBackendArgs{
Type: pulumi.String("string"),
BucketUrl: pulumi.String("string"),
Credentials: &stackit.CdnDistributionConfigBackendCredentialsArgs{
AccessKeyId: pulumi.String("string"),
SecretAccessKey: pulumi.String("string"),
},
Geofencing: pulumi.StringArrayMap{
"string": pulumi.StringArray{
pulumi.String("string"),
},
},
OriginRequestHeaders: pulumi.StringMap{
"string": pulumi.String("string"),
},
OriginUrl: pulumi.String("string"),
Region: pulumi.String("string"),
},
Regions: pulumi.StringArray{
pulumi.String("string"),
},
BlockedCountries: pulumi.StringArray{
pulumi.String("string"),
},
Optimizer: &stackit.CdnDistributionConfigOptimizerArgs{
Enabled: pulumi.Bool(false),
},
},
ProjectId: pulumi.String("string"),
})
var cdnDistributionResource = new CdnDistribution("cdnDistributionResource", CdnDistributionArgs.builder()
.config(CdnDistributionConfigArgs.builder()
.backend(CdnDistributionConfigBackendArgs.builder()
.type("string")
.bucketUrl("string")
.credentials(CdnDistributionConfigBackendCredentialsArgs.builder()
.accessKeyId("string")
.secretAccessKey("string")
.build())
.geofencing(Map.of("string", "string"))
.originRequestHeaders(Map.of("string", "string"))
.originUrl("string")
.region("string")
.build())
.regions("string")
.blockedCountries("string")
.optimizer(CdnDistributionConfigOptimizerArgs.builder()
.enabled(false)
.build())
.build())
.projectId("string")
.build());
cdn_distribution_resource = stackit.CdnDistribution("cdnDistributionResource",
config={
"backend": {
"type": "string",
"bucket_url": "string",
"credentials": {
"access_key_id": "string",
"secret_access_key": "string",
},
"geofencing": {
"string": ["string"],
},
"origin_request_headers": {
"string": "string",
},
"origin_url": "string",
"region": "string",
},
"regions": ["string"],
"blocked_countries": ["string"],
"optimizer": {
"enabled": False,
},
},
project_id="string")
const cdnDistributionResource = new stackit.CdnDistribution("cdnDistributionResource", {
config: {
backend: {
type: "string",
bucketUrl: "string",
credentials: {
accessKeyId: "string",
secretAccessKey: "string",
},
geofencing: {
string: ["string"],
},
originRequestHeaders: {
string: "string",
},
originUrl: "string",
region: "string",
},
regions: ["string"],
blockedCountries: ["string"],
optimizer: {
enabled: false,
},
},
projectId: "string",
});
type: stackit:CdnDistribution
properties:
config:
backend:
bucketUrl: string
credentials:
accessKeyId: string
secretAccessKey: string
geofencing:
string:
- string
originRequestHeaders:
string: string
originUrl: string
region: string
type: string
blockedCountries:
- string
optimizer:
enabled: false
regions:
- string
projectId: 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:
- Config
Cdn
Distribution Config - The distribution configuration
- Project
Id string - STACKIT project ID associated with the distribution
- Config
Cdn
Distribution Config Args - The distribution configuration
- Project
Id string - STACKIT project ID associated with the distribution
- config
Cdn
Distribution Config - The distribution configuration
- project
Id String - STACKIT project ID associated with the distribution
- config
Cdn
Distribution Config - The distribution configuration
- project
Id string - STACKIT project ID associated with the distribution
- config
Cdn
Distribution Config Args - The distribution configuration
- project_
id str - STACKIT project ID associated with the distribution
- config Property Map
- The distribution configuration
- project
Id String - STACKIT project ID associated with the distribution
Outputs
All input properties are implicitly available as output properties. Additionally, the CdnDistribution resource produces the following output properties:
- Created
At string - Time when the distribution was created
- Distribution
Id string - CDN distribution ID
- Domains
List<Cdn
Distribution Domain> - List of configured domains for the distribution
- Errors List<string>
- List of distribution errors
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- Status of the distribution
- Updated
At string - Time when the distribution was last updated
- Created
At string - Time when the distribution was created
- Distribution
Id string - CDN distribution ID
- Domains
[]Cdn
Distribution Domain - List of configured domains for the distribution
- Errors []string
- List of distribution errors
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- Status of the distribution
- Updated
At string - Time when the distribution was last updated
- created
At String - Time when the distribution was created
- distribution
Id String - CDN distribution ID
- domains
List<Cdn
Distribution Domain> - List of configured domains for the distribution
- errors List<String>
- List of distribution errors
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- Status of the distribution
- updated
At String - Time when the distribution was last updated
- created
At string - Time when the distribution was created
- distribution
Id string - CDN distribution ID
- domains
Cdn
Distribution Domain[] - List of configured domains for the distribution
- errors string[]
- List of distribution errors
- id string
- The provider-assigned unique ID for this managed resource.
- status string
- Status of the distribution
- updated
At string - Time when the distribution was last updated
- created_
at str - Time when the distribution was created
- distribution_
id str - CDN distribution ID
- domains
Sequence[Cdn
Distribution Domain] - List of configured domains for the distribution
- errors Sequence[str]
- List of distribution errors
- id str
- The provider-assigned unique ID for this managed resource.
- status str
- Status of the distribution
- updated_
at str - Time when the distribution was last updated
- created
At String - Time when the distribution was created
- distribution
Id String - CDN distribution ID
- domains List<Property Map>
- List of configured domains for the distribution
- errors List<String>
- List of distribution errors
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- Status of the distribution
- updated
At String - Time when the distribution was last updated
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,
config: Optional[CdnDistributionConfigArgs] = None,
created_at: Optional[str] = None,
distribution_id: Optional[str] = None,
domains: Optional[Sequence[CdnDistributionDomainArgs]] = None,
errors: Optional[Sequence[str]] = None,
project_id: Optional[str] = None,
status: Optional[str] = None,
updated_at: Optional[str] = None) -> CdnDistributionfunc 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: stackit: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.
- Config
Cdn
Distribution Config - The distribution configuration
- Created
At string - Time when the distribution was created
- Distribution
Id string - CDN distribution ID
- Domains
List<Cdn
Distribution Domain> - List of configured domains for the distribution
- Errors List<string>
- List of distribution errors
- Project
Id string - STACKIT project ID associated with the distribution
- Status string
- Status of the distribution
- Updated
At string - Time when the distribution was last updated
- Config
Cdn
Distribution Config Args - The distribution configuration
- Created
At string - Time when the distribution was created
- Distribution
Id string - CDN distribution ID
- Domains
[]Cdn
Distribution Domain Args - List of configured domains for the distribution
- Errors []string
- List of distribution errors
- Project
Id string - STACKIT project ID associated with the distribution
- Status string
- Status of the distribution
- Updated
At string - Time when the distribution was last updated
- config
Cdn
Distribution Config - The distribution configuration
- created
At String - Time when the distribution was created
- distribution
Id String - CDN distribution ID
- domains
List<Cdn
Distribution Domain> - List of configured domains for the distribution
- errors List<String>
- List of distribution errors
- project
Id String - STACKIT project ID associated with the distribution
- status String
- Status of the distribution
- updated
At String - Time when the distribution was last updated
- config
Cdn
Distribution Config - The distribution configuration
- created
At string - Time when the distribution was created
- distribution
Id string - CDN distribution ID
- domains
Cdn
Distribution Domain[] - List of configured domains for the distribution
- errors string[]
- List of distribution errors
- project
Id string - STACKIT project ID associated with the distribution
- status string
- Status of the distribution
- updated
At string - Time when the distribution was last updated
- config
Cdn
Distribution Config Args - The distribution configuration
- created_
at str - Time when the distribution was created
- distribution_
id str - CDN distribution ID
- domains
Sequence[Cdn
Distribution Domain Args] - List of configured domains for the distribution
- errors Sequence[str]
- List of distribution errors
- project_
id str - STACKIT project ID associated with the distribution
- status str
- Status of the distribution
- updated_
at str - Time when the distribution was last updated
- config Property Map
- The distribution configuration
- created
At String - Time when the distribution was created
- distribution
Id String - CDN distribution ID
- domains List<Property Map>
- List of configured domains for the distribution
- errors List<String>
- List of distribution errors
- project
Id String - STACKIT project ID associated with the distribution
- status String
- Status of the distribution
- updated
At String - Time when the distribution was last updated
Supporting Types
CdnDistributionConfig, CdnDistributionConfigArgs
- Backend
Cdn
Distribution Config Backend - The configured backend for the distribution
- Regions List<string>
- The configured regions where content will be hosted
- Blocked
Countries List<string> - The configured countries where distribution of content is blocked
- Optimizer
Cdn
Distribution Config Optimizer - Configuration for the Image Optimizer. This is a paid feature that automatically optimizes images to reduce their file size for faster delivery, leading to improved website performance and a better user experience.
- Backend
Cdn
Distribution Config Backend - The configured backend for the distribution
- Regions []string
- The configured regions where content will be hosted
- Blocked
Countries []string - The configured countries where distribution of content is blocked
- Optimizer
Cdn
Distribution Config Optimizer - Configuration for the Image Optimizer. This is a paid feature that automatically optimizes images to reduce their file size for faster delivery, leading to improved website performance and a better user experience.
- backend
Cdn
Distribution Config Backend - The configured backend for the distribution
- regions List<String>
- The configured regions where content will be hosted
- blocked
Countries List<String> - The configured countries where distribution of content is blocked
- optimizer
Cdn
Distribution Config Optimizer - Configuration for the Image Optimizer. This is a paid feature that automatically optimizes images to reduce their file size for faster delivery, leading to improved website performance and a better user experience.
- backend
Cdn
Distribution Config Backend - The configured backend for the distribution
- regions string[]
- The configured regions where content will be hosted
- blocked
Countries string[] - The configured countries where distribution of content is blocked
- optimizer
Cdn
Distribution Config Optimizer - Configuration for the Image Optimizer. This is a paid feature that automatically optimizes images to reduce their file size for faster delivery, leading to improved website performance and a better user experience.
- backend
Cdn
Distribution Config Backend - The configured backend for the distribution
- regions Sequence[str]
- The configured regions where content will be hosted
- blocked_
countries Sequence[str] - The configured countries where distribution of content is blocked
- optimizer
Cdn
Distribution Config Optimizer - Configuration for the Image Optimizer. This is a paid feature that automatically optimizes images to reduce their file size for faster delivery, leading to improved website performance and a better user experience.
- backend Property Map
- The configured backend for the distribution
- regions List<String>
- The configured regions where content will be hosted
- blocked
Countries List<String> - The configured countries where distribution of content is blocked
- optimizer Property Map
- Configuration for the Image Optimizer. This is a paid feature that automatically optimizes images to reduce their file size for faster delivery, leading to improved website performance and a better user experience.
CdnDistributionConfigBackend, CdnDistributionConfigBackendArgs
- Type string
- The configured backend type. Possible values are:
http,bucket. - Bucket
Url string - The URL of the bucket (e.g. https://s3.example.com). Required if type is 'bucket'.
- Credentials
Cdn
Distribution Config Backend Credentials - The credentials for the bucket. Required if type is 'bucket'.
- Geofencing
Dictionary<string, Immutable
Array<string>> - The configured type http to configure countries where content is allowed. A map of URLs to a list of countries
- Origin
Request Dictionary<string, string>Headers - The configured type http origin request headers for the backend
- Origin
Url string - The configured backend type http for the distribution
- Region string
- The region where the bucket is hosted. Required if type is 'bucket'.
- Type string
- The configured backend type. Possible values are:
http,bucket. - Bucket
Url string - The URL of the bucket (e.g. https://s3.example.com). Required if type is 'bucket'.
- Credentials
Cdn
Distribution Config Backend Credentials - The credentials for the bucket. Required if type is 'bucket'.
- Geofencing map[string][]string
- The configured type http to configure countries where content is allowed. A map of URLs to a list of countries
- Origin
Request map[string]stringHeaders - The configured type http origin request headers for the backend
- Origin
Url string - The configured backend type http for the distribution
- Region string
- The region where the bucket is hosted. Required if type is 'bucket'.
- type String
- The configured backend type. Possible values are:
http,bucket. - bucket
Url String - The URL of the bucket (e.g. https://s3.example.com). Required if type is 'bucket'.
- credentials
Cdn
Distribution Config Backend Credentials - The credentials for the bucket. Required if type is 'bucket'.
- geofencing Map<String,List<String>>
- The configured type http to configure countries where content is allowed. A map of URLs to a list of countries
- origin
Request Map<String,String>Headers - The configured type http origin request headers for the backend
- origin
Url String - The configured backend type http for the distribution
- region String
- The region where the bucket is hosted. Required if type is 'bucket'.
- type string
- The configured backend type. Possible values are:
http,bucket. - bucket
Url string - The URL of the bucket (e.g. https://s3.example.com). Required if type is 'bucket'.
- credentials
Cdn
Distribution Config Backend Credentials - The credentials for the bucket. Required if type is 'bucket'.
- geofencing {[key: string]: string[]}
- The configured type http to configure countries where content is allowed. A map of URLs to a list of countries
- origin
Request {[key: string]: string}Headers - The configured type http origin request headers for the backend
- origin
Url string - The configured backend type http for the distribution
- region string
- The region where the bucket is hosted. Required if type is 'bucket'.
- type str
- The configured backend type. Possible values are:
http,bucket. - bucket_
url str - The URL of the bucket (e.g. https://s3.example.com). Required if type is 'bucket'.
- credentials
Cdn
Distribution Config Backend Credentials - The credentials for the bucket. Required if type is 'bucket'.
- geofencing Mapping[str, Sequence[str]]
- The configured type http to configure countries where content is allowed. A map of URLs to a list of countries
- origin_
request_ Mapping[str, str]headers - The configured type http origin request headers for the backend
- origin_
url str - The configured backend type http for the distribution
- region str
- The region where the bucket is hosted. Required if type is 'bucket'.
- type String
- The configured backend type. Possible values are:
http,bucket. - bucket
Url String - The URL of the bucket (e.g. https://s3.example.com). Required if type is 'bucket'.
- credentials Property Map
- The credentials for the bucket. Required if type is 'bucket'.
- geofencing Map<List<String>>
- The configured type http to configure countries where content is allowed. A map of URLs to a list of countries
- origin
Request Map<String>Headers - The configured type http origin request headers for the backend
- origin
Url String - The configured backend type http for the distribution
- region String
- The region where the bucket is hosted. Required if type is 'bucket'.
CdnDistributionConfigBackendCredentials, CdnDistributionConfigBackendCredentialsArgs
- Access
Key stringId - The access key for the bucket. Required if type is 'bucket'.
- Secret
Access stringKey - The access key for the bucket. Required if type is 'bucket'.
- Access
Key stringId - The access key for the bucket. Required if type is 'bucket'.
- Secret
Access stringKey - The access key for the bucket. Required if type is 'bucket'.
- access
Key StringId - The access key for the bucket. Required if type is 'bucket'.
- secret
Access StringKey - The access key for the bucket. Required if type is 'bucket'.
- access
Key stringId - The access key for the bucket. Required if type is 'bucket'.
- secret
Access stringKey - The access key for the bucket. Required if type is 'bucket'.
- access_
key_ strid - The access key for the bucket. Required if type is 'bucket'.
- secret_
access_ strkey - The access key for the bucket. Required if type is 'bucket'.
- access
Key StringId - The access key for the bucket. Required if type is 'bucket'.
- secret
Access StringKey - The access key for the bucket. Required if type is 'bucket'.
CdnDistributionConfigOptimizer, CdnDistributionConfigOptimizerArgs
- Enabled bool
- Enabled bool
- enabled Boolean
- enabled boolean
- enabled bool
- enabled Boolean
CdnDistributionDomain, CdnDistributionDomainArgs
Package Details
- Repository
- stackit stackitcloud/pulumi-stackit
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
stackitTerraform Provider.
published on Friday, Feb 20, 2026 by stackitcloud
