Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.waf.getInstances
Explore with Pulumi AI
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.
- Instance
Source string - The source of the WAF instance.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Resource
Group stringId - 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.
- Instance
Source string - The source of the WAF instance.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Resource
Group stringId - 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.
- instance
Source String - The source of the WAF instance.
- output
File String - File name where to save data source results (after running
pulumi preview
). - resource
Group StringId - 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.
- instance
Source string - The source of the WAF instance.
- output
File string - File name where to save data source results (after running
pulumi preview
). - resource
Group stringId - 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_ strid - 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.
- instance
Source String - The source of the WAF instance.
- output
File String - File name where to save data source results (after running
pulumi preview
). - resource
Group StringId - 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.
Ali Cloud. Waf. Outputs. Get Instances Instance> - A list of WAF instances. Each element contains the following attributes:
- Instance
Source string - Output
File string - Resource
Group stringId - 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
[]Get
Instances Instance - A list of WAF instances. Each element contains the following attributes:
- Instance
Source string - Output
File string - Resource
Group stringId - 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<Get
Instances Instance> - A list of WAF instances. Each element contains the following attributes:
- instance
Source String - output
File String - resource
Group StringId - 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
Get
Instances Instance[] - A list of WAF instances. Each element contains the following attributes:
- instance
Source string - output
File string - resource
Group stringId - 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[Get
Instances Instance] - A list of WAF instances. Each element contains the following attributes:
- instance_
source str - output_
file str - resource_
group_ strid - 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:
- instance
Source String - output
File String - resource
Group StringId - status Number
- Indicates whether the WAF instance has expired.
Supporting Types
GetInstancesInstance
- End
Date int - The timestamp (in seconds) indicating when the WAF instance expires.
- Id string
- The ID of the WAF instance.
- In
Debt int - Indicates whether the WAF instance has overdue payments.
- Instance
Id string - 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 string - Trial int
- Indicates whether this is a trial instance.
- End
Date int - The timestamp (in seconds) indicating when the WAF instance expires.
- Id string
- The ID of the WAF instance.
- In
Debt int - Indicates whether the WAF instance has overdue payments.
- Instance
Id string - 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 string - Trial int
- Indicates whether this is a trial instance.
- end
Date Integer - The timestamp (in seconds) indicating when the WAF instance expires.
- id String
- The ID of the WAF instance.
- in
Debt Integer - Indicates whether the WAF instance has overdue payments.
- instance
Id String - The ID of WAF the instance.
- remain
Day 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. - subscription
Type String - trial Integer
- Indicates whether this is a trial instance.
- end
Date number - The timestamp (in seconds) indicating when the WAF instance expires.
- id string
- The ID of the WAF instance.
- in
Debt number - Indicates whether the WAF instance has overdue payments.
- instance
Id string - The ID of WAF the instance.
- remain
Day 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. - subscription
Type 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.
- end
Date Number - The timestamp (in seconds) indicating when the WAF instance expires.
- id String
- The ID of the WAF instance.
- in
Debt Number - Indicates whether the WAF instance has overdue payments.
- instance
Id String - The ID of WAF the instance.
- remain
Day 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. - subscription
Type 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.