1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. waf
  5. getInstances
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.waf.getInstances

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 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 since v1.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);
Copy
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)
Copy
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
	})
}
Copy
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)),
    };
});
Copy
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());
    }
}
Copy
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}
Copy

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>
Copy
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]
Copy
func GetInstances(ctx *Context, args *GetInstancesArgs, opts ...InvokeOption) (*GetInstancesResult, error)
func GetInstancesOutput(ctx *Context, args *GetInstancesOutputArgs, opts ...InvokeOption) GetInstancesResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
public static Output<GetInstancesResult> getInstances(GetInstancesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:waf/getInstances:getInstances
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids Changes to this property will trigger replacement. List<string>
A list of WAF instance IDs.
InstanceSource Changes to this property will trigger replacement. string
The source of the WAF instance.
OutputFile string
File name where to save data source results (after running pulumi preview).
ResourceGroupId Changes to this property will trigger replacement. string
The ID of resource group to which WAF instance belongs.
Status Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. []string
A list of WAF instance IDs.
InstanceSource Changes to this property will trigger replacement. string
The source of the WAF instance.
OutputFile string
File name where to save data source results (after running pulumi preview).
ResourceGroupId Changes to this property will trigger replacement. string
The ID of resource group to which WAF instance belongs.
Status Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<String>
A list of WAF instance IDs.
instanceSource Changes to this property will trigger replacement. String
The source of the WAF instance.
outputFile String
File name where to save data source results (after running pulumi preview).
resourceGroupId Changes to this property will trigger replacement. String
The ID of resource group to which WAF instance belongs.
status Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string[]
A list of WAF instance IDs.
instanceSource Changes to this property will trigger replacement. string
The source of the WAF instance.
outputFile string
File name where to save data source results (after running pulumi preview).
resourceGroupId Changes to this property will trigger replacement. string
The ID of resource group to which WAF instance belongs.
status Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. Sequence[str]
A list of WAF instance IDs.
instance_source Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
The ID of resource group to which WAF instance belongs.
status Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<String>
A list of WAF instance IDs.
instanceSource Changes to this property will trigger replacement. String
The source of the WAF instance.
outputFile String
File name where to save data source results (after running pulumi preview).
resourceGroupId Changes to this property will trigger replacement. String
The ID of resource group to which WAF instance belongs.
status Changes to this property will trigger replacement. 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 This property is required. int
The timestamp (in seconds) indicating when the WAF instance expires.
Id This property is required. string
The ID of the WAF instance.
InDebt This property is required. int
Indicates whether the WAF instance has overdue payments.
InstanceId This property is required. string
The ID of WAF the instance.
RemainDay This property is required. int
The number of days before the trial period of the WAF instance expires.
Status This property is required. 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 This property is required. string
Trial This property is required. int
Indicates whether this is a trial instance.
EndDate This property is required. int
The timestamp (in seconds) indicating when the WAF instance expires.
Id This property is required. string
The ID of the WAF instance.
InDebt This property is required. int
Indicates whether the WAF instance has overdue payments.
InstanceId This property is required. string
The ID of WAF the instance.
RemainDay This property is required. int
The number of days before the trial period of the WAF instance expires.
Status This property is required. 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 This property is required. string
Trial This property is required. int
Indicates whether this is a trial instance.
endDate This property is required. Integer
The timestamp (in seconds) indicating when the WAF instance expires.
id This property is required. String
The ID of the WAF instance.
inDebt This property is required. Integer
Indicates whether the WAF instance has overdue payments.
instanceId This property is required. String
The ID of WAF the instance.
remainDay This property is required. Integer
The number of days before the trial period of the WAF instance expires.
status This property is required. 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 This property is required. String
trial This property is required. Integer
Indicates whether this is a trial instance.
endDate This property is required. number
The timestamp (in seconds) indicating when the WAF instance expires.
id This property is required. string
The ID of the WAF instance.
inDebt This property is required. number
Indicates whether the WAF instance has overdue payments.
instanceId This property is required. string
The ID of WAF the instance.
remainDay This property is required. number
The number of days before the trial period of the WAF instance expires.
status This property is required. 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 This property is required. string
trial This property is required. number
Indicates whether this is a trial instance.
end_date This property is required. int
The timestamp (in seconds) indicating when the WAF instance expires.
id This property is required. str
The ID of the WAF instance.
in_debt This property is required. int
Indicates whether the WAF instance has overdue payments.
instance_id This property is required. str
The ID of WAF the instance.
remain_day This property is required. int
The number of days before the trial period of the WAF instance expires.
status This property is required. 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 This property is required. str
trial This property is required. int
Indicates whether this is a trial instance.
endDate This property is required. Number
The timestamp (in seconds) indicating when the WAF instance expires.
id This property is required. String
The ID of the WAF instance.
inDebt This property is required. Number
Indicates whether the WAF instance has overdue payments.
instanceId This property is required. String
The ID of WAF the instance.
remainDay This property is required. Number
The number of days before the trial period of the WAF instance expires.
status This property is required. 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 This property is required. String
trial This property is required. 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.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi