1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. apigateway
  5. getPlugins
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.apigateway.getPlugins

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    This data source provides the Api Gateway Plugins of the current Alibaba Cloud user.

    NOTE: Available in v1.187.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.apigateway.getPlugins({});
    export const apiGatewayPluginId1 = ids.then(ids => ids.plugins?.[0]?.id);
    const nameRegex = alicloud.apigateway.getPlugins({
        nameRegex: "^my-Plugin",
    });
    export const apiGatewayPluginId2 = nameRegex.then(nameRegex => nameRegex.plugins?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.apigateway.get_plugins()
    pulumi.export("apiGatewayPluginId1", ids.plugins[0].id)
    name_regex = alicloud.apigateway.get_plugins(name_regex="^my-Plugin")
    pulumi.export("apiGatewayPluginId2", name_regex.plugins[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/apigateway"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := apigateway.GetPlugins(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("apiGatewayPluginId1", ids.Plugins[0].Id)
    		nameRegex, err := apigateway.GetPlugins(ctx, &apigateway.GetPluginsArgs{
    			NameRegex: pulumi.StringRef("^my-Plugin"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("apiGatewayPluginId2", nameRegex.Plugins[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.ApiGateway.GetPlugins.Invoke();
    
        var nameRegex = AliCloud.ApiGateway.GetPlugins.Invoke(new()
        {
            NameRegex = "^my-Plugin",
        });
    
        return new Dictionary<string, object?>
        {
            ["apiGatewayPluginId1"] = ids.Apply(getPluginsResult => getPluginsResult.Plugins[0]?.Id),
            ["apiGatewayPluginId2"] = nameRegex.Apply(getPluginsResult => getPluginsResult.Plugins[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.apigateway.ApigatewayFunctions;
    import com.pulumi.alicloud.apigateway.inputs.GetPluginsArgs;
    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 = ApigatewayFunctions.getPlugins();
    
            ctx.export("apiGatewayPluginId1", ids.applyValue(getPluginsResult -> getPluginsResult.plugins()[0].id()));
            final var nameRegex = ApigatewayFunctions.getPlugins(GetPluginsArgs.builder()
                .nameRegex("^my-Plugin")
                .build());
    
            ctx.export("apiGatewayPluginId2", nameRegex.applyValue(getPluginsResult -> getPluginsResult.plugins()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:apigateway:getPlugins
          Arguments: {}
      nameRegex:
        fn::invoke:
          Function: alicloud:apigateway:getPlugins
          Arguments:
            nameRegex: ^my-Plugin
    outputs:
      apiGatewayPluginId1: ${ids.plugins[0].id}
      apiGatewayPluginId2: ${nameRegex.plugins[0].id}
    

    Using getPlugins

    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 getPlugins(args: GetPluginsArgs, opts?: InvokeOptions): Promise<GetPluginsResult>
    function getPluginsOutput(args: GetPluginsOutputArgs, opts?: InvokeOptions): Output<GetPluginsResult>
    def get_plugins(ids: Optional[Sequence[str]] = None,
                    name_regex: Optional[str] = None,
                    output_file: Optional[str] = None,
                    page_number: Optional[int] = None,
                    page_size: Optional[int] = None,
                    plugin_name: Optional[str] = None,
                    plugin_type: Optional[str] = None,
                    tags: Optional[Mapping[str, Any]] = None,
                    opts: Optional[InvokeOptions] = None) -> GetPluginsResult
    def get_plugins_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                    name_regex: Optional[pulumi.Input[str]] = None,
                    output_file: Optional[pulumi.Input[str]] = None,
                    page_number: Optional[pulumi.Input[int]] = None,
                    page_size: Optional[pulumi.Input[int]] = None,
                    plugin_name: Optional[pulumi.Input[str]] = None,
                    plugin_type: Optional[pulumi.Input[str]] = None,
                    tags: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetPluginsResult]
    func GetPlugins(ctx *Context, args *GetPluginsArgs, opts ...InvokeOption) (*GetPluginsResult, error)
    func GetPluginsOutput(ctx *Context, args *GetPluginsOutputArgs, opts ...InvokeOption) GetPluginsResultOutput

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

    public static class GetPlugins 
    {
        public static Task<GetPluginsResult> InvokeAsync(GetPluginsArgs args, InvokeOptions? opts = null)
        public static Output<GetPluginsResult> Invoke(GetPluginsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetPluginsResult> getPlugins(GetPluginsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:apigateway/getPlugins:getPlugins
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Plugin IDs.
    NameRegex string
    A regex string to filter results by Plugin name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    PluginName string
    The name of the plug-in that you want to create. It can contain uppercase English letters, lowercase English letters, Chinese characters, numbers, and underscores (). It must be 4 to 50 characters in length and cannot start with an underscore ().
    PluginType string
    The type of the plug-in. Valid values: backendSignature, caching, cors, ipControl, jwtAuth, trafficControl.
    Tags Dictionary<string, object>
    A mapping of tags to assign to the resource.
    Ids []string
    A list of Plugin IDs.
    NameRegex string
    A regex string to filter results by Plugin name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    PluginName string
    The name of the plug-in that you want to create. It can contain uppercase English letters, lowercase English letters, Chinese characters, numbers, and underscores (). It must be 4 to 50 characters in length and cannot start with an underscore ().
    PluginType string
    The type of the plug-in. Valid values: backendSignature, caching, cors, ipControl, jwtAuth, trafficControl.
    Tags map[string]interface{}
    A mapping of tags to assign to the resource.
    ids List<String>
    A list of Plugin IDs.
    nameRegex String
    A regex string to filter results by Plugin name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Integer
    pageSize Integer
    pluginName String
    The name of the plug-in that you want to create. It can contain uppercase English letters, lowercase English letters, Chinese characters, numbers, and underscores (). It must be 4 to 50 characters in length and cannot start with an underscore ().
    pluginType String
    The type of the plug-in. Valid values: backendSignature, caching, cors, ipControl, jwtAuth, trafficControl.
    tags Map<String,Object>
    A mapping of tags to assign to the resource.
    ids string[]
    A list of Plugin IDs.
    nameRegex string
    A regex string to filter results by Plugin name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    pageNumber number
    pageSize number
    pluginName string
    The name of the plug-in that you want to create. It can contain uppercase English letters, lowercase English letters, Chinese characters, numbers, and underscores (). It must be 4 to 50 characters in length and cannot start with an underscore ().
    pluginType string
    The type of the plug-in. Valid values: backendSignature, caching, cors, ipControl, jwtAuth, trafficControl.
    tags {[key: string]: any}
    A mapping of tags to assign to the resource.
    ids Sequence[str]
    A list of Plugin IDs.
    name_regex str
    A regex string to filter results by Plugin name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    page_number int
    page_size int
    plugin_name str
    The name of the plug-in that you want to create. It can contain uppercase English letters, lowercase English letters, Chinese characters, numbers, and underscores (). It must be 4 to 50 characters in length and cannot start with an underscore ().
    plugin_type str
    The type of the plug-in. Valid values: backendSignature, caching, cors, ipControl, jwtAuth, trafficControl.
    tags Mapping[str, Any]
    A mapping of tags to assign to the resource.
    ids List<String>
    A list of Plugin IDs.
    nameRegex String
    A regex string to filter results by Plugin name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Number
    pageSize Number
    pluginName String
    The name of the plug-in that you want to create. It can contain uppercase English letters, lowercase English letters, Chinese characters, numbers, and underscores (). It must be 4 to 50 characters in length and cannot start with an underscore ().
    pluginType String
    The type of the plug-in. Valid values: backendSignature, caching, cors, ipControl, jwtAuth, trafficControl.
    tags Map<Any>
    A mapping of tags to assign to the resource.

    getPlugins Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    Plugins List<Pulumi.AliCloud.ApiGateway.Outputs.GetPluginsPlugin>
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    PluginName string
    PluginType string
    Tags Dictionary<string, object>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    Plugins []GetPluginsPlugin
    NameRegex string
    OutputFile string
    PageNumber int
    PageSize int
    PluginName string
    PluginType string
    Tags map[string]interface{}
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    plugins List<GetPluginsPlugin>
    nameRegex String
    outputFile String
    pageNumber Integer
    pageSize Integer
    pluginName String
    pluginType String
    tags Map<String,Object>
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    plugins GetPluginsPlugin[]
    nameRegex string
    outputFile string
    pageNumber number
    pageSize number
    pluginName string
    pluginType string
    tags {[key: string]: any}
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    plugins Sequence[GetPluginsPlugin]
    name_regex str
    output_file str
    page_number int
    page_size int
    plugin_name str
    plugin_type str
    tags Mapping[str, Any]
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    plugins List<Property Map>
    nameRegex String
    outputFile String
    pageNumber Number
    pageSize Number
    pluginName String
    pluginType String
    tags Map<Any>

    Supporting Types

    GetPluginsPlugin

    CreateTime string
    The CreateTime of the resource.
    Description string
    The description of the plug-in, which cannot exceed 200 characters.
    Id string
    The ID of the Plugin.
    ModifiedTime string
    The ModifiedTime of the resource.
    PluginData string
    The definition statement of the plug-in. Plug-in definition statements in the JSON and YAML formats are supported.
    PluginId string
    The first ID of the resource.
    PluginName string
    The name of the plug-in that you want to create.
    PluginType string
    The type of the plug-in.
    Tags Dictionary<string, object>
    The tag of the resource.
    CreateTime string
    The CreateTime of the resource.
    Description string
    The description of the plug-in, which cannot exceed 200 characters.
    Id string
    The ID of the Plugin.
    ModifiedTime string
    The ModifiedTime of the resource.
    PluginData string
    The definition statement of the plug-in. Plug-in definition statements in the JSON and YAML formats are supported.
    PluginId string
    The first ID of the resource.
    PluginName string
    The name of the plug-in that you want to create.
    PluginType string
    The type of the plug-in.
    Tags map[string]interface{}
    The tag of the resource.
    createTime String
    The CreateTime of the resource.
    description String
    The description of the plug-in, which cannot exceed 200 characters.
    id String
    The ID of the Plugin.
    modifiedTime String
    The ModifiedTime of the resource.
    pluginData String
    The definition statement of the plug-in. Plug-in definition statements in the JSON and YAML formats are supported.
    pluginId String
    The first ID of the resource.
    pluginName String
    The name of the plug-in that you want to create.
    pluginType String
    The type of the plug-in.
    tags Map<String,Object>
    The tag of the resource.
    createTime string
    The CreateTime of the resource.
    description string
    The description of the plug-in, which cannot exceed 200 characters.
    id string
    The ID of the Plugin.
    modifiedTime string
    The ModifiedTime of the resource.
    pluginData string
    The definition statement of the plug-in. Plug-in definition statements in the JSON and YAML formats are supported.
    pluginId string
    The first ID of the resource.
    pluginName string
    The name of the plug-in that you want to create.
    pluginType string
    The type of the plug-in.
    tags {[key: string]: any}
    The tag of the resource.
    create_time str
    The CreateTime of the resource.
    description str
    The description of the plug-in, which cannot exceed 200 characters.
    id str
    The ID of the Plugin.
    modified_time str
    The ModifiedTime of the resource.
    plugin_data str
    The definition statement of the plug-in. Plug-in definition statements in the JSON and YAML formats are supported.
    plugin_id str
    The first ID of the resource.
    plugin_name str
    The name of the plug-in that you want to create.
    plugin_type str
    The type of the plug-in.
    tags Mapping[str, Any]
    The tag of the resource.
    createTime String
    The CreateTime of the resource.
    description String
    The description of the plug-in, which cannot exceed 200 characters.
    id String
    The ID of the Plugin.
    modifiedTime String
    The ModifiedTime of the resource.
    pluginData String
    The definition statement of the plug-in. Plug-in definition statements in the JSON and YAML formats are supported.
    pluginId String
    The first ID of the resource.
    pluginName String
    The name of the plug-in that you want to create.
    pluginType String
    The type of the plug-in.
    tags Map<Any>
    The tag of the resource.

    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.57.1 published on Wednesday, Jun 26, 2024 by Pulumi