tencentcloud.ApiGatewayPlugin
Explore with Pulumi AI
Provides a resource to create a apiGateway plugin
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const example = new tencentcloud.ApiGatewayPlugin("example", {
pluginName: "tf-example",
pluginType: "IPControl",
pluginData: JSON.stringify({
type: "white_list",
blocks: "1.1.1.1",
}),
description: "desc.",
});
import pulumi
import json
import pulumi_tencentcloud as tencentcloud
example = tencentcloud.ApiGatewayPlugin("example",
plugin_name="tf-example",
plugin_type="IPControl",
plugin_data=json.dumps({
"type": "white_list",
"blocks": "1.1.1.1",
}),
description="desc.")
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-terraform-provider/sdks/go/tencentcloud/tencentcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
tmpJSON0, err := json.Marshal(map[string]interface{}{
"type": "white_list",
"blocks": "1.1.1.1",
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = tencentcloud.NewApiGatewayPlugin(ctx, "example", &tencentcloud.ApiGatewayPluginArgs{
PluginName: pulumi.String("tf-example"),
PluginType: pulumi.String("IPControl"),
PluginData: pulumi.String(json0),
Description: pulumi.String("desc."),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var example = new Tencentcloud.ApiGatewayPlugin("example", new()
{
PluginName = "tf-example",
PluginType = "IPControl",
PluginData = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["type"] = "white_list",
["blocks"] = "1.1.1.1",
}),
Description = "desc.",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.ApiGatewayPlugin;
import com.pulumi.tencentcloud.ApiGatewayPluginArgs;
import static com.pulumi.codegen.internal.Serialization.*;
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) {
var example = new ApiGatewayPlugin("example", ApiGatewayPluginArgs.builder()
.pluginName("tf-example")
.pluginType("IPControl")
.pluginData(serializeJson(
jsonObject(
jsonProperty("type", "white_list"),
jsonProperty("blocks", "1.1.1.1")
)))
.description("desc.")
.build());
}
}
resources:
example:
type: tencentcloud:ApiGatewayPlugin
properties:
pluginName: tf-example
pluginType: IPControl
pluginData:
fn::toJSON:
type: white_list
blocks: 1.1.1.1
description: desc.
Create ApiGatewayPlugin Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApiGatewayPlugin(name: string, args: ApiGatewayPluginArgs, opts?: CustomResourceOptions);
@overload
def ApiGatewayPlugin(resource_name: str,
args: ApiGatewayPluginArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ApiGatewayPlugin(resource_name: str,
opts: Optional[ResourceOptions] = None,
plugin_data: Optional[str] = None,
plugin_name: Optional[str] = None,
plugin_type: Optional[str] = None,
api_gateway_plugin_id: Optional[str] = None,
description: Optional[str] = None)
func NewApiGatewayPlugin(ctx *Context, name string, args ApiGatewayPluginArgs, opts ...ResourceOption) (*ApiGatewayPlugin, error)
public ApiGatewayPlugin(string name, ApiGatewayPluginArgs args, CustomResourceOptions? opts = null)
public ApiGatewayPlugin(String name, ApiGatewayPluginArgs args)
public ApiGatewayPlugin(String name, ApiGatewayPluginArgs args, CustomResourceOptions options)
type: tencentcloud:ApiGatewayPlugin
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ApiGatewayPluginArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ApiGatewayPluginArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ApiGatewayPluginArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApiGatewayPluginArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApiGatewayPluginArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ApiGatewayPlugin Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ApiGatewayPlugin resource accepts the following input properties:
- Plugin
Data string - Statement to define plugin.
- Plugin
Name string - Name of the user define plugin. It must start with a letter and end with letter or number, the rest can contain letters, numbers and dashes(-). The length range is from 2 to 50.
- Plugin
Type string - Type of plugin. Now support IPControl, TrafficControl, Cors, CustomReq, CustomAuth, Routing, TrafficControlByParameter, CircuitBreaker, ProxyCache.
- Api
Gateway stringPlugin Id - ID of the resource.
- Description string
- Description of plugin.
- Plugin
Data string - Statement to define plugin.
- Plugin
Name string - Name of the user define plugin. It must start with a letter and end with letter or number, the rest can contain letters, numbers and dashes(-). The length range is from 2 to 50.
- Plugin
Type string - Type of plugin. Now support IPControl, TrafficControl, Cors, CustomReq, CustomAuth, Routing, TrafficControlByParameter, CircuitBreaker, ProxyCache.
- Api
Gateway stringPlugin Id - ID of the resource.
- Description string
- Description of plugin.
- plugin
Data String - Statement to define plugin.
- plugin
Name String - Name of the user define plugin. It must start with a letter and end with letter or number, the rest can contain letters, numbers and dashes(-). The length range is from 2 to 50.
- plugin
Type String - Type of plugin. Now support IPControl, TrafficControl, Cors, CustomReq, CustomAuth, Routing, TrafficControlByParameter, CircuitBreaker, ProxyCache.
- api
Gateway StringPlugin Id - ID of the resource.
- description String
- Description of plugin.
- plugin
Data string - Statement to define plugin.
- plugin
Name string - Name of the user define plugin. It must start with a letter and end with letter or number, the rest can contain letters, numbers and dashes(-). The length range is from 2 to 50.
- plugin
Type string - Type of plugin. Now support IPControl, TrafficControl, Cors, CustomReq, CustomAuth, Routing, TrafficControlByParameter, CircuitBreaker, ProxyCache.
- api
Gateway stringPlugin Id - ID of the resource.
- description string
- Description of plugin.
- plugin_
data str - Statement to define plugin.
- plugin_
name str - Name of the user define plugin. It must start with a letter and end with letter or number, the rest can contain letters, numbers and dashes(-). The length range is from 2 to 50.
- plugin_
type str - Type of plugin. Now support IPControl, TrafficControl, Cors, CustomReq, CustomAuth, Routing, TrafficControlByParameter, CircuitBreaker, ProxyCache.
- api_
gateway_ strplugin_ id - ID of the resource.
- description str
- Description of plugin.
- plugin
Data String - Statement to define plugin.
- plugin
Name String - Name of the user define plugin. It must start with a letter and end with letter or number, the rest can contain letters, numbers and dashes(-). The length range is from 2 to 50.
- plugin
Type String - Type of plugin. Now support IPControl, TrafficControl, Cors, CustomReq, CustomAuth, Routing, TrafficControlByParameter, CircuitBreaker, ProxyCache.
- api
Gateway StringPlugin Id - ID of the resource.
- description String
- Description of plugin.
Outputs
All input properties are implicitly available as output properties. Additionally, the ApiGatewayPlugin resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ApiGatewayPlugin Resource
Get an existing ApiGatewayPlugin resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ApiGatewayPluginState, opts?: CustomResourceOptions): ApiGatewayPlugin
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
api_gateway_plugin_id: Optional[str] = None,
description: Optional[str] = None,
plugin_data: Optional[str] = None,
plugin_name: Optional[str] = None,
plugin_type: Optional[str] = None) -> ApiGatewayPlugin
func GetApiGatewayPlugin(ctx *Context, name string, id IDInput, state *ApiGatewayPluginState, opts ...ResourceOption) (*ApiGatewayPlugin, error)
public static ApiGatewayPlugin Get(string name, Input<string> id, ApiGatewayPluginState? state, CustomResourceOptions? opts = null)
public static ApiGatewayPlugin get(String name, Output<String> id, ApiGatewayPluginState state, CustomResourceOptions options)
resources: _: type: tencentcloud:ApiGatewayPlugin get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Api
Gateway stringPlugin Id - ID of the resource.
- Description string
- Description of plugin.
- Plugin
Data string - Statement to define plugin.
- Plugin
Name string - Name of the user define plugin. It must start with a letter and end with letter or number, the rest can contain letters, numbers and dashes(-). The length range is from 2 to 50.
- Plugin
Type string - Type of plugin. Now support IPControl, TrafficControl, Cors, CustomReq, CustomAuth, Routing, TrafficControlByParameter, CircuitBreaker, ProxyCache.
- Api
Gateway stringPlugin Id - ID of the resource.
- Description string
- Description of plugin.
- Plugin
Data string - Statement to define plugin.
- Plugin
Name string - Name of the user define plugin. It must start with a letter and end with letter or number, the rest can contain letters, numbers and dashes(-). The length range is from 2 to 50.
- Plugin
Type string - Type of plugin. Now support IPControl, TrafficControl, Cors, CustomReq, CustomAuth, Routing, TrafficControlByParameter, CircuitBreaker, ProxyCache.
- api
Gateway StringPlugin Id - ID of the resource.
- description String
- Description of plugin.
- plugin
Data String - Statement to define plugin.
- plugin
Name String - Name of the user define plugin. It must start with a letter and end with letter or number, the rest can contain letters, numbers and dashes(-). The length range is from 2 to 50.
- plugin
Type String - Type of plugin. Now support IPControl, TrafficControl, Cors, CustomReq, CustomAuth, Routing, TrafficControlByParameter, CircuitBreaker, ProxyCache.
- api
Gateway stringPlugin Id - ID of the resource.
- description string
- Description of plugin.
- plugin
Data string - Statement to define plugin.
- plugin
Name string - Name of the user define plugin. It must start with a letter and end with letter or number, the rest can contain letters, numbers and dashes(-). The length range is from 2 to 50.
- plugin
Type string - Type of plugin. Now support IPControl, TrafficControl, Cors, CustomReq, CustomAuth, Routing, TrafficControlByParameter, CircuitBreaker, ProxyCache.
- api_
gateway_ strplugin_ id - ID of the resource.
- description str
- Description of plugin.
- plugin_
data str - Statement to define plugin.
- plugin_
name str - Name of the user define plugin. It must start with a letter and end with letter or number, the rest can contain letters, numbers and dashes(-). The length range is from 2 to 50.
- plugin_
type str - Type of plugin. Now support IPControl, TrafficControl, Cors, CustomReq, CustomAuth, Routing, TrafficControlByParameter, CircuitBreaker, ProxyCache.
- api
Gateway StringPlugin Id - ID of the resource.
- description String
- Description of plugin.
- plugin
Data String - Statement to define plugin.
- plugin
Name String - Name of the user define plugin. It must start with a letter and end with letter or number, the rest can contain letters, numbers and dashes(-). The length range is from 2 to 50.
- plugin
Type String - Type of plugin. Now support IPControl, TrafficControl, Cors, CustomReq, CustomAuth, Routing, TrafficControlByParameter, CircuitBreaker, ProxyCache.
Import
apiGateway plugin can be imported using the id, e.g.
$ pulumi import tencentcloud:index/apiGatewayPlugin:ApiGatewayPlugin plugin plugin_id
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- tencentcloud tencentcloudstack/terraform-provider-tencentcloud
- License
- Notes
- This Pulumi package is based on the
tencentcloud
Terraform Provider.