1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. waf
  5. getInstances
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.waf.getInstances

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a WAF datasource to retrieve instances.

    For information about WAF and how to use it, see What is Alibaba Cloud WAF.

    NOTE: Available in 1.90.0+ .

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const default = alicloud.waf.getInstances({
        ids: ["waf-cn-09k********"],
        status: 1,
        resourceGroupId: "rg-acfmwvv********",
        instanceSource: "waf-cloud",
    });
    export const theFirstWafInstanceId = _default.then(_default => _default.instances?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    default = alicloud.waf.get_instances(ids=["waf-cn-09k********"],
        status=1,
        resource_group_id="rg-acfmwvv********",
        instance_source="waf-cloud")
    pulumi.export("theFirstWafInstanceId", default.instances[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/waf"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_default, err := waf.GetInstances(ctx, &waf.GetInstancesArgs{
    			Ids: []string{
    				"waf-cn-09k********",
    			},
    			Status:          pulumi.IntRef(1),
    			ResourceGroupId: pulumi.StringRef("rg-acfmwvv********"),
    			InstanceSource:  pulumi.StringRef("waf-cloud"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("theFirstWafInstanceId", _default.Instances[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = AliCloud.Waf.GetInstances.Invoke(new()
        {
            Ids = new[]
            {
                "waf-cn-09k********",
            },
            Status = 1,
            ResourceGroupId = "rg-acfmwvv********",
            InstanceSource = "waf-cloud",
        });
    
        return new Dictionary<string, object?>
        {
            ["theFirstWafInstanceId"] = @default.Apply(@default => @default.Apply(getInstancesResult => getInstancesResult.Instances[0]?.Id)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.waf.WafFunctions;
    import com.pulumi.alicloud.waf.inputs.GetInstancesArgs;
    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 default = WafFunctions.getInstances(GetInstancesArgs.builder()
                .ids("waf-cn-09k********")
                .status("1")
                .resourceGroupId("rg-acfmwvv********")
                .instanceSource("waf-cloud")
                .build());
    
            ctx.export("theFirstWafInstanceId", default_.instances()[0].id());
        }
    }
    
    variables:
      default:
        fn::invoke:
          Function: alicloud:waf:getInstances
          Arguments:
            ids:
              - waf-cn-09k********
            status: '1'
            resourceGroupId: rg-acfmwvv********
            instanceSource: waf-cloud
    outputs:
      theFirstWafInstanceId: ${default.instances[0].id}
    

    Using getInstances

    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 getInstances(args: GetInstancesArgs, opts?: InvokeOptions): Promise<GetInstancesResult>
    function getInstancesOutput(args: GetInstancesOutputArgs, opts?: InvokeOptions): Output<GetInstancesResult>
    def get_instances(ids: Optional[Sequence[str]] = None,
                      instance_source: Optional[str] = None,
                      output_file: Optional[str] = None,
                      resource_group_id: Optional[str] = None,
                      status: Optional[int] = None,
                      opts: Optional[InvokeOptions] = None) -> GetInstancesResult
    def get_instances_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                      instance_source: Optional[pulumi.Input[str]] = None,
                      output_file: Optional[pulumi.Input[str]] = None,
                      resource_group_id: Optional[pulumi.Input[str]] = None,
                      status: Optional[pulumi.Input[int]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetInstancesResult]
    func GetInstances(ctx *Context, args *GetInstancesArgs, opts ...InvokeOption) (*GetInstancesResult, error)
    func GetInstancesOutput(ctx *Context, args *GetInstancesOutputArgs, opts ...InvokeOption) GetInstancesResultOutput

    > Note: This function is named GetInstances in the Go SDK.

    public static class GetInstances 
    {
        public static Task<GetInstancesResult> InvokeAsync(GetInstancesArgs args, InvokeOptions? opts = null)
        public static Output<GetInstancesResult> Invoke(GetInstancesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:waf/getInstances:getInstances
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of WAF instance IDs.
    InstanceSource string
    The source of the WAF instance.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ResourceGroupId string
    The ID of resource group to which WAF instance belongs.
    Status int
    The status of WAF instance to filter results. Optional value: 0: The instance has expired, 1 : The instance has not expired and is working properly.
    Ids []string
    A list of WAF instance IDs.
    InstanceSource string
    The source of the WAF instance.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ResourceGroupId string
    The ID of resource group to which WAF instance belongs.
    Status int
    The status of WAF instance to filter results. Optional value: 0: The instance has expired, 1 : The instance has not expired and is working properly.
    ids List<String>
    A list of WAF instance IDs.
    instanceSource String
    The source of the WAF instance.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    resourceGroupId String
    The ID of resource group to which WAF instance belongs.
    status Integer
    The status of WAF instance to filter results. Optional value: 0: The instance has expired, 1 : The instance has not expired and is working properly.
    ids string[]
    A list of WAF instance IDs.
    instanceSource string
    The source of the WAF instance.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    resourceGroupId string
    The ID of resource group to which WAF instance belongs.
    status number
    The status of WAF instance to filter results. Optional value: 0: The instance has expired, 1 : The instance has not expired and is working properly.
    ids Sequence[str]
    A list of WAF instance IDs.
    instance_source str
    The source of the WAF instance.
    output_file str
    File name where to save data source results (after running pulumi preview).
    resource_group_id str
    The ID of resource group to which WAF instance belongs.
    status int
    The status of WAF instance to filter results. Optional value: 0: The instance has expired, 1 : The instance has not expired and is working properly.
    ids List<String>
    A list of WAF instance IDs.
    instanceSource String
    The source of the WAF instance.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    resourceGroupId String
    The ID of resource group to which WAF instance belongs.
    status Number
    The status of WAF instance to filter results. Optional value: 0: The instance has expired, 1 : The instance has not expired and is working properly.

    getInstances Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    (Optional) A list of WAF instance IDs.
    Instances List<Pulumi.AliCloud.Waf.Outputs.GetInstancesInstance>
    A list of WAF instances. Each element contains the following attributes:
    InstanceSource string
    OutputFile string
    ResourceGroupId string
    Status int
    Indicates whether the WAF instance has expired.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    (Optional) A list of WAF instance IDs.
    Instances []GetInstancesInstance
    A list of WAF instances. Each element contains the following attributes:
    InstanceSource string
    OutputFile string
    ResourceGroupId string
    Status int
    Indicates whether the WAF instance has expired.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    (Optional) A list of WAF instance IDs.
    instances List<GetInstancesInstance>
    A list of WAF instances. Each element contains the following attributes:
    instanceSource String
    outputFile String
    resourceGroupId String
    status Integer
    Indicates whether the WAF instance has expired.
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    (Optional) A list of WAF instance IDs.
    instances GetInstancesInstance[]
    A list of WAF instances. Each element contains the following attributes:
    instanceSource string
    outputFile string
    resourceGroupId string
    status number
    Indicates whether the WAF instance has expired.
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    (Optional) A list of WAF instance IDs.
    instances Sequence[GetInstancesInstance]
    A list of WAF instances. Each element contains the following attributes:
    instance_source str
    output_file str
    resource_group_id str
    status int
    Indicates whether the WAF instance has expired.
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    (Optional) A list of WAF instance IDs.
    instances List<Property Map>
    A list of WAF instances. Each element contains the following attributes:
    instanceSource String
    outputFile String
    resourceGroupId String
    status Number
    Indicates whether the WAF instance has expired.

    Supporting Types

    GetInstancesInstance

    EndDate int
    The timestamp (in seconds) indicating when the WAF instance expires.
    Id string
    The ID of the WAF instance.
    InDebt int
    Indicates whether the WAF instance has overdue payments.
    InstanceId string
    The ID of WAF the instance.
    RemainDay int
    The number of days before the trial period of the WAF instance expires.
    Status int
    The status of WAF instance to filter results. Optional value: 0: The instance has expired, 1 : The instance has not expired and is working properly.
    SubscriptionType string
    Trial int
    Indicates whether this is a trial instance.
    EndDate int
    The timestamp (in seconds) indicating when the WAF instance expires.
    Id string
    The ID of the WAF instance.
    InDebt int
    Indicates whether the WAF instance has overdue payments.
    InstanceId string
    The ID of WAF the instance.
    RemainDay int
    The number of days before the trial period of the WAF instance expires.
    Status int
    The status of WAF instance to filter results. Optional value: 0: The instance has expired, 1 : The instance has not expired and is working properly.
    SubscriptionType string
    Trial int
    Indicates whether this is a trial instance.
    endDate Integer
    The timestamp (in seconds) indicating when the WAF instance expires.
    id String
    The ID of the WAF instance.
    inDebt Integer
    Indicates whether the WAF instance has overdue payments.
    instanceId String
    The ID of WAF the instance.
    remainDay Integer
    The number of days before the trial period of the WAF instance expires.
    status Integer
    The status of WAF instance to filter results. Optional value: 0: The instance has expired, 1 : The instance has not expired and is working properly.
    subscriptionType String
    trial Integer
    Indicates whether this is a trial instance.
    endDate number
    The timestamp (in seconds) indicating when the WAF instance expires.
    id string
    The ID of the WAF instance.
    inDebt number
    Indicates whether the WAF instance has overdue payments.
    instanceId string
    The ID of WAF the instance.
    remainDay number
    The number of days before the trial period of the WAF instance expires.
    status number
    The status of WAF instance to filter results. Optional value: 0: The instance has expired, 1 : The instance has not expired and is working properly.
    subscriptionType string
    trial number
    Indicates whether this is a trial instance.
    end_date int
    The timestamp (in seconds) indicating when the WAF instance expires.
    id str
    The ID of the WAF instance.
    in_debt int
    Indicates whether the WAF instance has overdue payments.
    instance_id str
    The ID of WAF the instance.
    remain_day int
    The number of days before the trial period of the WAF instance expires.
    status int
    The status of WAF instance to filter results. Optional value: 0: The instance has expired, 1 : The instance has not expired and is working properly.
    subscription_type str
    trial int
    Indicates whether this is a trial instance.
    endDate Number
    The timestamp (in seconds) indicating when the WAF instance expires.
    id String
    The ID of the WAF instance.
    inDebt Number
    Indicates whether the WAF instance has overdue payments.
    instanceId String
    The ID of WAF the instance.
    remainDay Number
    The number of days before the trial period of the WAF instance expires.
    status Number
    The status of WAF instance to filter results. Optional value: 0: The instance has expired, 1 : The instance has not expired and is working properly.
    subscriptionType String
    trial Number
    Indicates whether this is a trial instance.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi