Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.arms.getAlertContacts
Explore with Pulumi AI
This data source provides the Arms Alert Contacts of the current Alibaba Cloud user.
NOTE: Available in v1.129.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.arms.getAlertContacts({});
export const armsAlertContactId1 = ids.then(ids => ids.contacts?.[0]?.id);
const nameRegex = alicloud.arms.getAlertContacts({
nameRegex: "^my-AlertContact",
});
export const armsAlertContactId2 = nameRegex.then(nameRegex => nameRegex.contacts?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.arms.get_alert_contacts()
pulumi.export("armsAlertContactId1", ids.contacts[0].id)
name_regex = alicloud.arms.get_alert_contacts(name_regex="^my-AlertContact")
pulumi.export("armsAlertContactId2", name_regex.contacts[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/arms"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := arms.GetAlertContacts(ctx, &arms.GetAlertContactsArgs{}, nil)
if err != nil {
return err
}
ctx.Export("armsAlertContactId1", ids.Contacts[0].Id)
nameRegex, err := arms.GetAlertContacts(ctx, &arms.GetAlertContactsArgs{
NameRegex: pulumi.StringRef("^my-AlertContact"),
}, nil)
if err != nil {
return err
}
ctx.Export("armsAlertContactId2", nameRegex.Contacts[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.Arms.GetAlertContacts.Invoke();
var nameRegex = AliCloud.Arms.GetAlertContacts.Invoke(new()
{
NameRegex = "^my-AlertContact",
});
return new Dictionary<string, object?>
{
["armsAlertContactId1"] = ids.Apply(getAlertContactsResult => getAlertContactsResult.Contacts[0]?.Id),
["armsAlertContactId2"] = nameRegex.Apply(getAlertContactsResult => getAlertContactsResult.Contacts[0]?.Id),
};
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.arms.ArmsFunctions;
import com.pulumi.alicloud.arms.inputs.GetAlertContactsArgs;
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 ids = ArmsFunctions.getAlertContacts();
ctx.export("armsAlertContactId1", ids.applyValue(getAlertContactsResult -> getAlertContactsResult.contacts()[0].id()));
final var nameRegex = ArmsFunctions.getAlertContacts(GetAlertContactsArgs.builder()
.nameRegex("^my-AlertContact")
.build());
ctx.export("armsAlertContactId2", nameRegex.applyValue(getAlertContactsResult -> getAlertContactsResult.contacts()[0].id()));
}
}
variables:
ids:
fn::invoke:
Function: alicloud:arms:getAlertContacts
Arguments: {}
nameRegex:
fn::invoke:
Function: alicloud:arms:getAlertContacts
Arguments:
nameRegex: ^my-AlertContact
outputs:
armsAlertContactId1: ${ids.contacts[0].id}
armsAlertContactId2: ${nameRegex.contacts[0].id}
Using getAlertContacts
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 getAlertContacts(args: GetAlertContactsArgs, opts?: InvokeOptions): Promise<GetAlertContactsResult>
function getAlertContactsOutput(args: GetAlertContactsOutputArgs, opts?: InvokeOptions): Output<GetAlertContactsResult>
def get_alert_contacts(alert_contact_name: Optional[str] = None,
email: Optional[str] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
phone_num: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetAlertContactsResult
def get_alert_contacts_output(alert_contact_name: Optional[pulumi.Input[str]] = None,
email: Optional[pulumi.Input[str]] = None,
ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
name_regex: Optional[pulumi.Input[str]] = None,
output_file: Optional[pulumi.Input[str]] = None,
phone_num: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetAlertContactsResult]
func GetAlertContacts(ctx *Context, args *GetAlertContactsArgs, opts ...InvokeOption) (*GetAlertContactsResult, error)
func GetAlertContactsOutput(ctx *Context, args *GetAlertContactsOutputArgs, opts ...InvokeOption) GetAlertContactsResultOutput
> Note: This function is named GetAlertContacts
in the Go SDK.
public static class GetAlertContacts
{
public static Task<GetAlertContactsResult> InvokeAsync(GetAlertContactsArgs args, InvokeOptions? opts = null)
public static Output<GetAlertContactsResult> Invoke(GetAlertContactsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAlertContactsResult> getAlertContacts(GetAlertContactsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:arms/getAlertContacts:getAlertContacts
arguments:
# arguments dictionary
The following arguments are supported:
- Alert
Contact stringName - The name of the alert contact.
- Email string
- The email address of the alert contact.
- Ids List<string>
- A list of Alert Contact IDs.
- Name
Regex string - A regex string to filter results by Alert Contact name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Phone
Num string - The mobile number of the alert contact.
- Alert
Contact stringName - The name of the alert contact.
- Email string
- The email address of the alert contact.
- Ids []string
- A list of Alert Contact IDs.
- Name
Regex string - A regex string to filter results by Alert Contact name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Phone
Num string - The mobile number of the alert contact.
- alert
Contact StringName - The name of the alert contact.
- email String
- The email address of the alert contact.
- ids List<String>
- A list of Alert Contact IDs.
- name
Regex String - A regex string to filter results by Alert Contact name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - phone
Num String - The mobile number of the alert contact.
- alert
Contact stringName - The name of the alert contact.
- email string
- The email address of the alert contact.
- ids string[]
- A list of Alert Contact IDs.
- name
Regex string - A regex string to filter results by Alert Contact name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - phone
Num string - The mobile number of the alert contact.
- alert_
contact_ strname - The name of the alert contact.
- email str
- The email address of the alert contact.
- ids Sequence[str]
- A list of Alert Contact IDs.
- name_
regex str - A regex string to filter results by Alert Contact name.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - phone_
num str - The mobile number of the alert contact.
- alert
Contact StringName - The name of the alert contact.
- email String
- The email address of the alert contact.
- ids List<String>
- A list of Alert Contact IDs.
- name
Regex String - A regex string to filter results by Alert Contact name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - phone
Num String - The mobile number of the alert contact.
getAlertContacts Result
The following output properties are available:
- Contacts
List<Pulumi.
Ali Cloud. Arms. Outputs. Get Alert Contacts Contact> - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Alert
Contact stringName - Email string
- Name
Regex string - Output
File string - Phone
Num string
- Contacts
[]Get
Alert Contacts Contact - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Alert
Contact stringName - Email string
- Name
Regex string - Output
File string - Phone
Num string
- contacts
List<Get
Alert Contacts Contact> - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- alert
Contact StringName - email String
- name
Regex String - output
File String - phone
Num String
- contacts
Get
Alert Contacts Contact[] - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- alert
Contact stringName - email string
- name
Regex string - output
File string - phone
Num string
- contacts
Sequence[Get
Alert Contacts Contact] - id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- alert_
contact_ strname - email str
- name_
regex str - output_
file str - phone_
num str
- contacts List<Property Map>
- id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- alert
Contact StringName - email String
- name
Regex String - output
File String - phone
Num String
Supporting Types
GetAlertContactsContact
- Alert
Contact stringId - Contact ID.
- Alert
Contact stringName - The name of the alert contact.
- Create
Time string - The Creation Time Timestamp.
- Ding
Robot stringWebhook Url - The webhook URL of the DingTalk chatbot.
- Email string
- The email address of the alert contact.
- Id string
- The ID of the Alert Contact.
- Phone
Num string - The mobile number of the alert contact.
- System
Noc bool - Specifies whether the alert contact receives system notifications.
- Webhook string
- Webhook Information.
- Alert
Contact stringId - Contact ID.
- Alert
Contact stringName - The name of the alert contact.
- Create
Time string - The Creation Time Timestamp.
- Ding
Robot stringWebhook Url - The webhook URL of the DingTalk chatbot.
- Email string
- The email address of the alert contact.
- Id string
- The ID of the Alert Contact.
- Phone
Num string - The mobile number of the alert contact.
- System
Noc bool - Specifies whether the alert contact receives system notifications.
- Webhook string
- Webhook Information.
- alert
Contact StringId - Contact ID.
- alert
Contact StringName - The name of the alert contact.
- create
Time String - The Creation Time Timestamp.
- ding
Robot StringWebhook Url - The webhook URL of the DingTalk chatbot.
- email String
- The email address of the alert contact.
- id String
- The ID of the Alert Contact.
- phone
Num String - The mobile number of the alert contact.
- system
Noc Boolean - Specifies whether the alert contact receives system notifications.
- webhook String
- Webhook Information.
- alert
Contact stringId - Contact ID.
- alert
Contact stringName - The name of the alert contact.
- create
Time string - The Creation Time Timestamp.
- ding
Robot stringWebhook Url - The webhook URL of the DingTalk chatbot.
- email string
- The email address of the alert contact.
- id string
- The ID of the Alert Contact.
- phone
Num string - The mobile number of the alert contact.
- system
Noc boolean - Specifies whether the alert contact receives system notifications.
- webhook string
- Webhook Information.
- alert_
contact_ strid - Contact ID.
- alert_
contact_ strname - The name of the alert contact.
- create_
time str - The Creation Time Timestamp.
- ding_
robot_ strwebhook_ url - The webhook URL of the DingTalk chatbot.
- email str
- The email address of the alert contact.
- id str
- The ID of the Alert Contact.
- phone_
num str - The mobile number of the alert contact.
- system_
noc bool - Specifies whether the alert contact receives system notifications.
- webhook str
- Webhook Information.
- alert
Contact StringId - Contact ID.
- alert
Contact StringName - The name of the alert contact.
- create
Time String - The Creation Time Timestamp.
- ding
Robot StringWebhook Url - The webhook URL of the DingTalk chatbot.
- email String
- The email address of the alert contact.
- id String
- The ID of the Alert Contact.
- phone
Num String - The mobile number of the alert contact.
- system
Noc Boolean - Specifies whether the alert contact receives system notifications.
- webhook String
- Webhook Information.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.