1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. cloudfirewall
  5. getInstances
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

alicloud.cloudfirewall.getInstances

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi

    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:

    OutputFile string
    File name where to save data source results (after running pulumi preview).
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    outputFile String
    File name where to save data source results (after running pulumi preview).
    outputFile 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).
    outputFile 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.AliCloud.CloudFirewall.Outputs.GetInstancesInstance>
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Instances []GetInstancesInstance
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    instances List<GetInstancesInstance>
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    instances GetInstancesInstance[]
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    instances Sequence[GetInstancesInstance]
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    instances List<Property Map>
    outputFile String

    Supporting Types

    GetInstancesInstance

    CreateTime string
    The Creation time of the resource.
    EndTime string
    The end time of the resource..
    Id string
    The ID of the Instance.
    InstanceId string
    The first ID of the resource.
    PaymentType string
    The payment type of the resource. Valid values: Subscription.
    RenewalDurationUnit string
    Automatic renewal period unit. Valid values: Month,Year.
    RenewalStatus string
    Automatic renewal status. Valid values: AutoRenewal,ManualRenewal. Default Value: ManualRenewal.
    Status string
    The Status of Instance.
    CreateTime string
    The Creation time of the resource.
    EndTime string
    The end time of the resource..
    Id string
    The ID of the Instance.
    InstanceId string
    The first ID of the resource.
    PaymentType string
    The payment type of the resource. Valid values: Subscription.
    RenewalDurationUnit string
    Automatic renewal period unit. Valid values: Month,Year.
    RenewalStatus string
    Automatic renewal status. Valid values: AutoRenewal,ManualRenewal. Default Value: ManualRenewal.
    Status string
    The Status of Instance.
    createTime String
    The Creation time of the resource.
    endTime String
    The end time of the resource..
    id String
    The ID of the Instance.
    instanceId String
    The first ID of the resource.
    paymentType String
    The payment type of the resource. Valid values: Subscription.
    renewalDurationUnit String
    Automatic renewal period unit. Valid values: Month,Year.
    renewalStatus String
    Automatic renewal status. Valid values: AutoRenewal,ManualRenewal. Default Value: ManualRenewal.
    status String
    The Status of Instance.
    createTime string
    The Creation time of the resource.
    endTime string
    The end time of the resource..
    id string
    The ID of the Instance.
    instanceId string
    The first ID of the resource.
    paymentType string
    The payment type of the resource. Valid values: Subscription.
    renewalDurationUnit string
    Automatic renewal period unit. Valid values: Month,Year.
    renewalStatus 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_unit str
    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.
    createTime String
    The Creation time of the resource.
    endTime String
    The end time of the resource..
    id String
    The ID of the Instance.
    instanceId String
    The first ID of the resource.
    paymentType String
    The payment type of the resource. Valid values: Subscription.
    renewalDurationUnit String
    Automatic renewal period unit. Valid values: Month,Year.
    renewalStatus 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.
    alicloud logo
    Alibaba Cloud v3.51.0 published on Saturday, Mar 23, 2024 by Pulumi