alicloud.ess.getLifecycleHooks
Explore with Pulumi AI
This data source provides available lifecycle hook resources.
NOTE: Available in 1.72.0+
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ds = AliCloud.Ess.GetLifecycleHooks.Invoke(new()
{
NameRegex = "lifecyclehook_name",
ScalingGroupId = "scaling_group_id",
});
return new Dictionary<string, object?>
{
["firstLifecycleHook"] = ds.Apply(getLifecycleHooksResult => getLifecycleHooksResult.Hooks[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 {
ds, err := ess.GetLifecycleHooks(ctx, &ess.GetLifecycleHooksArgs{
NameRegex: pulumi.StringRef("lifecyclehook_name"),
ScalingGroupId: pulumi.StringRef("scaling_group_id"),
}, nil)
if err != nil {
return err
}
ctx.Export("firstLifecycleHook", ds.Hooks[0].Id)
return nil
})
}
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.GetLifecycleHooksArgs;
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 ds = EssFunctions.getLifecycleHooks(GetLifecycleHooksArgs.builder()
.nameRegex("lifecyclehook_name")
.scalingGroupId("scaling_group_id")
.build());
ctx.export("firstLifecycleHook", ds.applyValue(getLifecycleHooksResult -> getLifecycleHooksResult.hooks()[0].id()));
}
}
import pulumi
import pulumi_alicloud as alicloud
ds = alicloud.ess.get_lifecycle_hooks(name_regex="lifecyclehook_name",
scaling_group_id="scaling_group_id")
pulumi.export("firstLifecycleHook", ds.hooks[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ds = alicloud.ess.getLifecycleHooks({
nameRegex: "lifecyclehook_name",
scalingGroupId: "scaling_group_id",
});
export const firstLifecycleHook = ds.then(ds => ds.hooks?.[0]?.id);
variables:
ds:
fn::invoke:
Function: alicloud:ess:getLifecycleHooks
Arguments:
nameRegex: lifecyclehook_name
scalingGroupId: scaling_group_id
outputs:
firstLifecycleHook: ${ds.hooks[0].id}
Using getLifecycleHooks
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 getLifecycleHooks(args: GetLifecycleHooksArgs, opts?: InvokeOptions): Promise<GetLifecycleHooksResult>
function getLifecycleHooksOutput(args: GetLifecycleHooksOutputArgs, opts?: InvokeOptions): Output<GetLifecycleHooksResult>
def get_lifecycle_hooks(ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
scaling_group_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetLifecycleHooksResult
def get_lifecycle_hooks_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,
opts: Optional[InvokeOptions] = None) -> Output[GetLifecycleHooksResult]
func GetLifecycleHooks(ctx *Context, args *GetLifecycleHooksArgs, opts ...InvokeOption) (*GetLifecycleHooksResult, error)
func GetLifecycleHooksOutput(ctx *Context, args *GetLifecycleHooksOutputArgs, opts ...InvokeOption) GetLifecycleHooksResultOutput
> Note: This function is named GetLifecycleHooks
in the Go SDK.
public static class GetLifecycleHooks
{
public static Task<GetLifecycleHooksResult> InvokeAsync(GetLifecycleHooksArgs args, InvokeOptions? opts = null)
public static Output<GetLifecycleHooksResult> Invoke(GetLifecycleHooksInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetLifecycleHooksResult> getLifecycleHooks(GetLifecycleHooksArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:ess/getLifecycleHooks:getLifecycleHooks
arguments:
# arguments dictionary
The following arguments are supported:
- Ids List<string>
A list of lifecycle hook IDs.
- Name
Regex string A regex string to filter resulting lifecycle hook by name.
- Output
File string File name where to save data source results (after running
pulumi preview
).- Scaling
Group stringId Scaling group id the lifecycle hooks belong to.
- Ids []string
A list of lifecycle hook IDs.
- Name
Regex string A regex string to filter resulting lifecycle hook by name.
- Output
File string File name where to save data source results (after running
pulumi preview
).- Scaling
Group stringId Scaling group id the lifecycle hooks belong to.
- ids List<String>
A list of lifecycle hook IDs.
- name
Regex String A regex string to filter resulting lifecycle hook by name.
- output
File String File name where to save data source results (after running
pulumi preview
).- scaling
Group StringId Scaling group id the lifecycle hooks belong to.
- ids string[]
A list of lifecycle hook IDs.
- name
Regex string A regex string to filter resulting lifecycle hook by name.
- output
File string File name where to save data source results (after running
pulumi preview
).- scaling
Group stringId Scaling group id the lifecycle hooks belong to.
- ids Sequence[str]
A list of lifecycle hook IDs.
- name_
regex str A regex string to filter resulting lifecycle hook by name.
- output_
file str File name where to save data source results (after running
pulumi preview
).- scaling_
group_ strid Scaling group id the lifecycle hooks belong to.
- ids List<String>
A list of lifecycle hook IDs.
- name
Regex String A regex string to filter resulting lifecycle hook by name.
- output
File String File name where to save data source results (after running
pulumi preview
).- scaling
Group StringId Scaling group id the lifecycle hooks belong to.
getLifecycleHooks Result
The following output properties are available:
- Hooks
List<Pulumi.
Ali Cloud. Ess. Outputs. Get Lifecycle Hooks Hook> A list of lifecycle hooks. Each element contains the following attributes:
- Id string
The provider-assigned unique ID for this managed resource.
- Ids List<string>
A list of lifecycle hook ids.
- Names List<string>
A list of lifecycle hook names.
- Name
Regex string - Output
File string - Scaling
Group stringId ID of the scaling group.
- Hooks
[]Get
Lifecycle Hooks Hook A list of lifecycle hooks. Each element contains the following attributes:
- Id string
The provider-assigned unique ID for this managed resource.
- Ids []string
A list of lifecycle hook ids.
- Names []string
A list of lifecycle hook names.
- Name
Regex string - Output
File string - Scaling
Group stringId ID of the scaling group.
- hooks
List<Get
Lifecycle Hooks Hook> A list of lifecycle hooks. Each element contains the following attributes:
- id String
The provider-assigned unique ID for this managed resource.
- ids List<String>
A list of lifecycle hook ids.
- names List<String>
A list of lifecycle hook names.
- name
Regex String - output
File String - scaling
Group StringId ID of the scaling group.
- hooks
Get
Lifecycle Hooks Hook[] A list of lifecycle hooks. Each element contains the following attributes:
- id string
The provider-assigned unique ID for this managed resource.
- ids string[]
A list of lifecycle hook ids.
- names string[]
A list of lifecycle hook names.
- name
Regex string - output
File string - scaling
Group stringId ID of the scaling group.
- hooks
Sequence[Get
Lifecycle Hooks Hook] A list of lifecycle hooks. Each element contains the following attributes:
- id str
The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
A list of lifecycle hook ids.
- names Sequence[str]
A list of lifecycle hook names.
- name_
regex str - output_
file str - scaling_
group_ strid ID of the scaling group.
- hooks List<Property Map>
A list of lifecycle hooks. Each element contains the following attributes:
- id String
The provider-assigned unique ID for this managed resource.
- ids List<String>
A list of lifecycle hook ids.
- names List<String>
A list of lifecycle hook names.
- name
Regex String - output
File String - scaling
Group StringId ID of the scaling group.
Supporting Types
GetLifecycleHooksHook
- Default
Result string Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses.
- Heartbeat
Timeout int Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter.
- Id string
ID of the lifecycle hook.
- Lifecycle
Transition string Type of Scaling activity attached to lifecycle hook.
- Name string
Name of the lifecycle hook.
- Notification
Arn string The Arn of notification target.
- Notification
Metadata string Additional information that you want to include when Auto Scaling sends a message to the notification target.
- Scaling
Group stringId Scaling group id the lifecycle hooks belong to.
- Default
Result string Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses.
- Heartbeat
Timeout int Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter.
- Id string
ID of the lifecycle hook.
- Lifecycle
Transition string Type of Scaling activity attached to lifecycle hook.
- Name string
Name of the lifecycle hook.
- Notification
Arn string The Arn of notification target.
- Notification
Metadata string Additional information that you want to include when Auto Scaling sends a message to the notification target.
- Scaling
Group stringId Scaling group id the lifecycle hooks belong to.
- default
Result String Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses.
- heartbeat
Timeout Integer Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter.
- id String
ID of the lifecycle hook.
- lifecycle
Transition String Type of Scaling activity attached to lifecycle hook.
- name String
Name of the lifecycle hook.
- notification
Arn String The Arn of notification target.
- notification
Metadata String Additional information that you want to include when Auto Scaling sends a message to the notification target.
- scaling
Group StringId Scaling group id the lifecycle hooks belong to.
- default
Result string Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses.
- heartbeat
Timeout number Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter.
- id string
ID of the lifecycle hook.
- lifecycle
Transition string Type of Scaling activity attached to lifecycle hook.
- name string
Name of the lifecycle hook.
- notification
Arn string The Arn of notification target.
- notification
Metadata string Additional information that you want to include when Auto Scaling sends a message to the notification target.
- scaling
Group stringId Scaling group id the lifecycle hooks belong to.
- default_
result str Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses.
- heartbeat_
timeout int Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter.
- id str
ID of the lifecycle hook.
- lifecycle_
transition str Type of Scaling activity attached to lifecycle hook.
- name str
Name of the lifecycle hook.
- notification_
arn str The Arn of notification target.
- notification_
metadata str Additional information that you want to include when Auto Scaling sends a message to the notification target.
- scaling_
group_ strid Scaling group id the lifecycle hooks belong to.
- default
Result String Defines the action the Auto Scaling group should take when the lifecycle hook timeout elapses.
- heartbeat
Timeout Number Defines the amount of time, in seconds, that can elapse before the lifecycle hook times out. When the lifecycle hook times out, Auto Scaling performs the action defined in the default_result parameter.
- id String
ID of the lifecycle hook.
- lifecycle
Transition String Type of Scaling activity attached to lifecycle hook.
- name String
Name of the lifecycle hook.
- notification
Arn String The Arn of notification target.
- notification
Metadata String Additional information that you want to include when Auto Scaling sends a message to the notification target.
- scaling
Group StringId Scaling group id the lifecycle hooks belong to.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.