1. Packages
  2. Gcorelabs Provider
  3. API Docs
  4. CdnRule
gcorelabs 0.3.63 published on Monday, Apr 14, 2025 by g-core

gcorelabs.CdnRule

Explore with Pulumi AI

Represent cdn resource rule

Create CdnRule Resource

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

Constructor syntax

new CdnRule(name: string, args: CdnRuleArgs, opts?: CustomResourceOptions);
@overload
def CdnRule(resource_name: str,
            args: CdnRuleArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def CdnRule(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            resource_id: Optional[float] = None,
            rule: Optional[str] = None,
            rule_type: Optional[float] = None,
            cdn_rule_id: Optional[str] = None,
            name: Optional[str] = None,
            options: Optional[CdnRuleOptionsArgs] = None,
            origin_group: Optional[float] = None,
            origin_protocol: Optional[str] = None,
            weight: Optional[float] = None)
func NewCdnRule(ctx *Context, name string, args CdnRuleArgs, opts ...ResourceOption) (*CdnRule, error)
public CdnRule(string name, CdnRuleArgs args, CustomResourceOptions? opts = null)
public CdnRule(String name, CdnRuleArgs args)
public CdnRule(String name, CdnRuleArgs args, CustomResourceOptions options)
type: gcorelabs:CdnRule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. CdnRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. CdnRuleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. CdnRuleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. CdnRuleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. CdnRuleArgs
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 cdnRuleResource = new Gcorelabs.CdnRule("cdnRuleResource", new()
{
    ResourceId = 0,
    Rule = "string",
    RuleType = 0,
    CdnRuleId = "string",
    Name = "string",
    Options = new Gcorelabs.Inputs.CdnRuleOptionsArgs
    {
        BrowserCacheSettings = new Gcorelabs.Inputs.CdnRuleOptionsBrowserCacheSettingsArgs
        {
            Enabled = false,
            Value = "string",
        },
        Cors = new Gcorelabs.Inputs.CdnRuleOptionsCorsArgs
        {
            Values = new[]
            {
                "string",
            },
            Enabled = false,
        },
        EdgeCacheSettings = new Gcorelabs.Inputs.CdnRuleOptionsEdgeCacheSettingsArgs
        {
            CustomValues = 
            {
                { "string", "string" },
            },
            Default = "string",
            Enabled = false,
            Value = "string",
        },
        GzipOn = new Gcorelabs.Inputs.CdnRuleOptionsGzipOnArgs
        {
            Value = false,
            Enabled = false,
        },
        HostHeader = new Gcorelabs.Inputs.CdnRuleOptionsHostHeaderArgs
        {
            Value = "string",
            Enabled = false,
        },
        IgnoreQueryString = new Gcorelabs.Inputs.CdnRuleOptionsIgnoreQueryStringArgs
        {
            Value = false,
            Enabled = false,
        },
        QueryParamsBlacklist = new Gcorelabs.Inputs.CdnRuleOptionsQueryParamsBlacklistArgs
        {
            Values = new[]
            {
                "string",
            },
            Enabled = false,
        },
        QueryParamsWhitelist = new Gcorelabs.Inputs.CdnRuleOptionsQueryParamsWhitelistArgs
        {
            Values = new[]
            {
                "string",
            },
            Enabled = false,
        },
        RedirectHttpToHttps = new Gcorelabs.Inputs.CdnRuleOptionsRedirectHttpToHttpsArgs
        {
            Value = false,
            Enabled = false,
        },
        Rewrite = new Gcorelabs.Inputs.CdnRuleOptionsRewriteArgs
        {
            Body = "string",
            Enabled = false,
            Flag = "string",
        },
        Sni = new Gcorelabs.Inputs.CdnRuleOptionsSniArgs
        {
            CustomHostname = "string",
            Enabled = false,
            SniType = "string",
        },
        StaticHeaders = new Gcorelabs.Inputs.CdnRuleOptionsStaticHeadersArgs
        {
            Value = 
            {
                { "string", "string" },
            },
            Enabled = false,
        },
        StaticRequestHeaders = new Gcorelabs.Inputs.CdnRuleOptionsStaticRequestHeadersArgs
        {
            Value = 
            {
                { "string", "string" },
            },
            Enabled = false,
        },
        TlsVersions = new Gcorelabs.Inputs.CdnRuleOptionsTlsVersionsArgs
        {
            Values = new[]
            {
                "string",
            },
            Enabled = false,
        },
        Webp = new Gcorelabs.Inputs.CdnRuleOptionsWebpArgs
        {
            JpgQuality = 0,
            PngQuality = 0,
            Enabled = false,
            PngLossless = false,
        },
        Websockets = new Gcorelabs.Inputs.CdnRuleOptionsWebsocketsArgs
        {
            Value = false,
            Enabled = false,
        },
    },
    OriginGroup = 0,
    OriginProtocol = "string",
    Weight = 0,
});
Copy
example, err := gcorelabs.NewCdnRule(ctx, "cdnRuleResource", &gcorelabs.CdnRuleArgs{
ResourceId: pulumi.Float64(0),
Rule: pulumi.String("string"),
RuleType: pulumi.Float64(0),
CdnRuleId: pulumi.String("string"),
Name: pulumi.String("string"),
Options: &.CdnRuleOptionsArgs{
BrowserCacheSettings: &.CdnRuleOptionsBrowserCacheSettingsArgs{
Enabled: pulumi.Bool(false),
Value: pulumi.String("string"),
},
Cors: &.CdnRuleOptionsCorsArgs{
Values: pulumi.StringArray{
pulumi.String("string"),
},
Enabled: pulumi.Bool(false),
},
EdgeCacheSettings: &.CdnRuleOptionsEdgeCacheSettingsArgs{
CustomValues: pulumi.StringMap{
"string": pulumi.String("string"),
},
Default: pulumi.String("string"),
Enabled: pulumi.Bool(false),
Value: pulumi.String("string"),
},
GzipOn: &.CdnRuleOptionsGzipOnArgs{
Value: pulumi.Bool(false),
Enabled: pulumi.Bool(false),
},
HostHeader: &.CdnRuleOptionsHostHeaderArgs{
Value: pulumi.String("string"),
Enabled: pulumi.Bool(false),
},
IgnoreQueryString: &.CdnRuleOptionsIgnoreQueryStringArgs{
Value: pulumi.Bool(false),
Enabled: pulumi.Bool(false),
},
QueryParamsBlacklist: &.CdnRuleOptionsQueryParamsBlacklistArgs{
Values: pulumi.StringArray{
pulumi.String("string"),
},
Enabled: pulumi.Bool(false),
},
QueryParamsWhitelist: &.CdnRuleOptionsQueryParamsWhitelistArgs{
Values: pulumi.StringArray{
pulumi.String("string"),
},
Enabled: pulumi.Bool(false),
},
RedirectHttpToHttps: &.CdnRuleOptionsRedirectHttpToHttpsArgs{
Value: pulumi.Bool(false),
Enabled: pulumi.Bool(false),
},
Rewrite: &.CdnRuleOptionsRewriteArgs{
Body: pulumi.String("string"),
Enabled: pulumi.Bool(false),
Flag: pulumi.String("string"),
},
Sni: &.CdnRuleOptionsSniArgs{
CustomHostname: pulumi.String("string"),
Enabled: pulumi.Bool(false),
SniType: pulumi.String("string"),
},
StaticHeaders: &.CdnRuleOptionsStaticHeadersArgs{
Value: pulumi.StringMap{
"string": pulumi.String("string"),
},
Enabled: pulumi.Bool(false),
},
StaticRequestHeaders: &.CdnRuleOptionsStaticRequestHeadersArgs{
Value: pulumi.StringMap{
"string": pulumi.String("string"),
},
Enabled: pulumi.Bool(false),
},
TlsVersions: &.CdnRuleOptionsTlsVersionsArgs{
Values: pulumi.StringArray{
pulumi.String("string"),
},
Enabled: pulumi.Bool(false),
},
Webp: &.CdnRuleOptionsWebpArgs{
JpgQuality: pulumi.Float64(0),
PngQuality: pulumi.Float64(0),
Enabled: pulumi.Bool(false),
PngLossless: pulumi.Bool(false),
},
Websockets: &.CdnRuleOptionsWebsocketsArgs{
Value: pulumi.Bool(false),
Enabled: pulumi.Bool(false),
},
},
OriginGroup: pulumi.Float64(0),
OriginProtocol: pulumi.String("string"),
Weight: pulumi.Float64(0),
})
Copy
var cdnRuleResource = new CdnRule("cdnRuleResource", CdnRuleArgs.builder()
    .resourceId(0)
    .rule("string")
    .ruleType(0)
    .cdnRuleId("string")
    .name("string")
    .options(CdnRuleOptionsArgs.builder()
        .browserCacheSettings(CdnRuleOptionsBrowserCacheSettingsArgs.builder()
            .enabled(false)
            .value("string")
            .build())
        .cors(CdnRuleOptionsCorsArgs.builder()
            .values("string")
            .enabled(false)
            .build())
        .edgeCacheSettings(CdnRuleOptionsEdgeCacheSettingsArgs.builder()
            .customValues(Map.of("string", "string"))
            .default_("string")
            .enabled(false)
            .value("string")
            .build())
        .gzipOn(CdnRuleOptionsGzipOnArgs.builder()
            .value(false)
            .enabled(false)
            .build())
        .hostHeader(CdnRuleOptionsHostHeaderArgs.builder()
            .value("string")
            .enabled(false)
            .build())
        .ignoreQueryString(CdnRuleOptionsIgnoreQueryStringArgs.builder()
            .value(false)
            .enabled(false)
            .build())
        .queryParamsBlacklist(CdnRuleOptionsQueryParamsBlacklistArgs.builder()
            .values("string")
            .enabled(false)
            .build())
        .queryParamsWhitelist(CdnRuleOptionsQueryParamsWhitelistArgs.builder()
            .values("string")
            .enabled(false)
            .build())
        .redirectHttpToHttps(CdnRuleOptionsRedirectHttpToHttpsArgs.builder()
            .value(false)
            .enabled(false)
            .build())
        .rewrite(CdnRuleOptionsRewriteArgs.builder()
            .body("string")
            .enabled(false)
            .flag("string")
            .build())
        .sni(CdnRuleOptionsSniArgs.builder()
            .customHostname("string")
            .enabled(false)
            .sniType("string")
            .build())
        .staticHeaders(CdnRuleOptionsStaticHeadersArgs.builder()
            .value(Map.of("string", "string"))
            .enabled(false)
            .build())
        .staticRequestHeaders(CdnRuleOptionsStaticRequestHeadersArgs.builder()
            .value(Map.of("string", "string"))
            .enabled(false)
            .build())
        .tlsVersions(CdnRuleOptionsTlsVersionsArgs.builder()
            .values("string")
            .enabled(false)
            .build())
        .webp(CdnRuleOptionsWebpArgs.builder()
            .jpgQuality(0)
            .pngQuality(0)
            .enabled(false)
            .pngLossless(false)
            .build())
        .websockets(CdnRuleOptionsWebsocketsArgs.builder()
            .value(false)
            .enabled(false)
            .build())
        .build())
    .originGroup(0)
    .originProtocol("string")
    .weight(0)
    .build());
Copy
cdn_rule_resource = gcorelabs.CdnRule("cdnRuleResource",
    resource_id=0,
    rule="string",
    rule_type=0,
    cdn_rule_id="string",
    name="string",
    options={
        "browser_cache_settings": {
            "enabled": False,
            "value": "string",
        },
        "cors": {
            "values": ["string"],
            "enabled": False,
        },
        "edge_cache_settings": {
            "custom_values": {
                "string": "string",
            },
            "default": "string",
            "enabled": False,
            "value": "string",
        },
        "gzip_on": {
            "value": False,
            "enabled": False,
        },
        "host_header": {
            "value": "string",
            "enabled": False,
        },
        "ignore_query_string": {
            "value": False,
            "enabled": False,
        },
        "query_params_blacklist": {
            "values": ["string"],
            "enabled": False,
        },
        "query_params_whitelist": {
            "values": ["string"],
            "enabled": False,
        },
        "redirect_http_to_https": {
            "value": False,
            "enabled": False,
        },
        "rewrite": {
            "body": "string",
            "enabled": False,
            "flag": "string",
        },
        "sni": {
            "custom_hostname": "string",
            "enabled": False,
            "sni_type": "string",
        },
        "static_headers": {
            "value": {
                "string": "string",
            },
            "enabled": False,
        },
        "static_request_headers": {
            "value": {
                "string": "string",
            },
            "enabled": False,
        },
        "tls_versions": {
            "values": ["string"],
            "enabled": False,
        },
        "webp": {
            "jpg_quality": 0,
            "png_quality": 0,
            "enabled": False,
            "png_lossless": False,
        },
        "websockets": {
            "value": False,
            "enabled": False,
        },
    },
    origin_group=0,
    origin_protocol="string",
    weight=0)
Copy
const cdnRuleResource = new gcorelabs.CdnRule("cdnRuleResource", {
    resourceId: 0,
    rule: "string",
    ruleType: 0,
    cdnRuleId: "string",
    name: "string",
    options: {
        browserCacheSettings: {
            enabled: false,
            value: "string",
        },
        cors: {
            values: ["string"],
            enabled: false,
        },
        edgeCacheSettings: {
            customValues: {
                string: "string",
            },
            "default": "string",
            enabled: false,
            value: "string",
        },
        gzipOn: {
            value: false,
            enabled: false,
        },
        hostHeader: {
            value: "string",
            enabled: false,
        },
        ignoreQueryString: {
            value: false,
            enabled: false,
        },
        queryParamsBlacklist: {
            values: ["string"],
            enabled: false,
        },
        queryParamsWhitelist: {
            values: ["string"],
            enabled: false,
        },
        redirectHttpToHttps: {
            value: false,
            enabled: false,
        },
        rewrite: {
            body: "string",
            enabled: false,
            flag: "string",
        },
        sni: {
            customHostname: "string",
            enabled: false,
            sniType: "string",
        },
        staticHeaders: {
            value: {
                string: "string",
            },
            enabled: false,
        },
        staticRequestHeaders: {
            value: {
                string: "string",
            },
            enabled: false,
        },
        tlsVersions: {
            values: ["string"],
            enabled: false,
        },
        webp: {
            jpgQuality: 0,
            pngQuality: 0,
            enabled: false,
            pngLossless: false,
        },
        websockets: {
            value: false,
            enabled: false,
        },
    },
    originGroup: 0,
    originProtocol: "string",
    weight: 0,
});
Copy
type: gcorelabs:CdnRule
properties:
    cdnRuleId: string
    name: string
    options:
        browserCacheSettings:
            enabled: false
            value: string
        cors:
            enabled: false
            values:
                - string
        edgeCacheSettings:
            customValues:
                string: string
            default: string
            enabled: false
            value: string
        gzipOn:
            enabled: false
            value: false
        hostHeader:
            enabled: false
            value: string
        ignoreQueryString:
            enabled: false
            value: false
        queryParamsBlacklist:
            enabled: false
            values:
                - string
        queryParamsWhitelist:
            enabled: false
            values:
                - string
        redirectHttpToHttps:
            enabled: false
            value: false
        rewrite:
            body: string
            enabled: false
            flag: string
        sni:
            customHostname: string
            enabled: false
            sniType: string
        staticHeaders:
            enabled: false
            value:
                string: string
        staticRequestHeaders:
            enabled: false
            value:
                string: string
        tlsVersions:
            enabled: false
            values:
                - string
        webp:
            enabled: false
            jpgQuality: 0
            pngLossless: false
            pngQuality: 0
        websockets:
            enabled: false
            value: false
    originGroup: 0
    originProtocol: string
    resourceId: 0
    rule: string
    ruleType: 0
    weight: 0
Copy

CdnRule 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 CdnRule resource accepts the following input properties:

ResourceId This property is required. double
Rule This property is required. string
A pattern that defines when the rule is triggered. By default, we add a leading forward slash to any rule pattern. Specify a pattern without a forward slash.
RuleType This property is required. double
Type of rule. The rule is applied if the requested URI matches the rule pattern. It has two possible values: Type 0 — RegEx. Must start with '^/' or '/'. Type 1 — RegEx. Legacy type. Note that for this rule type we automatically add / to each rule pattern before your regular expression. Please use Type 0.
CdnRuleId string
The ID of this resource.
Name string
Rule name
Options CdnRuleOptions
Each option in CDN resource settings. Each option added to CDN resource settings should have the following mandatory request fields: enabled, value.
OriginGroup double
ID of the Origins Group. Use one of your Origins Group or create a new one. You can use either 'origin' parameter or 'originGroup' in the resource definition.
OriginProtocol string
This option defines the protocol that will be used by CDN servers to request content from an origin source. If not specified, it will be inherit from resource. Possible values are: HTTPS, HTTP, MATCH.
Weight double
Rule weight that determines rule execution order: from the smallest (0) to the highest.
ResourceId This property is required. float64
Rule This property is required. string
A pattern that defines when the rule is triggered. By default, we add a leading forward slash to any rule pattern. Specify a pattern without a forward slash.
RuleType This property is required. float64
Type of rule. The rule is applied if the requested URI matches the rule pattern. It has two possible values: Type 0 — RegEx. Must start with '^/' or '/'. Type 1 — RegEx. Legacy type. Note that for this rule type we automatically add / to each rule pattern before your regular expression. Please use Type 0.
CdnRuleId string
The ID of this resource.
Name string
Rule name
Options CdnRuleOptionsArgs
Each option in CDN resource settings. Each option added to CDN resource settings should have the following mandatory request fields: enabled, value.
OriginGroup float64
ID of the Origins Group. Use one of your Origins Group or create a new one. You can use either 'origin' parameter or 'originGroup' in the resource definition.
OriginProtocol string
This option defines the protocol that will be used by CDN servers to request content from an origin source. If not specified, it will be inherit from resource. Possible values are: HTTPS, HTTP, MATCH.
Weight float64
Rule weight that determines rule execution order: from the smallest (0) to the highest.
resourceId This property is required. Double
rule This property is required. String
A pattern that defines when the rule is triggered. By default, we add a leading forward slash to any rule pattern. Specify a pattern without a forward slash.
ruleType This property is required. Double
Type of rule. The rule is applied if the requested URI matches the rule pattern. It has two possible values: Type 0 — RegEx. Must start with '^/' or '/'. Type 1 — RegEx. Legacy type. Note that for this rule type we automatically add / to each rule pattern before your regular expression. Please use Type 0.
cdnRuleId String
The ID of this resource.
name String
Rule name
options CdnRuleOptions
Each option in CDN resource settings. Each option added to CDN resource settings should have the following mandatory request fields: enabled, value.
originGroup Double
ID of the Origins Group. Use one of your Origins Group or create a new one. You can use either 'origin' parameter or 'originGroup' in the resource definition.
originProtocol String
This option defines the protocol that will be used by CDN servers to request content from an origin source. If not specified, it will be inherit from resource. Possible values are: HTTPS, HTTP, MATCH.
weight Double
Rule weight that determines rule execution order: from the smallest (0) to the highest.
resourceId This property is required. number
rule This property is required. string
A pattern that defines when the rule is triggered. By default, we add a leading forward slash to any rule pattern. Specify a pattern without a forward slash.
ruleType This property is required. number
Type of rule. The rule is applied if the requested URI matches the rule pattern. It has two possible values: Type 0 — RegEx. Must start with '^/' or '/'. Type 1 — RegEx. Legacy type. Note that for this rule type we automatically add / to each rule pattern before your regular expression. Please use Type 0.
cdnRuleId string
The ID of this resource.
name string
Rule name
options CdnRuleOptions
Each option in CDN resource settings. Each option added to CDN resource settings should have the following mandatory request fields: enabled, value.
originGroup number
ID of the Origins Group. Use one of your Origins Group or create a new one. You can use either 'origin' parameter or 'originGroup' in the resource definition.
originProtocol string
This option defines the protocol that will be used by CDN servers to request content from an origin source. If not specified, it will be inherit from resource. Possible values are: HTTPS, HTTP, MATCH.
weight number
Rule weight that determines rule execution order: from the smallest (0) to the highest.
resource_id This property is required. float
rule This property is required. str
A pattern that defines when the rule is triggered. By default, we add a leading forward slash to any rule pattern. Specify a pattern without a forward slash.
rule_type This property is required. float
Type of rule. The rule is applied if the requested URI matches the rule pattern. It has two possible values: Type 0 — RegEx. Must start with '^/' or '/'. Type 1 — RegEx. Legacy type. Note that for this rule type we automatically add / to each rule pattern before your regular expression. Please use Type 0.
cdn_rule_id str
The ID of this resource.
name str
Rule name
options CdnRuleOptionsArgs
Each option in CDN resource settings. Each option added to CDN resource settings should have the following mandatory request fields: enabled, value.
origin_group float
ID of the Origins Group. Use one of your Origins Group or create a new one. You can use either 'origin' parameter or 'originGroup' in the resource definition.
origin_protocol str
This option defines the protocol that will be used by CDN servers to request content from an origin source. If not specified, it will be inherit from resource. Possible values are: HTTPS, HTTP, MATCH.
weight float
Rule weight that determines rule execution order: from the smallest (0) to the highest.
resourceId This property is required. Number
rule This property is required. String
A pattern that defines when the rule is triggered. By default, we add a leading forward slash to any rule pattern. Specify a pattern without a forward slash.
ruleType This property is required. Number
Type of rule. The rule is applied if the requested URI matches the rule pattern. It has two possible values: Type 0 — RegEx. Must start with '^/' or '/'. Type 1 — RegEx. Legacy type. Note that for this rule type we automatically add / to each rule pattern before your regular expression. Please use Type 0.
cdnRuleId String
The ID of this resource.
name String
Rule name
options Property Map
Each option in CDN resource settings. Each option added to CDN resource settings should have the following mandatory request fields: enabled, value.
originGroup Number
ID of the Origins Group. Use one of your Origins Group or create a new one. You can use either 'origin' parameter or 'originGroup' in the resource definition.
originProtocol String
This option defines the protocol that will be used by CDN servers to request content from an origin source. If not specified, it will be inherit from resource. Possible values are: HTTPS, HTTP, MATCH.
weight Number
Rule weight that determines rule execution order: from the smallest (0) to the highest.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing CdnRule Resource

Get an existing CdnRule 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?: CdnRuleState, opts?: CustomResourceOptions): CdnRule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cdn_rule_id: Optional[str] = None,
        name: Optional[str] = None,
        options: Optional[CdnRuleOptionsArgs] = None,
        origin_group: Optional[float] = None,
        origin_protocol: Optional[str] = None,
        resource_id: Optional[float] = None,
        rule: Optional[str] = None,
        rule_type: Optional[float] = None,
        weight: Optional[float] = None) -> CdnRule
func GetCdnRule(ctx *Context, name string, id IDInput, state *CdnRuleState, opts ...ResourceOption) (*CdnRule, error)
public static CdnRule Get(string name, Input<string> id, CdnRuleState? state, CustomResourceOptions? opts = null)
public static CdnRule get(String name, Output<String> id, CdnRuleState state, CustomResourceOptions options)
resources:  _:    type: gcorelabs:CdnRule    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CdnRuleId string
The ID of this resource.
Name string
Rule name
Options CdnRuleOptions
Each option in CDN resource settings. Each option added to CDN resource settings should have the following mandatory request fields: enabled, value.
OriginGroup double
ID of the Origins Group. Use one of your Origins Group or create a new one. You can use either 'origin' parameter or 'originGroup' in the resource definition.
OriginProtocol string
This option defines the protocol that will be used by CDN servers to request content from an origin source. If not specified, it will be inherit from resource. Possible values are: HTTPS, HTTP, MATCH.
ResourceId double
Rule string
A pattern that defines when the rule is triggered. By default, we add a leading forward slash to any rule pattern. Specify a pattern without a forward slash.
RuleType double
Type of rule. The rule is applied if the requested URI matches the rule pattern. It has two possible values: Type 0 — RegEx. Must start with '^/' or '/'. Type 1 — RegEx. Legacy type. Note that for this rule type we automatically add / to each rule pattern before your regular expression. Please use Type 0.
Weight double
Rule weight that determines rule execution order: from the smallest (0) to the highest.
CdnRuleId string
The ID of this resource.
Name string
Rule name
Options CdnRuleOptionsArgs
Each option in CDN resource settings. Each option added to CDN resource settings should have the following mandatory request fields: enabled, value.
OriginGroup float64
ID of the Origins Group. Use one of your Origins Group or create a new one. You can use either 'origin' parameter or 'originGroup' in the resource definition.
OriginProtocol string
This option defines the protocol that will be used by CDN servers to request content from an origin source. If not specified, it will be inherit from resource. Possible values are: HTTPS, HTTP, MATCH.
ResourceId float64
Rule string
A pattern that defines when the rule is triggered. By default, we add a leading forward slash to any rule pattern. Specify a pattern without a forward slash.
RuleType float64
Type of rule. The rule is applied if the requested URI matches the rule pattern. It has two possible values: Type 0 — RegEx. Must start with '^/' or '/'. Type 1 — RegEx. Legacy type. Note that for this rule type we automatically add / to each rule pattern before your regular expression. Please use Type 0.
Weight float64
Rule weight that determines rule execution order: from the smallest (0) to the highest.
cdnRuleId String
The ID of this resource.
name String
Rule name
options CdnRuleOptions
Each option in CDN resource settings. Each option added to CDN resource settings should have the following mandatory request fields: enabled, value.
originGroup Double
ID of the Origins Group. Use one of your Origins Group or create a new one. You can use either 'origin' parameter or 'originGroup' in the resource definition.
originProtocol String
This option defines the protocol that will be used by CDN servers to request content from an origin source. If not specified, it will be inherit from resource. Possible values are: HTTPS, HTTP, MATCH.
resourceId Double
rule String
A pattern that defines when the rule is triggered. By default, we add a leading forward slash to any rule pattern. Specify a pattern without a forward slash.
ruleType Double
Type of rule. The rule is applied if the requested URI matches the rule pattern. It has two possible values: Type 0 — RegEx. Must start with '^/' or '/'. Type 1 — RegEx. Legacy type. Note that for this rule type we automatically add / to each rule pattern before your regular expression. Please use Type 0.
weight Double
Rule weight that determines rule execution order: from the smallest (0) to the highest.
cdnRuleId string
The ID of this resource.
name string
Rule name
options CdnRuleOptions
Each option in CDN resource settings. Each option added to CDN resource settings should have the following mandatory request fields: enabled, value.
originGroup number
ID of the Origins Group. Use one of your Origins Group or create a new one. You can use either 'origin' parameter or 'originGroup' in the resource definition.
originProtocol string
This option defines the protocol that will be used by CDN servers to request content from an origin source. If not specified, it will be inherit from resource. Possible values are: HTTPS, HTTP, MATCH.
resourceId number
rule string
A pattern that defines when the rule is triggered. By default, we add a leading forward slash to any rule pattern. Specify a pattern without a forward slash.
ruleType number
Type of rule. The rule is applied if the requested URI matches the rule pattern. It has two possible values: Type 0 — RegEx. Must start with '^/' or '/'. Type 1 — RegEx. Legacy type. Note that for this rule type we automatically add / to each rule pattern before your regular expression. Please use Type 0.
weight number
Rule weight that determines rule execution order: from the smallest (0) to the highest.
cdn_rule_id str
The ID of this resource.
name str
Rule name
options CdnRuleOptionsArgs
Each option in CDN resource settings. Each option added to CDN resource settings should have the following mandatory request fields: enabled, value.
origin_group float
ID of the Origins Group. Use one of your Origins Group or create a new one. You can use either 'origin' parameter or 'originGroup' in the resource definition.
origin_protocol str
This option defines the protocol that will be used by CDN servers to request content from an origin source. If not specified, it will be inherit from resource. Possible values are: HTTPS, HTTP, MATCH.
resource_id float
rule str
A pattern that defines when the rule is triggered. By default, we add a leading forward slash to any rule pattern. Specify a pattern without a forward slash.
rule_type float
Type of rule. The rule is applied if the requested URI matches the rule pattern. It has two possible values: Type 0 — RegEx. Must start with '^/' or '/'. Type 1 — RegEx. Legacy type. Note that for this rule type we automatically add / to each rule pattern before your regular expression. Please use Type 0.
weight float
Rule weight that determines rule execution order: from the smallest (0) to the highest.
cdnRuleId String
The ID of this resource.
name String
Rule name
options Property Map
Each option in CDN resource settings. Each option added to CDN resource settings should have the following mandatory request fields: enabled, value.
originGroup Number
ID of the Origins Group. Use one of your Origins Group or create a new one. You can use either 'origin' parameter or 'originGroup' in the resource definition.
originProtocol String
This option defines the protocol that will be used by CDN servers to request content from an origin source. If not specified, it will be inherit from resource. Possible values are: HTTPS, HTTP, MATCH.
resourceId Number
rule String
A pattern that defines when the rule is triggered. By default, we add a leading forward slash to any rule pattern. Specify a pattern without a forward slash.
ruleType Number
Type of rule. The rule is applied if the requested URI matches the rule pattern. It has two possible values: Type 0 — RegEx. Must start with '^/' or '/'. Type 1 — RegEx. Legacy type. Note that for this rule type we automatically add / to each rule pattern before your regular expression. Please use Type 0.
weight Number
Rule weight that determines rule execution order: from the smallest (0) to the highest.

Supporting Types

CdnRuleOptions
, CdnRuleOptionsArgs

BrowserCacheSettings CdnRuleOptionsBrowserCacheSettings
Cors CdnRuleOptionsCors
EdgeCacheSettings CdnRuleOptionsEdgeCacheSettings
The cache expiration time for CDN servers.
GzipOn CdnRuleOptionsGzipOn
HostHeader CdnRuleOptionsHostHeader
Specify the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header. If the option is in NULL state Host Header value is taken from the CNAME field.
IgnoreQueryString CdnRuleOptionsIgnoreQueryString
QueryParamsBlacklist CdnRuleOptionsQueryParamsBlacklist
QueryParamsWhitelist CdnRuleOptionsQueryParamsWhitelist
RedirectHttpToHttps CdnRuleOptionsRedirectHttpToHttps
Sets redirect from HTTP protocol to HTTPS for all resource requests.
Rewrite CdnRuleOptionsRewrite
Sni CdnRuleOptionsSni
StaticHeaders CdnRuleOptionsStaticHeaders
StaticRequestHeaders CdnRuleOptionsStaticRequestHeaders
TlsVersions CdnRuleOptionsTlsVersions
Webp CdnRuleOptionsWebp
Websockets CdnRuleOptionsWebsockets
BrowserCacheSettings CdnRuleOptionsBrowserCacheSettings
Cors CdnRuleOptionsCors
EdgeCacheSettings CdnRuleOptionsEdgeCacheSettings
The cache expiration time for CDN servers.
GzipOn CdnRuleOptionsGzipOn
HostHeader CdnRuleOptionsHostHeader
Specify the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header. If the option is in NULL state Host Header value is taken from the CNAME field.
IgnoreQueryString CdnRuleOptionsIgnoreQueryString
QueryParamsBlacklist CdnRuleOptionsQueryParamsBlacklist
QueryParamsWhitelist CdnRuleOptionsQueryParamsWhitelist
RedirectHttpToHttps CdnRuleOptionsRedirectHttpToHttps
Sets redirect from HTTP protocol to HTTPS for all resource requests.
Rewrite CdnRuleOptionsRewrite
Sni CdnRuleOptionsSni
StaticHeaders CdnRuleOptionsStaticHeaders
StaticRequestHeaders CdnRuleOptionsStaticRequestHeaders
TlsVersions CdnRuleOptionsTlsVersions
Webp CdnRuleOptionsWebp
Websockets CdnRuleOptionsWebsockets
browserCacheSettings CdnRuleOptionsBrowserCacheSettings
cors CdnRuleOptionsCors
edgeCacheSettings CdnRuleOptionsEdgeCacheSettings
The cache expiration time for CDN servers.
gzipOn CdnRuleOptionsGzipOn
hostHeader CdnRuleOptionsHostHeader
Specify the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header. If the option is in NULL state Host Header value is taken from the CNAME field.
ignoreQueryString CdnRuleOptionsIgnoreQueryString
queryParamsBlacklist CdnRuleOptionsQueryParamsBlacklist
queryParamsWhitelist CdnRuleOptionsQueryParamsWhitelist
redirectHttpToHttps CdnRuleOptionsRedirectHttpToHttps
Sets redirect from HTTP protocol to HTTPS for all resource requests.
rewrite CdnRuleOptionsRewrite
sni CdnRuleOptionsSni
staticHeaders CdnRuleOptionsStaticHeaders
staticRequestHeaders CdnRuleOptionsStaticRequestHeaders
tlsVersions CdnRuleOptionsTlsVersions
webp CdnRuleOptionsWebp
websockets CdnRuleOptionsWebsockets
browser_cache_settings CdnRuleOptionsBrowserCacheSettings
cors CdnRuleOptionsCors
edge_cache_settings CdnRuleOptionsEdgeCacheSettings
The cache expiration time for CDN servers.
gzip_on CdnRuleOptionsGzipOn
host_header CdnRuleOptionsHostHeader
Specify the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header. If the option is in NULL state Host Header value is taken from the CNAME field.
ignore_query_string CdnRuleOptionsIgnoreQueryString
query_params_blacklist CdnRuleOptionsQueryParamsBlacklist
query_params_whitelist CdnRuleOptionsQueryParamsWhitelist
redirect_http_to_https CdnRuleOptionsRedirectHttpToHttps
Sets redirect from HTTP protocol to HTTPS for all resource requests.
rewrite CdnRuleOptionsRewrite
sni CdnRuleOptionsSni
static_headers CdnRuleOptionsStaticHeaders
static_request_headers CdnRuleOptionsStaticRequestHeaders
tls_versions CdnRuleOptionsTlsVersions
webp CdnRuleOptionsWebp
websockets CdnRuleOptionsWebsockets
browserCacheSettings Property Map
cors Property Map
edgeCacheSettings Property Map
The cache expiration time for CDN servers.
gzipOn Property Map
hostHeader Property Map
Specify the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header. If the option is in NULL state Host Header value is taken from the CNAME field.
ignoreQueryString Property Map
queryParamsBlacklist Property Map
queryParamsWhitelist Property Map
redirectHttpToHttps Property Map
Sets redirect from HTTP protocol to HTTPS for all resource requests.
rewrite Property Map
sni Property Map
staticHeaders Property Map
staticRequestHeaders Property Map
tlsVersions Property Map
webp Property Map
websockets Property Map

CdnRuleOptionsBrowserCacheSettings
, CdnRuleOptionsBrowserCacheSettingsArgs

Enabled bool
Value string
Enabled bool
Value string
enabled Boolean
value String
enabled boolean
value string
enabled bool
value str
enabled Boolean
value String

CdnRuleOptionsCors
, CdnRuleOptionsCorsArgs

Values This property is required. List<string>
Enabled bool
Values This property is required. []string
Enabled bool
values This property is required. List<String>
enabled Boolean
values This property is required. string[]
enabled boolean
values This property is required. Sequence[str]
enabled bool
values This property is required. List<String>
enabled Boolean

CdnRuleOptionsEdgeCacheSettings
, CdnRuleOptionsEdgeCacheSettingsArgs

CustomValues Dictionary<string, string>
Caching time for a response with specific codes. These settings have a higher priority than the value field. Response code ('304', '404' for example). Use 'any' to specify caching time for all response codes. Caching time in seconds ('0s', '600s' for example). Use '0s' to disable caching for a specific response code.
Default string
Content will be cached according to origin cache settings. The value applies for a response with codes 200, 201, 204, 206, 301, 302, 303, 304, 307, 308 if an origin server does not have caching HTTP headers. Responses with other codes will not be cached.
Enabled bool
Value string
Caching time for a response with codes 200, 206, 301, 302. Responses with codes 4xx, 5xx will not be cached. Use '0s' disable to caching. Use custom_values field to specify a custom caching time for a response with specific codes.
CustomValues map[string]string
Caching time for a response with specific codes. These settings have a higher priority than the value field. Response code ('304', '404' for example). Use 'any' to specify caching time for all response codes. Caching time in seconds ('0s', '600s' for example). Use '0s' to disable caching for a specific response code.
Default string
Content will be cached according to origin cache settings. The value applies for a response with codes 200, 201, 204, 206, 301, 302, 303, 304, 307, 308 if an origin server does not have caching HTTP headers. Responses with other codes will not be cached.
Enabled bool
Value string
Caching time for a response with codes 200, 206, 301, 302. Responses with codes 4xx, 5xx will not be cached. Use '0s' disable to caching. Use custom_values field to specify a custom caching time for a response with specific codes.
customValues Map<String,String>
Caching time for a response with specific codes. These settings have a higher priority than the value field. Response code ('304', '404' for example). Use 'any' to specify caching time for all response codes. Caching time in seconds ('0s', '600s' for example). Use '0s' to disable caching for a specific response code.
default_ String
Content will be cached according to origin cache settings. The value applies for a response with codes 200, 201, 204, 206, 301, 302, 303, 304, 307, 308 if an origin server does not have caching HTTP headers. Responses with other codes will not be cached.
enabled Boolean
value String
Caching time for a response with codes 200, 206, 301, 302. Responses with codes 4xx, 5xx will not be cached. Use '0s' disable to caching. Use custom_values field to specify a custom caching time for a response with specific codes.
customValues {[key: string]: string}
Caching time for a response with specific codes. These settings have a higher priority than the value field. Response code ('304', '404' for example). Use 'any' to specify caching time for all response codes. Caching time in seconds ('0s', '600s' for example). Use '0s' to disable caching for a specific response code.
default string
Content will be cached according to origin cache settings. The value applies for a response with codes 200, 201, 204, 206, 301, 302, 303, 304, 307, 308 if an origin server does not have caching HTTP headers. Responses with other codes will not be cached.
enabled boolean
value string
Caching time for a response with codes 200, 206, 301, 302. Responses with codes 4xx, 5xx will not be cached. Use '0s' disable to caching. Use custom_values field to specify a custom caching time for a response with specific codes.
custom_values Mapping[str, str]
Caching time for a response with specific codes. These settings have a higher priority than the value field. Response code ('304', '404' for example). Use 'any' to specify caching time for all response codes. Caching time in seconds ('0s', '600s' for example). Use '0s' to disable caching for a specific response code.
default str
Content will be cached according to origin cache settings. The value applies for a response with codes 200, 201, 204, 206, 301, 302, 303, 304, 307, 308 if an origin server does not have caching HTTP headers. Responses with other codes will not be cached.
enabled bool
value str
Caching time for a response with codes 200, 206, 301, 302. Responses with codes 4xx, 5xx will not be cached. Use '0s' disable to caching. Use custom_values field to specify a custom caching time for a response with specific codes.
customValues Map<String>
Caching time for a response with specific codes. These settings have a higher priority than the value field. Response code ('304', '404' for example). Use 'any' to specify caching time for all response codes. Caching time in seconds ('0s', '600s' for example). Use '0s' to disable caching for a specific response code.
default String
Content will be cached according to origin cache settings. The value applies for a response with codes 200, 201, 204, 206, 301, 302, 303, 304, 307, 308 if an origin server does not have caching HTTP headers. Responses with other codes will not be cached.
enabled Boolean
value String
Caching time for a response with codes 200, 206, 301, 302. Responses with codes 4xx, 5xx will not be cached. Use '0s' disable to caching. Use custom_values field to specify a custom caching time for a response with specific codes.

CdnRuleOptionsGzipOn
, CdnRuleOptionsGzipOnArgs

Value This property is required. bool
Enabled bool
Value This property is required. bool
Enabled bool
value This property is required. Boolean
enabled Boolean
value This property is required. boolean
enabled boolean
value This property is required. bool
enabled bool
value This property is required. Boolean
enabled Boolean

CdnRuleOptionsHostHeader
, CdnRuleOptionsHostHeaderArgs

Value This property is required. string
Enabled bool
Value This property is required. string
Enabled bool
value This property is required. String
enabled Boolean
value This property is required. string
enabled boolean
value This property is required. str
enabled bool
value This property is required. String
enabled Boolean

CdnRuleOptionsIgnoreQueryString
, CdnRuleOptionsIgnoreQueryStringArgs

Value This property is required. bool
Enabled bool
Value This property is required. bool
Enabled bool
value This property is required. Boolean
enabled Boolean
value This property is required. boolean
enabled boolean
value This property is required. bool
enabled bool
value This property is required. Boolean
enabled Boolean

CdnRuleOptionsQueryParamsBlacklist
, CdnRuleOptionsQueryParamsBlacklistArgs

Values This property is required. List<string>
Enabled bool
Values This property is required. []string
Enabled bool
values This property is required. List<String>
enabled Boolean
values This property is required. string[]
enabled boolean
values This property is required. Sequence[str]
enabled bool
values This property is required. List<String>
enabled Boolean

CdnRuleOptionsQueryParamsWhitelist
, CdnRuleOptionsQueryParamsWhitelistArgs

Values This property is required. List<string>
Enabled bool
Values This property is required. []string
Enabled bool
values This property is required. List<String>
enabled Boolean
values This property is required. string[]
enabled boolean
values This property is required. Sequence[str]
enabled bool
values This property is required. List<String>
enabled Boolean

CdnRuleOptionsRedirectHttpToHttps
, CdnRuleOptionsRedirectHttpToHttpsArgs

Value This property is required. bool
Enabled bool
Value This property is required. bool
Enabled bool
value This property is required. Boolean
enabled Boolean
value This property is required. boolean
enabled boolean
value This property is required. bool
enabled bool
value This property is required. Boolean
enabled Boolean

CdnRuleOptionsRewrite
, CdnRuleOptionsRewriteArgs

Body This property is required. string
Enabled bool
Flag string
Body This property is required. string
Enabled bool
Flag string
body This property is required. String
enabled Boolean
flag String
body This property is required. string
enabled boolean
flag string
body This property is required. str
enabled bool
flag str
body This property is required. String
enabled Boolean
flag String

CdnRuleOptionsSni
, CdnRuleOptionsSniArgs

CustomHostname string
Required to set custom hostname in case sni-type='custom'
Enabled bool
SniType string
Available values 'dynamic' or 'custom'
CustomHostname string
Required to set custom hostname in case sni-type='custom'
Enabled bool
SniType string
Available values 'dynamic' or 'custom'
customHostname String
Required to set custom hostname in case sni-type='custom'
enabled Boolean
sniType String
Available values 'dynamic' or 'custom'
customHostname string
Required to set custom hostname in case sni-type='custom'
enabled boolean
sniType string
Available values 'dynamic' or 'custom'
custom_hostname str
Required to set custom hostname in case sni-type='custom'
enabled bool
sni_type str
Available values 'dynamic' or 'custom'
customHostname String
Required to set custom hostname in case sni-type='custom'
enabled Boolean
sniType String
Available values 'dynamic' or 'custom'

CdnRuleOptionsStaticHeaders
, CdnRuleOptionsStaticHeadersArgs

Value This property is required. Dictionary<string, string>
Enabled bool
Value This property is required. map[string]string
Enabled bool
value This property is required. Map<String,String>
enabled Boolean
value This property is required. {[key: string]: string}
enabled boolean
value This property is required. Mapping[str, str]
enabled bool
value This property is required. Map<String>
enabled Boolean

CdnRuleOptionsStaticRequestHeaders
, CdnRuleOptionsStaticRequestHeadersArgs

Value This property is required. Dictionary<string, string>
Enabled bool
Value This property is required. map[string]string
Enabled bool
value This property is required. Map<String,String>
enabled Boolean
value This property is required. {[key: string]: string}
enabled boolean
value This property is required. Mapping[str, str]
enabled bool
value This property is required. Map<String>
enabled Boolean

CdnRuleOptionsTlsVersions
, CdnRuleOptionsTlsVersionsArgs

Values This property is required. List<string>
Enabled bool
Values This property is required. []string
Enabled bool
values This property is required. List<String>
enabled Boolean
values This property is required. string[]
enabled boolean
values This property is required. Sequence[str]
enabled bool
values This property is required. List<String>
enabled Boolean

CdnRuleOptionsWebp
, CdnRuleOptionsWebpArgs

JpgQuality This property is required. double
PngQuality This property is required. double
Enabled bool
PngLossless bool
JpgQuality This property is required. float64
PngQuality This property is required. float64
Enabled bool
PngLossless bool
jpgQuality This property is required. Double
pngQuality This property is required. Double
enabled Boolean
pngLossless Boolean
jpgQuality This property is required. number
pngQuality This property is required. number
enabled boolean
pngLossless boolean
jpg_quality This property is required. float
png_quality This property is required. float
enabled bool
png_lossless bool
jpgQuality This property is required. Number
pngQuality This property is required. Number
enabled Boolean
pngLossless Boolean

CdnRuleOptionsWebsockets
, CdnRuleOptionsWebsocketsArgs

Value This property is required. bool
Enabled bool
Value This property is required. bool
Enabled bool
value This property is required. Boolean
enabled Boolean
value This property is required. boolean
enabled boolean
value This property is required. bool
enabled bool
value This property is required. Boolean
enabled Boolean

Package Details

Repository
gcorelabs g-core/terraform-provider-gcorelabs
License
Notes
This Pulumi package is based on the gcorelabs Terraform Provider.