alicloud.cdn.RealTimeLogDelivery
Explore with Pulumi AI
Provides a CDN Real Time Log Delivery resource.
For information about CDN Real Time Log Delivery and how to use it, see What is Real Time Log Delivery.
NOTE: Available since v1.134.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as random from "@pulumi/random";
const defaultInteger = new random.index.Integer("default", {
max: 99999,
min: 10000,
});
const defaultDomainNew = new alicloud.cdn.DomainNew("default", {
scope: "overseas",
domainName: `mycdndomain-${defaultInteger.result}.alicloud-provider.cn`,
cdnType: "web",
sources: [{
type: "ipaddr",
content: "1.1.3.1",
priority: 20,
port: 80,
weight: 15,
}],
});
const defaultProject = new alicloud.log.Project("default", {
projectName: `terraform-example-${defaultInteger.result}`,
description: "terraform-example",
});
const defaultStore = new alicloud.log.Store("default", {
projectName: defaultProject.projectName,
logstoreName: "example-store",
shardCount: 3,
autoSplit: true,
maxSplitShardCount: 60,
appendMeta: true,
});
const default = alicloud.getRegions({
current: true,
});
const defaultRealTimeLogDelivery = new alicloud.cdn.RealTimeLogDelivery("default", {
domain: defaultDomainNew.domainName,
logstore: defaultStore.logstoreName,
project: defaultProject.projectName,
slsRegion: _default.then(_default => _default.regions?.[0]?.id),
});
import pulumi
import pulumi_alicloud as alicloud
import pulumi_random as random
default_integer = random.index.Integer("default",
max=99999,
min=10000)
default_domain_new = alicloud.cdn.DomainNew("default",
scope="overseas",
domain_name=f"mycdndomain-{default_integer['result']}.alicloud-provider.cn",
cdn_type="web",
sources=[{
"type": "ipaddr",
"content": "1.1.3.1",
"priority": 20,
"port": 80,
"weight": 15,
}])
default_project = alicloud.log.Project("default",
project_name=f"terraform-example-{default_integer['result']}",
description="terraform-example")
default_store = alicloud.log.Store("default",
project_name=default_project.project_name,
logstore_name="example-store",
shard_count=3,
auto_split=True,
max_split_shard_count=60,
append_meta=True)
default = alicloud.get_regions(current=True)
default_real_time_log_delivery = alicloud.cdn.RealTimeLogDelivery("default",
domain=default_domain_new.domain_name,
logstore=default_store.logstore_name,
project=default_project.project_name,
sls_region=default.regions[0].id)
package main
import (
"fmt"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cdn"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
"github.com/pulumi/pulumi-random/sdk/v4/go/random"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
defaultInteger, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
Max: 99999,
Min: 10000,
})
if err != nil {
return err
}
defaultDomainNew, err := cdn.NewDomainNew(ctx, "default", &cdn.DomainNewArgs{
Scope: pulumi.String("overseas"),
DomainName: pulumi.Sprintf("mycdndomain-%v.alicloud-provider.cn", defaultInteger.Result),
CdnType: pulumi.String("web"),
Sources: cdn.DomainNewSourceArray{
&cdn.DomainNewSourceArgs{
Type: pulumi.String("ipaddr"),
Content: pulumi.String("1.1.3.1"),
Priority: pulumi.Int(20),
Port: pulumi.Int(80),
Weight: pulumi.Int(15),
},
},
})
if err != nil {
return err
}
defaultProject, err := log.NewProject(ctx, "default", &log.ProjectArgs{
ProjectName: pulumi.Sprintf("terraform-example-%v", defaultInteger.Result),
Description: pulumi.String("terraform-example"),
})
if err != nil {
return err
}
defaultStore, err := log.NewStore(ctx, "default", &log.StoreArgs{
ProjectName: defaultProject.ProjectName,
LogstoreName: pulumi.String("example-store"),
ShardCount: pulumi.Int(3),
AutoSplit: pulumi.Bool(true),
MaxSplitShardCount: pulumi.Int(60),
AppendMeta: pulumi.Bool(true),
})
if err != nil {
return err
}
_default, err := alicloud.GetRegions(ctx, &alicloud.GetRegionsArgs{
Current: pulumi.BoolRef(true),
}, nil)
if err != nil {
return err
}
_, err = cdn.NewRealTimeLogDelivery(ctx, "default", &cdn.RealTimeLogDeliveryArgs{
Domain: defaultDomainNew.DomainName,
Logstore: defaultStore.LogstoreName,
Project: defaultProject.ProjectName,
SlsRegion: pulumi.String(_default.Regions[0].Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Random = Pulumi.Random;
return await Deployment.RunAsync(() =>
{
var defaultInteger = new Random.Index.Integer("default", new()
{
Max = 99999,
Min = 10000,
});
var defaultDomainNew = new AliCloud.Cdn.DomainNew("default", new()
{
Scope = "overseas",
DomainName = $"mycdndomain-{defaultInteger.Result}.alicloud-provider.cn",
CdnType = "web",
Sources = new[]
{
new AliCloud.Cdn.Inputs.DomainNewSourceArgs
{
Type = "ipaddr",
Content = "1.1.3.1",
Priority = 20,
Port = 80,
Weight = 15,
},
},
});
var defaultProject = new AliCloud.Log.Project("default", new()
{
ProjectName = $"terraform-example-{defaultInteger.Result}",
Description = "terraform-example",
});
var defaultStore = new AliCloud.Log.Store("default", new()
{
ProjectName = defaultProject.ProjectName,
LogstoreName = "example-store",
ShardCount = 3,
AutoSplit = true,
MaxSplitShardCount = 60,
AppendMeta = true,
});
var @default = AliCloud.GetRegions.Invoke(new()
{
Current = true,
});
var defaultRealTimeLogDelivery = new AliCloud.Cdn.RealTimeLogDelivery("default", new()
{
Domain = defaultDomainNew.DomainName,
Logstore = defaultStore.LogstoreName,
Project = defaultProject.ProjectName,
SlsRegion = @default.Apply(@default => @default.Apply(getRegionsResult => getRegionsResult.Regions[0]?.Id)),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.integer;
import com.pulumi.random.IntegerArgs;
import com.pulumi.alicloud.cdn.DomainNew;
import com.pulumi.alicloud.cdn.DomainNewArgs;
import com.pulumi.alicloud.cdn.inputs.DomainNewSourceArgs;
import com.pulumi.alicloud.log.Project;
import com.pulumi.alicloud.log.ProjectArgs;
import com.pulumi.alicloud.log.Store;
import com.pulumi.alicloud.log.StoreArgs;
import com.pulumi.alicloud.AlicloudFunctions;
import com.pulumi.alicloud.inputs.GetRegionsArgs;
import com.pulumi.alicloud.cdn.RealTimeLogDelivery;
import com.pulumi.alicloud.cdn.RealTimeLogDeliveryArgs;
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 defaultInteger = new Integer("defaultInteger", IntegerArgs.builder()
.max(99999)
.min(10000)
.build());
var defaultDomainNew = new DomainNew("defaultDomainNew", DomainNewArgs.builder()
.scope("overseas")
.domainName(String.format("mycdndomain-%s.alicloud-provider.cn", defaultInteger.result()))
.cdnType("web")
.sources(DomainNewSourceArgs.builder()
.type("ipaddr")
.content("1.1.3.1")
.priority(20)
.port(80)
.weight(15)
.build())
.build());
var defaultProject = new Project("defaultProject", ProjectArgs.builder()
.projectName(String.format("terraform-example-%s", defaultInteger.result()))
.description("terraform-example")
.build());
var defaultStore = new Store("defaultStore", StoreArgs.builder()
.projectName(defaultProject.projectName())
.logstoreName("example-store")
.shardCount(3)
.autoSplit(true)
.maxSplitShardCount(60)
.appendMeta(true)
.build());
final var default = AlicloudFunctions.getRegions(GetRegionsArgs.builder()
.current(true)
.build());
var defaultRealTimeLogDelivery = new RealTimeLogDelivery("defaultRealTimeLogDelivery", RealTimeLogDeliveryArgs.builder()
.domain(defaultDomainNew.domainName())
.logstore(defaultStore.logstoreName())
.project(defaultProject.projectName())
.slsRegion(default_.regions()[0].id())
.build());
}
}
resources:
defaultInteger:
type: random:integer
name: default
properties:
max: 99999
min: 10000
defaultDomainNew:
type: alicloud:cdn:DomainNew
name: default
properties:
scope: overseas
domainName: mycdndomain-${defaultInteger.result}.alicloud-provider.cn
cdnType: web
sources:
- type: ipaddr
content: 1.1.3.1
priority: 20
port: 80
weight: 15
defaultProject:
type: alicloud:log:Project
name: default
properties:
projectName: terraform-example-${defaultInteger.result}
description: terraform-example
defaultStore:
type: alicloud:log:Store
name: default
properties:
projectName: ${defaultProject.projectName}
logstoreName: example-store
shardCount: 3
autoSplit: true
maxSplitShardCount: 60
appendMeta: true
defaultRealTimeLogDelivery:
type: alicloud:cdn:RealTimeLogDelivery
name: default
properties:
domain: ${defaultDomainNew.domainName}
logstore: ${defaultStore.logstoreName}
project: ${defaultProject.projectName}
slsRegion: ${default.regions[0].id}
variables:
default:
fn::invoke:
Function: alicloud:getRegions
Arguments:
current: true
Create RealTimeLogDelivery Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RealTimeLogDelivery(name: string, args: RealTimeLogDeliveryArgs, opts?: CustomResourceOptions);
@overload
def RealTimeLogDelivery(resource_name: str,
args: RealTimeLogDeliveryArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RealTimeLogDelivery(resource_name: str,
opts: Optional[ResourceOptions] = None,
domain: Optional[str] = None,
logstore: Optional[str] = None,
project: Optional[str] = None,
sls_region: Optional[str] = None)
func NewRealTimeLogDelivery(ctx *Context, name string, args RealTimeLogDeliveryArgs, opts ...ResourceOption) (*RealTimeLogDelivery, error)
public RealTimeLogDelivery(string name, RealTimeLogDeliveryArgs args, CustomResourceOptions? opts = null)
public RealTimeLogDelivery(String name, RealTimeLogDeliveryArgs args)
public RealTimeLogDelivery(String name, RealTimeLogDeliveryArgs args, CustomResourceOptions options)
type: alicloud:cdn:RealTimeLogDelivery
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 RealTimeLogDeliveryArgs
- 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 RealTimeLogDeliveryArgs
- 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 RealTimeLogDeliveryArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RealTimeLogDeliveryArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RealTimeLogDeliveryArgs
- 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 realTimeLogDeliveryResource = new AliCloud.Cdn.RealTimeLogDelivery("realTimeLogDeliveryResource", new()
{
Domain = "string",
Logstore = "string",
Project = "string",
SlsRegion = "string",
});
example, err := cdn.NewRealTimeLogDelivery(ctx, "realTimeLogDeliveryResource", &cdn.RealTimeLogDeliveryArgs{
Domain: pulumi.String("string"),
Logstore: pulumi.String("string"),
Project: pulumi.String("string"),
SlsRegion: pulumi.String("string"),
})
var realTimeLogDeliveryResource = new RealTimeLogDelivery("realTimeLogDeliveryResource", RealTimeLogDeliveryArgs.builder()
.domain("string")
.logstore("string")
.project("string")
.slsRegion("string")
.build());
real_time_log_delivery_resource = alicloud.cdn.RealTimeLogDelivery("realTimeLogDeliveryResource",
domain="string",
logstore="string",
project="string",
sls_region="string")
const realTimeLogDeliveryResource = new alicloud.cdn.RealTimeLogDelivery("realTimeLogDeliveryResource", {
domain: "string",
logstore: "string",
project: "string",
slsRegion: "string",
});
type: alicloud:cdn:RealTimeLogDelivery
properties:
domain: string
logstore: string
project: string
slsRegion: string
RealTimeLogDelivery 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 RealTimeLogDelivery resource accepts the following input properties:
- Domain string
- The accelerated domain name for which you want to configure real-time log delivery. You can specify multiple domain names and separate them with commas (,).
- Logstore string
- The name of the Logstore that collects log data from Alibaba Cloud Content Delivery Network (CDN) in real time.
- Project string
- The name of the Log Service project that is used for real-time log delivery.
- Sls
Region string The region where the Log Service project is deployed.
NOTE: If your Project and Logstore services already exist, if you continue to create existing content, the created content will overwrite your existing indexes and custom reports. Please be careful to create your existing services to avoid affecting your online services after coverage.
- Domain string
- The accelerated domain name for which you want to configure real-time log delivery. You can specify multiple domain names and separate them with commas (,).
- Logstore string
- The name of the Logstore that collects log data from Alibaba Cloud Content Delivery Network (CDN) in real time.
- Project string
- The name of the Log Service project that is used for real-time log delivery.
- Sls
Region string The region where the Log Service project is deployed.
NOTE: If your Project and Logstore services already exist, if you continue to create existing content, the created content will overwrite your existing indexes and custom reports. Please be careful to create your existing services to avoid affecting your online services after coverage.
- domain String
- The accelerated domain name for which you want to configure real-time log delivery. You can specify multiple domain names and separate them with commas (,).
- logstore String
- The name of the Logstore that collects log data from Alibaba Cloud Content Delivery Network (CDN) in real time.
- project String
- The name of the Log Service project that is used for real-time log delivery.
- sls
Region String The region where the Log Service project is deployed.
NOTE: If your Project and Logstore services already exist, if you continue to create existing content, the created content will overwrite your existing indexes and custom reports. Please be careful to create your existing services to avoid affecting your online services after coverage.
- domain string
- The accelerated domain name for which you want to configure real-time log delivery. You can specify multiple domain names and separate them with commas (,).
- logstore string
- The name of the Logstore that collects log data from Alibaba Cloud Content Delivery Network (CDN) in real time.
- project string
- The name of the Log Service project that is used for real-time log delivery.
- sls
Region string The region where the Log Service project is deployed.
NOTE: If your Project and Logstore services already exist, if you continue to create existing content, the created content will overwrite your existing indexes and custom reports. Please be careful to create your existing services to avoid affecting your online services after coverage.
- domain str
- The accelerated domain name for which you want to configure real-time log delivery. You can specify multiple domain names and separate them with commas (,).
- logstore str
- The name of the Logstore that collects log data from Alibaba Cloud Content Delivery Network (CDN) in real time.
- project str
- The name of the Log Service project that is used for real-time log delivery.
- sls_
region str The region where the Log Service project is deployed.
NOTE: If your Project and Logstore services already exist, if you continue to create existing content, the created content will overwrite your existing indexes and custom reports. Please be careful to create your existing services to avoid affecting your online services after coverage.
- domain String
- The accelerated domain name for which you want to configure real-time log delivery. You can specify multiple domain names and separate them with commas (,).
- logstore String
- The name of the Logstore that collects log data from Alibaba Cloud Content Delivery Network (CDN) in real time.
- project String
- The name of the Log Service project that is used for real-time log delivery.
- sls
Region String The region where the Log Service project is deployed.
NOTE: If your Project and Logstore services already exist, if you continue to create existing content, the created content will overwrite your existing indexes and custom reports. Please be careful to create your existing services to avoid affecting your online services after coverage.
Outputs
All input properties are implicitly available as output properties. Additionally, the RealTimeLogDelivery resource produces the following output properties:
Look up Existing RealTimeLogDelivery Resource
Get an existing RealTimeLogDelivery 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?: RealTimeLogDeliveryState, opts?: CustomResourceOptions): RealTimeLogDelivery
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
domain: Optional[str] = None,
logstore: Optional[str] = None,
project: Optional[str] = None,
sls_region: Optional[str] = None,
status: Optional[str] = None) -> RealTimeLogDelivery
func GetRealTimeLogDelivery(ctx *Context, name string, id IDInput, state *RealTimeLogDeliveryState, opts ...ResourceOption) (*RealTimeLogDelivery, error)
public static RealTimeLogDelivery Get(string name, Input<string> id, RealTimeLogDeliveryState? state, CustomResourceOptions? opts = null)
public static RealTimeLogDelivery get(String name, Output<String> id, RealTimeLogDeliveryState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Domain string
- The accelerated domain name for which you want to configure real-time log delivery. You can specify multiple domain names and separate them with commas (,).
- Logstore string
- The name of the Logstore that collects log data from Alibaba Cloud Content Delivery Network (CDN) in real time.
- Project string
- The name of the Log Service project that is used for real-time log delivery.
- Sls
Region string The region where the Log Service project is deployed.
NOTE: If your Project and Logstore services already exist, if you continue to create existing content, the created content will overwrite your existing indexes and custom reports. Please be careful to create your existing services to avoid affecting your online services after coverage.
- Status string
- The status of the real-time log delivery feature. Valid Values:
online
andoffline
.
- Domain string
- The accelerated domain name for which you want to configure real-time log delivery. You can specify multiple domain names and separate them with commas (,).
- Logstore string
- The name of the Logstore that collects log data from Alibaba Cloud Content Delivery Network (CDN) in real time.
- Project string
- The name of the Log Service project that is used for real-time log delivery.
- Sls
Region string The region where the Log Service project is deployed.
NOTE: If your Project and Logstore services already exist, if you continue to create existing content, the created content will overwrite your existing indexes and custom reports. Please be careful to create your existing services to avoid affecting your online services after coverage.
- Status string
- The status of the real-time log delivery feature. Valid Values:
online
andoffline
.
- domain String
- The accelerated domain name for which you want to configure real-time log delivery. You can specify multiple domain names and separate them with commas (,).
- logstore String
- The name of the Logstore that collects log data from Alibaba Cloud Content Delivery Network (CDN) in real time.
- project String
- The name of the Log Service project that is used for real-time log delivery.
- sls
Region String The region where the Log Service project is deployed.
NOTE: If your Project and Logstore services already exist, if you continue to create existing content, the created content will overwrite your existing indexes and custom reports. Please be careful to create your existing services to avoid affecting your online services after coverage.
- status String
- The status of the real-time log delivery feature. Valid Values:
online
andoffline
.
- domain string
- The accelerated domain name for which you want to configure real-time log delivery. You can specify multiple domain names and separate them with commas (,).
- logstore string
- The name of the Logstore that collects log data from Alibaba Cloud Content Delivery Network (CDN) in real time.
- project string
- The name of the Log Service project that is used for real-time log delivery.
- sls
Region string The region where the Log Service project is deployed.
NOTE: If your Project and Logstore services already exist, if you continue to create existing content, the created content will overwrite your existing indexes and custom reports. Please be careful to create your existing services to avoid affecting your online services after coverage.
- status string
- The status of the real-time log delivery feature. Valid Values:
online
andoffline
.
- domain str
- The accelerated domain name for which you want to configure real-time log delivery. You can specify multiple domain names and separate them with commas (,).
- logstore str
- The name of the Logstore that collects log data from Alibaba Cloud Content Delivery Network (CDN) in real time.
- project str
- The name of the Log Service project that is used for real-time log delivery.
- sls_
region str The region where the Log Service project is deployed.
NOTE: If your Project and Logstore services already exist, if you continue to create existing content, the created content will overwrite your existing indexes and custom reports. Please be careful to create your existing services to avoid affecting your online services after coverage.
- status str
- The status of the real-time log delivery feature. Valid Values:
online
andoffline
.
- domain String
- The accelerated domain name for which you want to configure real-time log delivery. You can specify multiple domain names and separate them with commas (,).
- logstore String
- The name of the Logstore that collects log data from Alibaba Cloud Content Delivery Network (CDN) in real time.
- project String
- The name of the Log Service project that is used for real-time log delivery.
- sls
Region String The region where the Log Service project is deployed.
NOTE: If your Project and Logstore services already exist, if you continue to create existing content, the created content will overwrite your existing indexes and custom reports. Please be careful to create your existing services to avoid affecting your online services after coverage.
- status String
- The status of the real-time log delivery feature. Valid Values:
online
andoffline
.
Import
CDN Real Time Log Delivery can be imported using the id, e.g.
$ pulumi import alicloud:cdn/realTimeLogDelivery:RealTimeLogDelivery example <domain>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.