1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. apigateway
  5. getPlugins
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.apigateway.getPlugins

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 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);
Copy
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)
Copy
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, &apigateway.GetPluginsArgs{}, 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
	})
}
Copy
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),
    };
});
Copy
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()));
    }
}
Copy
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}
Copy

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>
Copy
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, str]] = 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, pulumi.Input[str]]]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetPluginsResult]
Copy
func GetPlugins(ctx *Context, args *GetPluginsArgs, opts ...InvokeOption) (*GetPluginsResult, error)
func GetPluginsOutput(ctx *Context, args *GetPluginsOutputArgs, opts ...InvokeOption) GetPluginsResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetPluginsResult> getPlugins(GetPluginsArgs args, InvokeOptions options)
public static Output<GetPluginsResult> getPlugins(GetPluginsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:apigateway/getPlugins:getPlugins
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids Changes to this property will trigger replacement. List<string>
A list of Plugin IDs.
NameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The type of the plug-in. Valid values: backendSignature, caching, cors, ipControl, jwtAuth, trafficControl.
Tags Dictionary<string, string>
A mapping of tags to assign to the resource.
Ids Changes to this property will trigger replacement. []string
A list of Plugin IDs.
NameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The type of the plug-in. Valid values: backendSignature, caching, cors, ipControl, jwtAuth, trafficControl.
Tags map[string]string
A mapping of tags to assign to the resource.
ids Changes to this property will trigger replacement. List<String>
A list of Plugin IDs.
nameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The type of the plug-in. Valid values: backendSignature, caching, cors, ipControl, jwtAuth, trafficControl.
tags Map<String,String>
A mapping of tags to assign to the resource.
ids Changes to this property will trigger replacement. string[]
A list of Plugin IDs.
nameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string
The type of the plug-in. Valid values: backendSignature, caching, cors, ipControl, jwtAuth, trafficControl.
tags {[key: string]: string}
A mapping of tags to assign to the resource.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Plugin IDs.
name_regex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. str
The type of the plug-in. Valid values: backendSignature, caching, cors, ipControl, jwtAuth, trafficControl.
tags Mapping[str, str]
A mapping of tags to assign to the resource.
ids Changes to this property will trigger replacement. List<String>
A list of Plugin IDs.
nameRegex Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. String
The type of the plug-in. Valid values: backendSignature, caching, cors, ipControl, jwtAuth, trafficControl.
tags Map<String>
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, string>
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]string
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,String>
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]: string}
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, str]
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<String>

Supporting Types

GetPluginsPlugin

CreateTime This property is required. string
The CreateTime of the resource.
Description This property is required. string
The description of the plug-in, which cannot exceed 200 characters.
Id This property is required. string
The ID of the Plugin.
ModifiedTime This property is required. string
The ModifiedTime of the resource.
PluginData This property is required. string
The definition statement of the plug-in. Plug-in definition statements in the JSON and YAML formats are supported.
PluginId This property is required. string
The first ID of the resource.
PluginName This property is required. string
The name of the plug-in that you want to create.
PluginType This property is required. string
The type of the plug-in.
Tags This property is required. Dictionary<string, string>
The tag of the resource.
CreateTime This property is required. string
The CreateTime of the resource.
Description This property is required. string
The description of the plug-in, which cannot exceed 200 characters.
Id This property is required. string
The ID of the Plugin.
ModifiedTime This property is required. string
The ModifiedTime of the resource.
PluginData This property is required. string
The definition statement of the plug-in. Plug-in definition statements in the JSON and YAML formats are supported.
PluginId This property is required. string
The first ID of the resource.
PluginName This property is required. string
The name of the plug-in that you want to create.
PluginType This property is required. string
The type of the plug-in.
Tags This property is required. map[string]string
The tag of the resource.
createTime This property is required. String
The CreateTime of the resource.
description This property is required. String
The description of the plug-in, which cannot exceed 200 characters.
id This property is required. String
The ID of the Plugin.
modifiedTime This property is required. String
The ModifiedTime of the resource.
pluginData This property is required. String
The definition statement of the plug-in. Plug-in definition statements in the JSON and YAML formats are supported.
pluginId This property is required. String
The first ID of the resource.
pluginName This property is required. String
The name of the plug-in that you want to create.
pluginType This property is required. String
The type of the plug-in.
tags This property is required. Map<String,String>
The tag of the resource.
createTime This property is required. string
The CreateTime of the resource.
description This property is required. string
The description of the plug-in, which cannot exceed 200 characters.
id This property is required. string
The ID of the Plugin.
modifiedTime This property is required. string
The ModifiedTime of the resource.
pluginData This property is required. string
The definition statement of the plug-in. Plug-in definition statements in the JSON and YAML formats are supported.
pluginId This property is required. string
The first ID of the resource.
pluginName This property is required. string
The name of the plug-in that you want to create.
pluginType This property is required. string
The type of the plug-in.
tags This property is required. {[key: string]: string}
The tag of the resource.
create_time This property is required. str
The CreateTime of the resource.
description This property is required. str
The description of the plug-in, which cannot exceed 200 characters.
id This property is required. str
The ID of the Plugin.
modified_time This property is required. str
The ModifiedTime of the resource.
plugin_data This property is required. str
The definition statement of the plug-in. Plug-in definition statements in the JSON and YAML formats are supported.
plugin_id This property is required. str
The first ID of the resource.
plugin_name This property is required. str
The name of the plug-in that you want to create.
plugin_type This property is required. str
The type of the plug-in.
tags This property is required. Mapping[str, str]
The tag of the resource.
createTime This property is required. String
The CreateTime of the resource.
description This property is required. String
The description of the plug-in, which cannot exceed 200 characters.
id This property is required. String
The ID of the Plugin.
modifiedTime This property is required. String
The ModifiedTime of the resource.
pluginData This property is required. String
The definition statement of the plug-in. Plug-in definition statements in the JSON and YAML formats are supported.
pluginId This property is required. String
The first ID of the resource.
pluginName This property is required. String
The name of the plug-in that you want to create.
pluginType This property is required. String
The type of the plug-in.
tags This property is required. Map<String>
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.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi