tencentcloud.TemScaleRule
Explore with Pulumi AI
Provides a resource to create a tem scaleRule
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const scaleRule = new tencentcloud.TemScaleRule("scaleRule", {
environmentId: "en-o5edaepv",
applicationId: "app-3j29aa2p",
workloadId: resource.tencentcloud_tem_workload.workload.id,
autoscaler: {
autoscalerName: "test3123",
description: "test",
enabled: true,
minReplicas: 1,
maxReplicas: 4,
cronHorizontalAutoscalers: [
{
name: "test",
period: "* * *",
priority: 1,
enabled: true,
schedules: [{
startAt: "03:00",
targetReplicas: 1,
}],
},
{
name: "test123123",
period: "* * *",
priority: 0,
enabled: true,
schedules: [{
startAt: "04:13",
targetReplicas: 1,
}],
},
],
horizontalAutoscalers: [{
metrics: "CPU",
enabled: true,
maxReplicas: 4,
minReplicas: 1,
threshold: 60,
}],
},
});
import pulumi
import pulumi_tencentcloud as tencentcloud
scale_rule = tencentcloud.TemScaleRule("scaleRule",
environment_id="en-o5edaepv",
application_id="app-3j29aa2p",
workload_id=resource["tencentcloud_tem_workload"]["workload"]["id"],
autoscaler={
"autoscaler_name": "test3123",
"description": "test",
"enabled": True,
"min_replicas": 1,
"max_replicas": 4,
"cron_horizontal_autoscalers": [
{
"name": "test",
"period": "* * *",
"priority": 1,
"enabled": True,
"schedules": [{
"start_at": "03:00",
"target_replicas": 1,
}],
},
{
"name": "test123123",
"period": "* * *",
"priority": 0,
"enabled": True,
"schedules": [{
"start_at": "04:13",
"target_replicas": 1,
}],
},
],
"horizontal_autoscalers": [{
"metrics": "CPU",
"enabled": True,
"max_replicas": 4,
"min_replicas": 1,
"threshold": 60,
}],
})
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := tencentcloud.NewTemScaleRule(ctx, "scaleRule", &tencentcloud.TemScaleRuleArgs{
EnvironmentId: pulumi.String("en-o5edaepv"),
ApplicationId: pulumi.String("app-3j29aa2p"),
WorkloadId: pulumi.Any(resource.Tencentcloud_tem_workload.Workload.Id),
Autoscaler: &tencentcloud.TemScaleRuleAutoscalerArgs{
AutoscalerName: pulumi.String("test3123"),
Description: pulumi.String("test"),
Enabled: pulumi.Bool(true),
MinReplicas: pulumi.Float64(1),
MaxReplicas: pulumi.Float64(4),
CronHorizontalAutoscalers: tencentcloud.TemScaleRuleAutoscalerCronHorizontalAutoscalerArray{
&tencentcloud.TemScaleRuleAutoscalerCronHorizontalAutoscalerArgs{
Name: pulumi.String("test"),
Period: pulumi.String("* * *"),
Priority: pulumi.Float64(1),
Enabled: pulumi.Bool(true),
Schedules: tencentcloud.TemScaleRuleAutoscalerCronHorizontalAutoscalerScheduleArray{
&tencentcloud.TemScaleRuleAutoscalerCronHorizontalAutoscalerScheduleArgs{
StartAt: pulumi.String("03:00"),
TargetReplicas: pulumi.Float64(1),
},
},
},
&tencentcloud.TemScaleRuleAutoscalerCronHorizontalAutoscalerArgs{
Name: pulumi.String("test123123"),
Period: pulumi.String("* * *"),
Priority: pulumi.Float64(0),
Enabled: pulumi.Bool(true),
Schedules: tencentcloud.TemScaleRuleAutoscalerCronHorizontalAutoscalerScheduleArray{
&tencentcloud.TemScaleRuleAutoscalerCronHorizontalAutoscalerScheduleArgs{
StartAt: pulumi.String("04:13"),
TargetReplicas: pulumi.Float64(1),
},
},
},
},
HorizontalAutoscalers: tencentcloud.TemScaleRuleAutoscalerHorizontalAutoscalerArray{
&tencentcloud.TemScaleRuleAutoscalerHorizontalAutoscalerArgs{
Metrics: pulumi.String("CPU"),
Enabled: pulumi.Bool(true),
MaxReplicas: pulumi.Float64(4),
MinReplicas: pulumi.Float64(1),
Threshold: pulumi.Float64(60),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var scaleRule = new Tencentcloud.TemScaleRule("scaleRule", new()
{
EnvironmentId = "en-o5edaepv",
ApplicationId = "app-3j29aa2p",
WorkloadId = resource.Tencentcloud_tem_workload.Workload.Id,
Autoscaler = new Tencentcloud.Inputs.TemScaleRuleAutoscalerArgs
{
AutoscalerName = "test3123",
Description = "test",
Enabled = true,
MinReplicas = 1,
MaxReplicas = 4,
CronHorizontalAutoscalers = new[]
{
new Tencentcloud.Inputs.TemScaleRuleAutoscalerCronHorizontalAutoscalerArgs
{
Name = "test",
Period = "* * *",
Priority = 1,
Enabled = true,
Schedules = new[]
{
new Tencentcloud.Inputs.TemScaleRuleAutoscalerCronHorizontalAutoscalerScheduleArgs
{
StartAt = "03:00",
TargetReplicas = 1,
},
},
},
new Tencentcloud.Inputs.TemScaleRuleAutoscalerCronHorizontalAutoscalerArgs
{
Name = "test123123",
Period = "* * *",
Priority = 0,
Enabled = true,
Schedules = new[]
{
new Tencentcloud.Inputs.TemScaleRuleAutoscalerCronHorizontalAutoscalerScheduleArgs
{
StartAt = "04:13",
TargetReplicas = 1,
},
},
},
},
HorizontalAutoscalers = new[]
{
new Tencentcloud.Inputs.TemScaleRuleAutoscalerHorizontalAutoscalerArgs
{
Metrics = "CPU",
Enabled = true,
MaxReplicas = 4,
MinReplicas = 1,
Threshold = 60,
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.TemScaleRule;
import com.pulumi.tencentcloud.TemScaleRuleArgs;
import com.pulumi.tencentcloud.inputs.TemScaleRuleAutoscalerArgs;
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 scaleRule = new TemScaleRule("scaleRule", TemScaleRuleArgs.builder()
.environmentId("en-o5edaepv")
.applicationId("app-3j29aa2p")
.workloadId(resource.tencentcloud_tem_workload().workload().id())
.autoscaler(TemScaleRuleAutoscalerArgs.builder()
.autoscalerName("test3123")
.description("test")
.enabled(true)
.minReplicas(1)
.maxReplicas(4)
.cronHorizontalAutoscalers(
TemScaleRuleAutoscalerCronHorizontalAutoscalerArgs.builder()
.name("test")
.period("* * *")
.priority(1)
.enabled(true)
.schedules(TemScaleRuleAutoscalerCronHorizontalAutoscalerScheduleArgs.builder()
.startAt("03:00")
.targetReplicas(1)
.build())
.build(),
TemScaleRuleAutoscalerCronHorizontalAutoscalerArgs.builder()
.name("test123123")
.period("* * *")
.priority(0)
.enabled(true)
.schedules(TemScaleRuleAutoscalerCronHorizontalAutoscalerScheduleArgs.builder()
.startAt("04:13")
.targetReplicas(1)
.build())
.build())
.horizontalAutoscalers(TemScaleRuleAutoscalerHorizontalAutoscalerArgs.builder()
.metrics("CPU")
.enabled(true)
.maxReplicas(4)
.minReplicas(1)
.threshold(60)
.build())
.build())
.build());
}
}
resources:
scaleRule:
type: tencentcloud:TemScaleRule
properties:
environmentId: en-o5edaepv
applicationId: app-3j29aa2p
workloadId: ${resource.tencentcloud_tem_workload.workload.id}
autoscaler:
autoscalerName: test3123
description: test
enabled: true
minReplicas: 1
maxReplicas: 4
cronHorizontalAutoscalers:
- name: test
period: '* * *'
priority: 1
enabled: true
schedules:
- startAt: 03:00
targetReplicas: 1
- name: test123123
period: '* * *'
priority: 0
enabled: true
schedules:
- startAt: 04:13
targetReplicas: 1
horizontalAutoscalers:
- metrics: CPU
enabled: true
maxReplicas: 4
minReplicas: 1
threshold: 60
Create TemScaleRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TemScaleRule(name: string, args: TemScaleRuleArgs, opts?: CustomResourceOptions);
@overload
def TemScaleRule(resource_name: str,
args: TemScaleRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TemScaleRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
application_id: Optional[str] = None,
autoscaler: Optional[TemScaleRuleAutoscalerArgs] = None,
environment_id: Optional[str] = None,
workload_id: Optional[str] = None,
tem_scale_rule_id: Optional[str] = None)
func NewTemScaleRule(ctx *Context, name string, args TemScaleRuleArgs, opts ...ResourceOption) (*TemScaleRule, error)
public TemScaleRule(string name, TemScaleRuleArgs args, CustomResourceOptions? opts = null)
public TemScaleRule(String name, TemScaleRuleArgs args)
public TemScaleRule(String name, TemScaleRuleArgs args, CustomResourceOptions options)
type: tencentcloud:TemScaleRule
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 TemScaleRuleArgs
- 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 TemScaleRuleArgs
- 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 TemScaleRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TemScaleRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TemScaleRuleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
TemScaleRule 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 TemScaleRule resource accepts the following input properties:
- Application
Id string - application ID.
- Autoscaler
Tem
Scale Rule Autoscaler - .
- Environment
Id string - environment ID.
- Workload
Id string - application ID, which is combined by environment ID and application ID, like
en-o5edaepv#app-3j29aa2p
. - Tem
Scale stringRule Id - ID of the resource.
- Application
Id string - application ID.
- Autoscaler
Tem
Scale Rule Autoscaler Args - .
- Environment
Id string - environment ID.
- Workload
Id string - application ID, which is combined by environment ID and application ID, like
en-o5edaepv#app-3j29aa2p
. - Tem
Scale stringRule Id - ID of the resource.
- application
Id String - application ID.
- autoscaler
Tem
Scale Rule Autoscaler - .
- environment
Id String - environment ID.
- workload
Id String - application ID, which is combined by environment ID and application ID, like
en-o5edaepv#app-3j29aa2p
. - tem
Scale StringRule Id - ID of the resource.
- application
Id string - application ID.
- autoscaler
Tem
Scale Rule Autoscaler - .
- environment
Id string - environment ID.
- workload
Id string - application ID, which is combined by environment ID and application ID, like
en-o5edaepv#app-3j29aa2p
. - tem
Scale stringRule Id - ID of the resource.
- application_
id str - application ID.
- autoscaler
Tem
Scale Rule Autoscaler Args - .
- environment_
id str - environment ID.
- workload_
id str - application ID, which is combined by environment ID and application ID, like
en-o5edaepv#app-3j29aa2p
. - tem_
scale_ strrule_ id - ID of the resource.
- application
Id String - application ID.
- autoscaler Property Map
- .
- environment
Id String - environment ID.
- workload
Id String - application ID, which is combined by environment ID and application ID, like
en-o5edaepv#app-3j29aa2p
. - tem
Scale StringRule Id - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the TemScaleRule 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 TemScaleRule Resource
Get an existing TemScaleRule 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?: TemScaleRuleState, opts?: CustomResourceOptions): TemScaleRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
application_id: Optional[str] = None,
autoscaler: Optional[TemScaleRuleAutoscalerArgs] = None,
environment_id: Optional[str] = None,
tem_scale_rule_id: Optional[str] = None,
workload_id: Optional[str] = None) -> TemScaleRule
func GetTemScaleRule(ctx *Context, name string, id IDInput, state *TemScaleRuleState, opts ...ResourceOption) (*TemScaleRule, error)
public static TemScaleRule Get(string name, Input<string> id, TemScaleRuleState? state, CustomResourceOptions? opts = null)
public static TemScaleRule get(String name, Output<String> id, TemScaleRuleState state, CustomResourceOptions options)
resources: _: type: tencentcloud:TemScaleRule get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Application
Id string - application ID.
- Autoscaler
Tem
Scale Rule Autoscaler - .
- Environment
Id string - environment ID.
- Tem
Scale stringRule Id - ID of the resource.
- Workload
Id string - application ID, which is combined by environment ID and application ID, like
en-o5edaepv#app-3j29aa2p
.
- Application
Id string - application ID.
- Autoscaler
Tem
Scale Rule Autoscaler Args - .
- Environment
Id string - environment ID.
- Tem
Scale stringRule Id - ID of the resource.
- Workload
Id string - application ID, which is combined by environment ID and application ID, like
en-o5edaepv#app-3j29aa2p
.
- application
Id String - application ID.
- autoscaler
Tem
Scale Rule Autoscaler - .
- environment
Id String - environment ID.
- tem
Scale StringRule Id - ID of the resource.
- workload
Id String - application ID, which is combined by environment ID and application ID, like
en-o5edaepv#app-3j29aa2p
.
- application
Id string - application ID.
- autoscaler
Tem
Scale Rule Autoscaler - .
- environment
Id string - environment ID.
- tem
Scale stringRule Id - ID of the resource.
- workload
Id string - application ID, which is combined by environment ID and application ID, like
en-o5edaepv#app-3j29aa2p
.
- application_
id str - application ID.
- autoscaler
Tem
Scale Rule Autoscaler Args - .
- environment_
id str - environment ID.
- tem_
scale_ strrule_ id - ID of the resource.
- workload_
id str - application ID, which is combined by environment ID and application ID, like
en-o5edaepv#app-3j29aa2p
.
- application
Id String - application ID.
- autoscaler Property Map
- .
- environment
Id String - environment ID.
- tem
Scale StringRule Id - ID of the resource.
- workload
Id String - application ID, which is combined by environment ID and application ID, like
en-o5edaepv#app-3j29aa2p
.
Supporting Types
TemScaleRuleAutoscaler, TemScaleRuleAutoscalerArgs
- Autoscaler
Name string - name.
- Enabled bool
- enable scaler.
- Max
Replicas double - maximal replica number.
- Min
Replicas double - minimal replica number.
- Cron
Horizontal List<TemAutoscalers Scale Rule Autoscaler Cron Horizontal Autoscaler> - scaler based on cron configuration.
- Description string
- description.
- Horizontal
Autoscalers List<TemScale Rule Autoscaler Horizontal Autoscaler> - scaler based on metrics.
- Autoscaler
Name string - name.
- Enabled bool
- enable scaler.
- Max
Replicas float64 - maximal replica number.
- Min
Replicas float64 - minimal replica number.
- Cron
Horizontal []TemAutoscalers Scale Rule Autoscaler Cron Horizontal Autoscaler - scaler based on cron configuration.
- Description string
- description.
- Horizontal
Autoscalers []TemScale Rule Autoscaler Horizontal Autoscaler - scaler based on metrics.
- autoscaler
Name String - name.
- enabled Boolean
- enable scaler.
- max
Replicas Double - maximal replica number.
- min
Replicas Double - minimal replica number.
- cron
Horizontal List<TemAutoscalers Scale Rule Autoscaler Cron Horizontal Autoscaler> - scaler based on cron configuration.
- description String
- description.
- horizontal
Autoscalers List<TemScale Rule Autoscaler Horizontal Autoscaler> - scaler based on metrics.
- autoscaler
Name string - name.
- enabled boolean
- enable scaler.
- max
Replicas number - maximal replica number.
- min
Replicas number - minimal replica number.
- cron
Horizontal TemAutoscalers Scale Rule Autoscaler Cron Horizontal Autoscaler[] - scaler based on cron configuration.
- description string
- description.
- horizontal
Autoscalers TemScale Rule Autoscaler Horizontal Autoscaler[] - scaler based on metrics.
- autoscaler_
name str - name.
- enabled bool
- enable scaler.
- max_
replicas float - maximal replica number.
- min_
replicas float - minimal replica number.
- cron_
horizontal_ Sequence[Temautoscalers Scale Rule Autoscaler Cron Horizontal Autoscaler] - scaler based on cron configuration.
- description str
- description.
- horizontal_
autoscalers Sequence[TemScale Rule Autoscaler Horizontal Autoscaler] - scaler based on metrics.
- autoscaler
Name String - name.
- enabled Boolean
- enable scaler.
- max
Replicas Number - maximal replica number.
- min
Replicas Number - minimal replica number.
- cron
Horizontal List<Property Map>Autoscalers - scaler based on cron configuration.
- description String
- description.
- horizontal
Autoscalers List<Property Map> - scaler based on metrics.
TemScaleRuleAutoscalerCronHorizontalAutoscaler, TemScaleRuleAutoscalerCronHorizontalAutoscalerArgs
TemScaleRuleAutoscalerCronHorizontalAutoscalerSchedule, TemScaleRuleAutoscalerCronHorizontalAutoscalerScheduleArgs
- Start
At string - start time.
- Target
Replicas double - target replica number.
- Start
At string - start time.
- Target
Replicas float64 - target replica number.
- start
At String - start time.
- target
Replicas Double - target replica number.
- start
At string - start time.
- target
Replicas number - target replica number.
- start_
at str - start time.
- target_
replicas float - target replica number.
- start
At String - start time.
- target
Replicas Number - target replica number.
TemScaleRuleAutoscalerHorizontalAutoscaler, TemScaleRuleAutoscalerHorizontalAutoscalerArgs
- Enabled bool
- enable scaler.
- Max
Replicas double - maximal replica number.
- Metrics string
- metric name.
- Min
Replicas double - minimal replica number.
- Threshold double
- metric threshold.
- Enabled bool
- enable scaler.
- Max
Replicas float64 - maximal replica number.
- Metrics string
- metric name.
- Min
Replicas float64 - minimal replica number.
- Threshold float64
- metric threshold.
- enabled Boolean
- enable scaler.
- max
Replicas Double - maximal replica number.
- metrics String
- metric name.
- min
Replicas Double - minimal replica number.
- threshold Double
- metric threshold.
- enabled boolean
- enable scaler.
- max
Replicas number - maximal replica number.
- metrics string
- metric name.
- min
Replicas number - minimal replica number.
- threshold number
- metric threshold.
- enabled bool
- enable scaler.
- max_
replicas float - maximal replica number.
- metrics str
- metric name.
- min_
replicas float - minimal replica number.
- threshold float
- metric threshold.
- enabled Boolean
- enable scaler.
- max
Replicas Number - maximal replica number.
- metrics String
- metric name.
- min
Replicas Number - minimal replica number.
- threshold Number
- metric threshold.
Import
tem scaleRule can be imported using the id, e.g.
$ pulumi import tencentcloud:index/temScaleRule:TemScaleRule scaleRule environmentId#applicationId#scaleRuleId
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.