Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.ess.getScalingRules
Explore with Pulumi AI
This data source provides available scaling rule resources.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const scalingrulesDs = alicloud.ess.getScalingRules({
scalingGroupId: "scaling_group_id",
ids: [
"scaling_rule_id1",
"scaling_rule_id2",
],
nameRegex: "scaling_rule_name",
});
export const firstScalingRule = scalingrulesDs.then(scalingrulesDs => scalingrulesDs.rules?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
scalingrules_ds = alicloud.ess.get_scaling_rules(scaling_group_id="scaling_group_id",
ids=[
"scaling_rule_id1",
"scaling_rule_id2",
],
name_regex="scaling_rule_name")
pulumi.export("firstScalingRule", scalingrules_ds.rules[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ess"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
scalingrulesDs, err := ess.GetScalingRules(ctx, &ess.GetScalingRulesArgs{
ScalingGroupId: pulumi.StringRef("scaling_group_id"),
Ids: []string{
"scaling_rule_id1",
"scaling_rule_id2",
},
NameRegex: pulumi.StringRef("scaling_rule_name"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstScalingRule", scalingrulesDs.Rules[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var scalingrulesDs = AliCloud.Ess.GetScalingRules.Invoke(new()
{
ScalingGroupId = "scaling_group_id",
Ids = new[]
{
"scaling_rule_id1",
"scaling_rule_id2",
},
NameRegex = "scaling_rule_name",
});
return new Dictionary<string, object?>
{
["firstScalingRule"] = scalingrulesDs.Apply(getScalingRulesResult => getScalingRulesResult.Rules[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ess.EssFunctions;
import com.pulumi.alicloud.ess.inputs.GetScalingRulesArgs;
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) {
final var scalingrulesDs = EssFunctions.getScalingRules(GetScalingRulesArgs.builder()
.scalingGroupId("scaling_group_id")
.ids(
"scaling_rule_id1",
"scaling_rule_id2")
.nameRegex("scaling_rule_name")
.build());
ctx.export("firstScalingRule", scalingrulesDs.applyValue(getScalingRulesResult -> getScalingRulesResult.rules()[0].id()));
}
}
variables:
scalingrulesDs:
fn::invoke:
Function: alicloud:ess:getScalingRules
Arguments:
scalingGroupId: scaling_group_id
ids:
- scaling_rule_id1
- scaling_rule_id2
nameRegex: scaling_rule_name
outputs:
firstScalingRule: ${scalingrulesDs.rules[0].id}
Using getScalingRules
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 getScalingRules(args: GetScalingRulesArgs, opts?: InvokeOptions): Promise<GetScalingRulesResult>
function getScalingRulesOutput(args: GetScalingRulesOutputArgs, opts?: InvokeOptions): Output<GetScalingRulesResult>
def get_scaling_rules(ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
scaling_group_id: Optional[str] = None,
type: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetScalingRulesResult
def get_scaling_rules_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
scaling_group_id: Optional[pulumi.Input[str]] = None,
type: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetScalingRulesResult]
func GetScalingRules(ctx *Context, args *GetScalingRulesArgs, opts ...InvokeOption) (*GetScalingRulesResult, error)
func GetScalingRulesOutput(ctx *Context, args *GetScalingRulesOutputArgs, opts ...InvokeOption) GetScalingRulesResultOutput
> Note: This function is named GetScalingRules
in the Go SDK.
public static class GetScalingRules
{
public static Task<GetScalingRulesResult> InvokeAsync(GetScalingRulesArgs args, InvokeOptions? opts = null)
public static Output<GetScalingRulesResult> Invoke(GetScalingRulesInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetScalingRulesResult> getScalingRules(GetScalingRulesArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:ess/getScalingRules:getScalingRules
arguments:
# arguments dictionary
The following arguments are supported:
- Ids List<string>
- A list of scaling rule IDs.
- Name
Regex string - A regex string to filter resulting scaling rules by name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Scaling
Group stringId - Scaling group id the scaling rules belong to.
- Type string
- Type of scaling rule.
- Ids []string
- A list of scaling rule IDs.
- Name
Regex string - A regex string to filter resulting scaling rules by name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Scaling
Group stringId - Scaling group id the scaling rules belong to.
- Type string
- Type of scaling rule.
- ids List<String>
- A list of scaling rule IDs.
- name
Regex String - A regex string to filter resulting scaling rules by name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - scaling
Group StringId - Scaling group id the scaling rules belong to.
- type String
- Type of scaling rule.
- ids string[]
- A list of scaling rule IDs.
- name
Regex string - A regex string to filter resulting scaling rules by name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - scaling
Group stringId - Scaling group id the scaling rules belong to.
- type string
- Type of scaling rule.
- ids Sequence[str]
- A list of scaling rule IDs.
- name_
regex str - A regex string to filter resulting scaling rules by name.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - scaling_
group_ strid - Scaling group id the scaling rules belong to.
- type str
- Type of scaling rule.
- ids List<String>
- A list of scaling rule IDs.
- name
Regex String - A regex string to filter resulting scaling rules by name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - scaling
Group StringId - Scaling group id the scaling rules belong to.
- type String
- Type of scaling rule.
getScalingRules Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- A list of scaling rule ids.
- Names List<string>
- A list of scaling rule names.
- Rules
List<Pulumi.
Ali Cloud. Ess. Outputs. Get Scaling Rules Rule> - A list of scaling rules. Each element contains the following attributes:
- Name
Regex string - Output
File string - Scaling
Group stringId - ID of the scaling group.
- Type string
- Type of the scaling rule.
- Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- A list of scaling rule ids.
- Names []string
- A list of scaling rule names.
- Rules
[]Get
Scaling Rules Rule - A list of scaling rules. Each element contains the following attributes:
- Name
Regex string - Output
File string - Scaling
Group stringId - ID of the scaling group.
- Type string
- Type of the scaling rule.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of scaling rule ids.
- names List<String>
- A list of scaling rule names.
- rules
List<Get
Scaling Rules Rule> - A list of scaling rules. Each element contains the following attributes:
- name
Regex String - output
File String - scaling
Group StringId - ID of the scaling group.
- type String
- Type of the scaling rule.
- id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- A list of scaling rule ids.
- names string[]
- A list of scaling rule names.
- rules
Get
Scaling Rules Rule[] - A list of scaling rules. Each element contains the following attributes:
- name
Regex string - output
File string - scaling
Group stringId - ID of the scaling group.
- type string
- Type of the scaling rule.
- id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- A list of scaling rule ids.
- names Sequence[str]
- A list of scaling rule names.
- rules
Sequence[Get
Scaling Rules Rule] - A list of scaling rules. Each element contains the following attributes:
- name_
regex str - output_
file str - scaling_
group_ strid - ID of the scaling group.
- type str
- Type of the scaling rule.
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- A list of scaling rule ids.
- names List<String>
- A list of scaling rule names.
- rules List<Property Map>
- A list of scaling rules. Each element contains the following attributes:
- name
Regex String - output
File String - scaling
Group StringId - ID of the scaling group.
- type String
- Type of the scaling rule.
Supporting Types
GetScalingRulesRule
- Adjustment
Type string - Adjustment type of the scaling rule.
- Adjustment
Value int - Adjustment value of the scaling rule.
- Cooldown int
- Cooldown time of the scaling rule.
- Id string
- ID of the scaling rule.
- Min
Adjustment intMagnitude - Min adjustment magnitude of scaling rule.
- Name string
- Name of the scaling rule.
- Scaling
Group stringId - Scaling group id the scaling rules belong to.
- Scaling
Rule stringAri - Ari of scaling rule.
- Type string
- Type of scaling rule.
- Adjustment
Type string - Adjustment type of the scaling rule.
- Adjustment
Value int - Adjustment value of the scaling rule.
- Cooldown int
- Cooldown time of the scaling rule.
- Id string
- ID of the scaling rule.
- Min
Adjustment intMagnitude - Min adjustment magnitude of scaling rule.
- Name string
- Name of the scaling rule.
- Scaling
Group stringId - Scaling group id the scaling rules belong to.
- Scaling
Rule stringAri - Ari of scaling rule.
- Type string
- Type of scaling rule.
- adjustment
Type String - Adjustment type of the scaling rule.
- adjustment
Value Integer - Adjustment value of the scaling rule.
- cooldown Integer
- Cooldown time of the scaling rule.
- id String
- ID of the scaling rule.
- min
Adjustment IntegerMagnitude - Min adjustment magnitude of scaling rule.
- name String
- Name of the scaling rule.
- scaling
Group StringId - Scaling group id the scaling rules belong to.
- scaling
Rule StringAri - Ari of scaling rule.
- type String
- Type of scaling rule.
- adjustment
Type string - Adjustment type of the scaling rule.
- adjustment
Value number - Adjustment value of the scaling rule.
- cooldown number
- Cooldown time of the scaling rule.
- id string
- ID of the scaling rule.
- min
Adjustment numberMagnitude - Min adjustment magnitude of scaling rule.
- name string
- Name of the scaling rule.
- scaling
Group stringId - Scaling group id the scaling rules belong to.
- scaling
Rule stringAri - Ari of scaling rule.
- type string
- Type of scaling rule.
- adjustment_
type str - Adjustment type of the scaling rule.
- adjustment_
value int - Adjustment value of the scaling rule.
- cooldown int
- Cooldown time of the scaling rule.
- id str
- ID of the scaling rule.
- min_
adjustment_ intmagnitude - Min adjustment magnitude of scaling rule.
- name str
- Name of the scaling rule.
- scaling_
group_ strid - Scaling group id the scaling rules belong to.
- scaling_
rule_ strari - Ari of scaling rule.
- type str
- Type of scaling rule.
- adjustment
Type String - Adjustment type of the scaling rule.
- adjustment
Value Number - Adjustment value of the scaling rule.
- cooldown Number
- Cooldown time of the scaling rule.
- id String
- ID of the scaling rule.
- min
Adjustment NumberMagnitude - Min adjustment magnitude of scaling rule.
- name String
- Name of the scaling rule.
- scaling
Group StringId - Scaling group id the scaling rules belong to.
- scaling
Rule StringAri - Ari of scaling rule.
- type String
- Type of scaling rule.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.