1. Packages
  2. Volcengine
  3. API Docs
  4. cdn
  5. Configs
Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine

volcengine.cdn.Configs

Explore with Pulumi AI

Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine

Use this data source to query detailed information of cdn configs

Example Usage

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

const fooCdnCertificate = new volcengine.cdn.CdnCertificate("fooCdnCertificate", {
    certificate: "",
    privateKey: "",
    desc: "tftest",
    source: "cdn_cert_hosting",
});
const fooCdnDomain = new volcengine.cdn.CdnDomain("fooCdnDomain", {
    domain: "tftest.byte-test.com",
    serviceType: "web",
    tags: [
        {
            key: "tfkey1",
            value: "tfvalue1",
        },
        {
            key: "tfkey2",
            value: "tfvalue2",
        },
    ],
    domainConfig: pulumi.jsonStringify({
        OriginProtocol: "https",
        Origin: [{
            OriginAction: {
                OriginLines: [{
                    Address: "1.1.1.1",
                    HttpPort: "80",
                    HttpsPort: "443",
                    InstanceType: "ip",
                    OriginType: "primary",
                    PrivateBucketAccess: false,
                    Weight: "2",
                }],
            },
        }],
        HTTPS: {
            CertInfo: {
                CertId: fooCdnCertificate.id,
            },
            DisableHttp: false,
            HTTP2: true,
            Switch: true,
            Ocsp: false,
            TlsVersion: [
                "tlsv1.1",
                "tlsv1.2",
            ],
        },
    }),
});
const fooConfigs = volcengine.cdn.ConfigsOutput({
    domain: fooCdnDomain.id,
});
Copy
import pulumi
import json
import pulumi_volcengine as volcengine

foo_cdn_certificate = volcengine.cdn.CdnCertificate("fooCdnCertificate",
    certificate="",
    private_key="",
    desc="tftest",
    source="cdn_cert_hosting")
foo_cdn_domain = volcengine.cdn.CdnDomain("fooCdnDomain",
    domain="tftest.byte-test.com",
    service_type="web",
    tags=[
        volcengine.cdn.CdnDomainTagArgs(
            key="tfkey1",
            value="tfvalue1",
        ),
        volcengine.cdn.CdnDomainTagArgs(
            key="tfkey2",
            value="tfvalue2",
        ),
    ],
    domain_config=pulumi.Output.json_dumps({
        "OriginProtocol": "https",
        "Origin": [{
            "OriginAction": {
                "OriginLines": [{
                    "Address": "1.1.1.1",
                    "HttpPort": "80",
                    "HttpsPort": "443",
                    "InstanceType": "ip",
                    "OriginType": "primary",
                    "PrivateBucketAccess": False,
                    "Weight": "2",
                }],
            },
        }],
        "HTTPS": {
            "CertInfo": {
                "CertId": foo_cdn_certificate.id,
            },
            "DisableHttp": False,
            "HTTP2": True,
            "Switch": True,
            "Ocsp": False,
            "TlsVersion": [
                "tlsv1.1",
                "tlsv1.2",
            ],
        },
    }))
foo_configs = volcengine.cdn.configs_output(domain=foo_cdn_domain.id)
Copy
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/cdn"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		fooCdnCertificate, err := cdn.NewCdnCertificate(ctx, "fooCdnCertificate", &cdn.CdnCertificateArgs{
			Certificate: pulumi.String(""),
			PrivateKey:  pulumi.String(""),
			Desc:        pulumi.String("tftest"),
			Source:      pulumi.String("cdn_cert_hosting"),
		})
		if err != nil {
			return err
		}
		fooCdnDomain, err := cdn.NewCdnDomain(ctx, "fooCdnDomain", &cdn.CdnDomainArgs{
			Domain:      pulumi.String("tftest.byte-test.com"),
			ServiceType: pulumi.String("web"),
			Tags: cdn.CdnDomainTagArray{
				&cdn.CdnDomainTagArgs{
					Key:   pulumi.String("tfkey1"),
					Value: pulumi.String("tfvalue1"),
				},
				&cdn.CdnDomainTagArgs{
					Key:   pulumi.String("tfkey2"),
					Value: pulumi.String("tfvalue2"),
				},
			},
			DomainConfig: fooCdnCertificate.ID().ApplyT(func(id string) (pulumi.String, error) {
				var _zero pulumi.String
				tmpJSON0, err := json.Marshal(map[string]interface{}{
					"OriginProtocol": "https",
					"Origin": []map[string]interface{}{
						map[string]interface{}{
							"OriginAction": map[string]interface{}{
								"OriginLines": []map[string]interface{}{
									map[string]interface{}{
										"Address":             "1.1.1.1",
										"HttpPort":            "80",
										"HttpsPort":           "443",
										"InstanceType":        "ip",
										"OriginType":          "primary",
										"PrivateBucketAccess": false,
										"Weight":              "2",
									},
								},
							},
						},
					},
					"HTTPS": map[string]interface{}{
						"CertInfo": map[string]interface{}{
							"CertId": id,
						},
						"DisableHttp": false,
						"HTTP2":       true,
						"Switch":      true,
						"Ocsp":        false,
						"TlsVersion": []string{
							"tlsv1.1",
							"tlsv1.2",
						},
					},
				})
				if err != nil {
					return _zero, err
				}
				json0 := string(tmpJSON0)
				return pulumi.String(json0), nil
			}).(pulumi.StringOutput),
		})
		if err != nil {
			return err
		}
		_ = cdn.ConfigsOutput(ctx, cdn.ConfigsOutputArgs{
			Domain: fooCdnDomain.ID(),
		}, nil)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Volcengine = Pulumi.Volcengine;

return await Deployment.RunAsync(() => 
{
    var fooCdnCertificate = new Volcengine.Cdn.CdnCertificate("fooCdnCertificate", new()
    {
        Certificate = "",
        PrivateKey = "",
        Desc = "tftest",
        Source = "cdn_cert_hosting",
    });

    var fooCdnDomain = new Volcengine.Cdn.CdnDomain("fooCdnDomain", new()
    {
        Domain = "tftest.byte-test.com",
        ServiceType = "web",
        Tags = new[]
        {
            new Volcengine.Cdn.Inputs.CdnDomainTagArgs
            {
                Key = "tfkey1",
                Value = "tfvalue1",
            },
            new Volcengine.Cdn.Inputs.CdnDomainTagArgs
            {
                Key = "tfkey2",
                Value = "tfvalue2",
            },
        },
        DomainConfig = Output.JsonSerialize(Output.Create(new Dictionary<string, object?>
        {
            ["OriginProtocol"] = "https",
            ["Origin"] = new[]
            {
                new Dictionary<string, object?>
                {
                    ["OriginAction"] = new Dictionary<string, object?>
                    {
                        ["OriginLines"] = new[]
                        {
                            new Dictionary<string, object?>
                            {
                                ["Address"] = "1.1.1.1",
                                ["HttpPort"] = "80",
                                ["HttpsPort"] = "443",
                                ["InstanceType"] = "ip",
                                ["OriginType"] = "primary",
                                ["PrivateBucketAccess"] = false,
                                ["Weight"] = "2",
                            },
                        },
                    },
                },
            },
            ["HTTPS"] = new Dictionary<string, object?>
            {
                ["CertInfo"] = new Dictionary<string, object?>
                {
                    ["CertId"] = fooCdnCertificate.Id,
                },
                ["DisableHttp"] = false,
                ["HTTP2"] = true,
                ["Switch"] = true,
                ["Ocsp"] = false,
                ["TlsVersion"] = new[]
                {
                    "tlsv1.1",
                    "tlsv1.2",
                },
            },
        })),
    });

    var fooConfigs = Volcengine.Cdn.Configs.Invoke(new()
    {
        Domain = fooCdnDomain.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.volcengine.cdn.CdnCertificate;
import com.pulumi.volcengine.cdn.CdnCertificateArgs;
import com.pulumi.volcengine.cdn.CdnDomain;
import com.pulumi.volcengine.cdn.CdnDomainArgs;
import com.pulumi.volcengine.cdn.inputs.CdnDomainTagArgs;
import com.pulumi.volcengine.cdn.CdnFunctions;
import com.pulumi.volcengine.cdn.inputs.ConfigsArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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) {
        var fooCdnCertificate = new CdnCertificate("fooCdnCertificate", CdnCertificateArgs.builder()        
            .certificate("")
            .privateKey("")
            .desc("tftest")
            .source("cdn_cert_hosting")
            .build());

        var fooCdnDomain = new CdnDomain("fooCdnDomain", CdnDomainArgs.builder()        
            .domain("tftest.byte-test.com")
            .serviceType("web")
            .tags(            
                CdnDomainTagArgs.builder()
                    .key("tfkey1")
                    .value("tfvalue1")
                    .build(),
                CdnDomainTagArgs.builder()
                    .key("tfkey2")
                    .value("tfvalue2")
                    .build())
            .domainConfig(fooCdnCertificate.id().applyValue(id -> serializeJson(
                jsonObject(
                    jsonProperty("OriginProtocol", "https"),
                    jsonProperty("Origin", jsonArray(jsonObject(
                        jsonProperty("OriginAction", jsonObject(
                            jsonProperty("OriginLines", jsonArray(jsonObject(
                                jsonProperty("Address", "1.1.1.1"),
                                jsonProperty("HttpPort", "80"),
                                jsonProperty("HttpsPort", "443"),
                                jsonProperty("InstanceType", "ip"),
                                jsonProperty("OriginType", "primary"),
                                jsonProperty("PrivateBucketAccess", false),
                                jsonProperty("Weight", "2")
                            )))
                        ))
                    ))),
                    jsonProperty("HTTPS", jsonObject(
                        jsonProperty("CertInfo", jsonObject(
                            jsonProperty("CertId", id)
                        )),
                        jsonProperty("DisableHttp", false),
                        jsonProperty("HTTP2", true),
                        jsonProperty("Switch", true),
                        jsonProperty("Ocsp", false),
                        jsonProperty("TlsVersion", jsonArray(
                            "tlsv1.1", 
                            "tlsv1.2"
                        ))
                    ))
                ))))
            .build());

        final var fooConfigs = CdnFunctions.Configs(ConfigsArgs.builder()
            .domain(fooCdnDomain.id())
            .build());

    }
}
Copy
resources:
  fooCdnCertificate:
    type: volcengine:cdn:CdnCertificate
    properties:
      certificate:
      privateKey:
      desc: tftest
      source: cdn_cert_hosting
  fooCdnDomain:
    type: volcengine:cdn:CdnDomain
    properties:
      domain: tftest.byte-test.com
      serviceType: web
      tags:
        - key: tfkey1
          value: tfvalue1
        - key: tfkey2
          value: tfvalue2
      domainConfig:
        fn::toJSON:
          OriginProtocol: https
          Origin:
            - OriginAction:
                OriginLines:
                  - Address: 1.1.1.1
                    HttpPort: '80'
                    HttpsPort: '443'
                    InstanceType: ip
                    OriginType: primary
                    PrivateBucketAccess: false
                    Weight: '2'
          HTTPS:
            CertInfo:
              CertId: ${fooCdnCertificate.id}
            DisableHttp: false
            HTTP2: true
            Switch: true
            Ocsp: false
            TlsVersion:
              - tlsv1.1
              - tlsv1.2
variables:
  fooConfigs:
    fn::invoke:
      Function: volcengine:cdn:Configs
      Arguments:
        domain: ${fooCdnDomain.id}
Copy

Using Configs

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 configs(args: ConfigsArgs, opts?: InvokeOptions): Promise<ConfigsResult>
function configsOutput(args: ConfigsOutputArgs, opts?: InvokeOptions): Output<ConfigsResult>
Copy
def configs(domain: Optional[str] = None,
            output_file: Optional[str] = None,
            opts: Optional[InvokeOptions] = None) -> ConfigsResult
def configs_output(domain: Optional[pulumi.Input[str]] = None,
            output_file: Optional[pulumi.Input[str]] = None,
            opts: Optional[InvokeOptions] = None) -> Output[ConfigsResult]
Copy
func Configs(ctx *Context, args *ConfigsArgs, opts ...InvokeOption) (*ConfigsResult, error)
func ConfigsOutput(ctx *Context, args *ConfigsOutputArgs, opts ...InvokeOption) ConfigsResultOutput
Copy
public static class Configs 
{
    public static Task<ConfigsResult> InvokeAsync(ConfigsArgs args, InvokeOptions? opts = null)
    public static Output<ConfigsResult> Invoke(ConfigsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<ConfigsResult> configs(ConfigsArgs args, InvokeOptions options)
public static Output<ConfigsResult> configs(ConfigsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: volcengine:cdn:Configs
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Domain This property is required. string
The domain name.
OutputFile string
File name where to save data source results.
Domain This property is required. string
The domain name.
OutputFile string
File name where to save data source results.
domain This property is required. String
The domain name.
outputFile String
File name where to save data source results.
domain This property is required. string
The domain name.
outputFile string
File name where to save data source results.
domain This property is required. str
The domain name.
output_file str
File name where to save data source results.
domain This property is required. String
The domain name.
outputFile String
File name where to save data source results.

Configs Result

The following output properties are available:

Domain string
The domain name.
DomainConfigs List<ConfigsDomainConfig>
The collection of query.
Id string
The provider-assigned unique ID for this managed resource.
TotalCount int
The total count of query.
OutputFile string
Domain string
The domain name.
DomainConfigs []ConfigsDomainConfig
The collection of query.
Id string
The provider-assigned unique ID for this managed resource.
TotalCount int
The total count of query.
OutputFile string
domain String
The domain name.
domainConfigs List<ConfigsDomainConfig>
The collection of query.
id String
The provider-assigned unique ID for this managed resource.
totalCount Integer
The total count of query.
outputFile String
domain string
The domain name.
domainConfigs ConfigsDomainConfig[]
The collection of query.
id string
The provider-assigned unique ID for this managed resource.
totalCount number
The total count of query.
outputFile string
domain str
The domain name.
domain_configs Sequence[ConfigsDomainConfig]
The collection of query.
id str
The provider-assigned unique ID for this managed resource.
total_count int
The total count of query.
output_file str
domain String
The domain name.
domainConfigs List<Property Map>
The collection of query.
id String
The provider-assigned unique ID for this managed resource.
totalCount Number
The total count of query.
outputFile String

Supporting Types

ConfigsDomainConfig

Cname This property is required. string
The cname of the domain.
CreateTime This property is required. int
The create time of the domain.
Domain This property is required. string
The domain name.
LockStatus This property is required. string
Indicates whether the configuration of this domain name is allowed to be changed.
Project This property is required. string
The project name.
ServiceRegion This property is required. string
The service region of the domain.
ServiceType This property is required. string
The service type of the domain.
Status This property is required. string
The status of the domain.
UpdateTime This property is required. int
The update time of the domain.
Cname This property is required. string
The cname of the domain.
CreateTime This property is required. int
The create time of the domain.
Domain This property is required. string
The domain name.
LockStatus This property is required. string
Indicates whether the configuration of this domain name is allowed to be changed.
Project This property is required. string
The project name.
ServiceRegion This property is required. string
The service region of the domain.
ServiceType This property is required. string
The service type of the domain.
Status This property is required. string
The status of the domain.
UpdateTime This property is required. int
The update time of the domain.
cname This property is required. String
The cname of the domain.
createTime This property is required. Integer
The create time of the domain.
domain This property is required. String
The domain name.
lockStatus This property is required. String
Indicates whether the configuration of this domain name is allowed to be changed.
project This property is required. String
The project name.
serviceRegion This property is required. String
The service region of the domain.
serviceType This property is required. String
The service type of the domain.
status This property is required. String
The status of the domain.
updateTime This property is required. Integer
The update time of the domain.
cname This property is required. string
The cname of the domain.
createTime This property is required. number
The create time of the domain.
domain This property is required. string
The domain name.
lockStatus This property is required. string
Indicates whether the configuration of this domain name is allowed to be changed.
project This property is required. string
The project name.
serviceRegion This property is required. string
The service region of the domain.
serviceType This property is required. string
The service type of the domain.
status This property is required. string
The status of the domain.
updateTime This property is required. number
The update time of the domain.
cname This property is required. str
The cname of the domain.
create_time This property is required. int
The create time of the domain.
domain This property is required. str
The domain name.
lock_status This property is required. str
Indicates whether the configuration of this domain name is allowed to be changed.
project This property is required. str
The project name.
service_region This property is required. str
The service region of the domain.
service_type This property is required. str
The service type of the domain.
status This property is required. str
The status of the domain.
update_time This property is required. int
The update time of the domain.
cname This property is required. String
The cname of the domain.
createTime This property is required. Number
The create time of the domain.
domain This property is required. String
The domain name.
lockStatus This property is required. String
Indicates whether the configuration of this domain name is allowed to be changed.
project This property is required. String
The project name.
serviceRegion This property is required. String
The service region of the domain.
serviceType This property is required. String
The service type of the domain.
status This property is required. String
The status of the domain.
updateTime This property is required. Number
The update time of the domain.

Package Details

Repository
volcengine volcengine/pulumi-volcengine
License
Apache-2.0
Notes
This Pulumi package is based on the volcengine Terraform Provider.
Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine