Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi
alicloud.cloudfirewall.getInstances
Explore with Pulumi AI
This data source provides the Cloud Firewall Instances of the current Alibaba Cloud user.
NOTE: Available in v1.139.0+.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
const ids = alicloud.cloudfirewall.getInstances({});
export const cloudFirewallInstanceId1 = ids.then(ids => ids.instances?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.cloudfirewall.get_instances()
pulumi.export("cloudFirewallInstanceId1", ids.instances[0].id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cloudfirewall"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ids, err := cloudfirewall.GetInstances(ctx, nil, nil)
if err != nil {
return err
}
ctx.Export("cloudFirewallInstanceId1", ids.Instances[0].Id)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.CloudFirewall.GetInstances.Invoke();
return new Dictionary<string, object?>
{
["cloudFirewallInstanceId1"] = ids.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.cloudfirewall.CloudfirewallFunctions;
import com.pulumi.alicloud.cloudfirewall.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 ids = CloudfirewallFunctions.getInstances();
ctx.export("cloudFirewallInstanceId1", ids.applyValue(getInstancesResult -> getInstancesResult.instances()[0].id()));
}
}
variables:
ids:
fn::invoke:
Function: alicloud:cloudfirewall:getInstances
Arguments: {}
outputs:
cloudFirewallInstanceId1: ${ids.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(output_file: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetInstancesResult
def get_instances_output(output_file: Optional[pulumi.Input[str]] = 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:cloudfirewall/getInstances:getInstances
arguments:
# arguments dictionary
The following arguments are supported:
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- output
File String - File name where to save data source results (after running
pulumi preview
).
- output
File string - File name where to save data source results (after running
pulumi preview
).
- output_
file str - File name where to save data source results (after running
pulumi preview
).
- output
File String - File name where to save data source results (after running
pulumi preview
).
getInstances Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Instances
List<Pulumi.
Ali Cloud. Cloud Firewall. Outputs. Get Instances Instance> - Output
File string
- Id string
- The provider-assigned unique ID for this managed resource.
- Instances
[]Get
Instances Instance - Output
File string
- id String
- The provider-assigned unique ID for this managed resource.
- instances
List<Get
Instances Instance> - output
File String
- id string
- The provider-assigned unique ID for this managed resource.
- instances
Get
Instances Instance[] - output
File string
- id str
- The provider-assigned unique ID for this managed resource.
- instances
Sequence[Get
Instances Instance] - output_
file str
- id String
- The provider-assigned unique ID for this managed resource.
- instances List<Property Map>
- output
File String
Supporting Types
GetInstancesInstance
- Create
Time string - The Creation time of the resource.
- End
Time string - The end time of the resource..
- Id string
- The ID of the Instance.
- Instance
Id string - The first ID of the resource.
- Payment
Type string - The payment type of the resource. Valid values:
Subscription
. - Renewal
Duration stringUnit - Automatic renewal period unit. Valid values:
Month
,Year
. - Renewal
Status string - Automatic renewal status. Valid values:
AutoRenewal
,ManualRenewal
. Default Value:ManualRenewal
. - Status string
- The Status of Instance.
- Create
Time string - The Creation time of the resource.
- End
Time string - The end time of the resource..
- Id string
- The ID of the Instance.
- Instance
Id string - The first ID of the resource.
- Payment
Type string - The payment type of the resource. Valid values:
Subscription
. - Renewal
Duration stringUnit - Automatic renewal period unit. Valid values:
Month
,Year
. - Renewal
Status string - Automatic renewal status. Valid values:
AutoRenewal
,ManualRenewal
. Default Value:ManualRenewal
. - Status string
- The Status of Instance.
- create
Time String - The Creation time of the resource.
- end
Time String - The end time of the resource..
- id String
- The ID of the Instance.
- instance
Id String - The first ID of the resource.
- payment
Type String - The payment type of the resource. Valid values:
Subscription
. - renewal
Duration StringUnit - Automatic renewal period unit. Valid values:
Month
,Year
. - renewal
Status String - Automatic renewal status. Valid values:
AutoRenewal
,ManualRenewal
. Default Value:ManualRenewal
. - status String
- The Status of Instance.
- create
Time string - The Creation time of the resource.
- end
Time string - The end time of the resource..
- id string
- The ID of the Instance.
- instance
Id string - The first ID of the resource.
- payment
Type string - The payment type of the resource. Valid values:
Subscription
. - renewal
Duration stringUnit - Automatic renewal period unit. Valid values:
Month
,Year
. - renewal
Status string - Automatic renewal status. Valid values:
AutoRenewal
,ManualRenewal
. Default Value:ManualRenewal
. - status string
- The Status of Instance.
- create_
time str - The Creation time of the resource.
- end_
time str - The end time of the resource..
- id str
- The ID of the Instance.
- instance_
id str - The first ID of the resource.
- payment_
type str - The payment type of the resource. Valid values:
Subscription
. - renewal_
duration_ strunit - Automatic renewal period unit. Valid values:
Month
,Year
. - renewal_
status str - Automatic renewal status. Valid values:
AutoRenewal
,ManualRenewal
. Default Value:ManualRenewal
. - status str
- The Status of Instance.
- create
Time String - The Creation time of the resource.
- end
Time String - The end time of the resource..
- id String
- The ID of the Instance.
- instance
Id String - The first ID of the resource.
- payment
Type String - The payment type of the resource. Valid values:
Subscription
. - renewal
Duration StringUnit - Automatic renewal period unit. Valid values:
Month
,Year
. - renewal
Status String - Automatic renewal status. Valid values:
AutoRenewal
,ManualRenewal
. Default Value:ManualRenewal
. - status String
- The Status of Instance.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.