1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cen
  5. getTransitRouterAvailableResources
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

alicloud.cen.getTransitRouterAvailableResources

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides the CEN Transit Router Available Resources of the current Alibaba Cloud user.

    NOTE: Available since v1.163.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.cen.getTransitRouterAvailableResources({});
    export const masterId = ids.then(ids => ids.resources?.[0]?.masterZones?.[0]);
    export const slaveId = ids.then(ids => ids.resources?.[0]?.slaveZones?.[0]);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.cen.get_transit_router_available_resources()
    pulumi.export("masterId", ids.resources[0].master_zones[0])
    pulumi.export("slaveId", ids.resources[0].slave_zones[0])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cen"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := cen.GetTransitRouterAvailableResources(ctx, &cen.GetTransitRouterAvailableResourcesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("masterId", ids.Resources[0].MasterZones[0])
    		ctx.Export("slaveId", ids.Resources[0].SlaveZones[0])
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Cen.GetTransitRouterAvailableResources.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["masterId"] = ids.Apply(getTransitRouterAvailableResourcesResult => getTransitRouterAvailableResourcesResult.Resources[0]?.MasterZones[0]),
            ["slaveId"] = ids.Apply(getTransitRouterAvailableResourcesResult => getTransitRouterAvailableResourcesResult.Resources[0]?.SlaveZones[0]),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.cen.CenFunctions;
    import com.pulumi.alicloud.cen.inputs.GetTransitRouterAvailableResourcesArgs;
    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 = CenFunctions.getTransitRouterAvailableResources();
    
            ctx.export("masterId", ids.applyValue(getTransitRouterAvailableResourcesResult -> getTransitRouterAvailableResourcesResult.resources()[0].masterZones()[0]));
            ctx.export("slaveId", ids.applyValue(getTransitRouterAvailableResourcesResult -> getTransitRouterAvailableResourcesResult.resources()[0].slaveZones()[0]));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:cen:getTransitRouterAvailableResources
          Arguments: {}
    outputs:
      masterId: ${ids.resources[0].masterZones[0]}
      slaveId: ${ids.resources[0].slaveZones[0]}
    

    Using getTransitRouterAvailableResources

    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 getTransitRouterAvailableResources(args: GetTransitRouterAvailableResourcesArgs, opts?: InvokeOptions): Promise<GetTransitRouterAvailableResourcesResult>
    function getTransitRouterAvailableResourcesOutput(args: GetTransitRouterAvailableResourcesOutputArgs, opts?: InvokeOptions): Output<GetTransitRouterAvailableResourcesResult>
    def get_transit_router_available_resources(output_file: Optional[str] = None,
                                               support_multicast: Optional[bool] = None,
                                               opts: Optional[InvokeOptions] = None) -> GetTransitRouterAvailableResourcesResult
    def get_transit_router_available_resources_output(output_file: Optional[pulumi.Input[str]] = None,
                                               support_multicast: Optional[pulumi.Input[bool]] = None,
                                               opts: Optional[InvokeOptions] = None) -> Output[GetTransitRouterAvailableResourcesResult]
    func GetTransitRouterAvailableResources(ctx *Context, args *GetTransitRouterAvailableResourcesArgs, opts ...InvokeOption) (*GetTransitRouterAvailableResourcesResult, error)
    func GetTransitRouterAvailableResourcesOutput(ctx *Context, args *GetTransitRouterAvailableResourcesOutputArgs, opts ...InvokeOption) GetTransitRouterAvailableResourcesResultOutput

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

    public static class GetTransitRouterAvailableResources 
    {
        public static Task<GetTransitRouterAvailableResourcesResult> InvokeAsync(GetTransitRouterAvailableResourcesArgs args, InvokeOptions? opts = null)
        public static Output<GetTransitRouterAvailableResourcesResult> Invoke(GetTransitRouterAvailableResourcesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTransitRouterAvailableResourcesResult> getTransitRouterAvailableResources(GetTransitRouterAvailableResourcesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:cen/getTransitRouterAvailableResources:getTransitRouterAvailableResources
      arguments:
        # arguments dictionary

    The following arguments are supported:

    OutputFile string
    File name where to save data source results (after running pulumi preview).
    SupportMulticast bool
    Specifies whether to query only the zones in which the multicast feature is supported.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    SupportMulticast bool
    Specifies whether to query only the zones in which the multicast feature is supported.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    supportMulticast Boolean
    Specifies whether to query only the zones in which the multicast feature is supported.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    supportMulticast boolean
    Specifies whether to query only the zones in which the multicast feature is supported.
    output_file str
    File name where to save data source results (after running pulumi preview).
    support_multicast bool
    Specifies whether to query only the zones in which the multicast feature is supported.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    supportMulticast Boolean
    Specifies whether to query only the zones in which the multicast feature is supported.

    getTransitRouterAvailableResources Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Resources List<Pulumi.AliCloud.Cen.Outputs.GetTransitRouterAvailableResourcesResource>
    A list of Cen Transit Router Available Resources. Each element contains the following attributes:
    OutputFile string
    SupportMulticast bool
    (Available since v1.225.0) Indicates whether the zone supports the multicast feature.
    Id string
    The provider-assigned unique ID for this managed resource.
    Resources []GetTransitRouterAvailableResourcesResource
    A list of Cen Transit Router Available Resources. Each element contains the following attributes:
    OutputFile string
    SupportMulticast bool
    (Available since v1.225.0) Indicates whether the zone supports the multicast feature.
    id String
    The provider-assigned unique ID for this managed resource.
    resources List<GetTransitRouterAvailableResourcesResource>
    A list of Cen Transit Router Available Resources. Each element contains the following attributes:
    outputFile String
    supportMulticast Boolean
    (Available since v1.225.0) Indicates whether the zone supports the multicast feature.
    id string
    The provider-assigned unique ID for this managed resource.
    resources GetTransitRouterAvailableResourcesResource[]
    A list of Cen Transit Router Available Resources. Each element contains the following attributes:
    outputFile string
    supportMulticast boolean
    (Available since v1.225.0) Indicates whether the zone supports the multicast feature.
    id str
    The provider-assigned unique ID for this managed resource.
    resources Sequence[GetTransitRouterAvailableResourcesResource]
    A list of Cen Transit Router Available Resources. Each element contains the following attributes:
    output_file str
    support_multicast bool
    (Available since v1.225.0) Indicates whether the zone supports the multicast feature.
    id String
    The provider-assigned unique ID for this managed resource.
    resources List<Property Map>
    A list of Cen Transit Router Available Resources. Each element contains the following attributes:
    outputFile String
    supportMulticast Boolean
    (Available since v1.225.0) Indicates whether the zone supports the multicast feature.

    Supporting Types

    GetTransitRouterAvailableResourcesResource

    AvailableZones List<string>
    (Available since v1.225.0) The list of available zones.
    MasterZones List<string>
    The list of primary zones.
    SlaveZones List<string>
    The list of secondary zones.
    SupportMulticast bool
    Specifies whether to query only the zones in which the multicast feature is supported.
    AvailableZones []string
    (Available since v1.225.0) The list of available zones.
    MasterZones []string
    The list of primary zones.
    SlaveZones []string
    The list of secondary zones.
    SupportMulticast bool
    Specifies whether to query only the zones in which the multicast feature is supported.
    availableZones List<String>
    (Available since v1.225.0) The list of available zones.
    masterZones List<String>
    The list of primary zones.
    slaveZones List<String>
    The list of secondary zones.
    supportMulticast Boolean
    Specifies whether to query only the zones in which the multicast feature is supported.
    availableZones string[]
    (Available since v1.225.0) The list of available zones.
    masterZones string[]
    The list of primary zones.
    slaveZones string[]
    The list of secondary zones.
    supportMulticast boolean
    Specifies whether to query only the zones in which the multicast feature is supported.
    available_zones Sequence[str]
    (Available since v1.225.0) The list of available zones.
    master_zones Sequence[str]
    The list of primary zones.
    slave_zones Sequence[str]
    The list of secondary zones.
    support_multicast bool
    Specifies whether to query only the zones in which the multicast feature is supported.
    availableZones List<String>
    (Available since v1.225.0) The list of available zones.
    masterZones List<String>
    The list of primary zones.
    slaveZones List<String>
    The list of secondary zones.
    supportMulticast Boolean
    Specifies whether to query only the zones in which the multicast feature is supported.

    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.66.0 published on Friday, Nov 15, 2024 by Pulumi