tencentcloud.ApiGatewayIpStrategy
Explore with Pulumi AI
Use this resource to create IP strategy of API gateway.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const service = new tencentcloud.ApiGatewayService("service", {
serviceName: "niceservice",
protocol: "http&https",
serviceDesc: "your nice service",
netTypes: [
"INNER",
"OUTER",
],
ipVersion: "IPv4",
});
const test = new tencentcloud.ApiGatewayIpStrategy("test", {
serviceId: service.apiGatewayServiceId,
strategyName: "tf_test",
strategyType: "BLACK",
strategyData: "9.9.9.9",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
service = tencentcloud.ApiGatewayService("service",
service_name="niceservice",
protocol="http&https",
service_desc="your nice service",
net_types=[
"INNER",
"OUTER",
],
ip_version="IPv4")
test = tencentcloud.ApiGatewayIpStrategy("test",
service_id=service.api_gateway_service_id,
strategy_name="tf_test",
strategy_type="BLACK",
strategy_data="9.9.9.9")
package main
import (
"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 {
service, err := tencentcloud.NewApiGatewayService(ctx, "service", &tencentcloud.ApiGatewayServiceArgs{
ServiceName: pulumi.String("niceservice"),
Protocol: pulumi.String("http&https"),
ServiceDesc: pulumi.String("your nice service"),
NetTypes: pulumi.StringArray{
pulumi.String("INNER"),
pulumi.String("OUTER"),
},
IpVersion: pulumi.String("IPv4"),
})
if err != nil {
return err
}
_, err = tencentcloud.NewApiGatewayIpStrategy(ctx, "test", &tencentcloud.ApiGatewayIpStrategyArgs{
ServiceId: service.ApiGatewayServiceId,
StrategyName: pulumi.String("tf_test"),
StrategyType: pulumi.String("BLACK"),
StrategyData: pulumi.String("9.9.9.9"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tencentcloud = Pulumi.Tencentcloud;
return await Deployment.RunAsync(() =>
{
var service = new Tencentcloud.ApiGatewayService("service", new()
{
ServiceName = "niceservice",
Protocol = "http&https",
ServiceDesc = "your nice service",
NetTypes = new[]
{
"INNER",
"OUTER",
},
IpVersion = "IPv4",
});
var test = new Tencentcloud.ApiGatewayIpStrategy("test", new()
{
ServiceId = service.ApiGatewayServiceId,
StrategyName = "tf_test",
StrategyType = "BLACK",
StrategyData = "9.9.9.9",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.ApiGatewayService;
import com.pulumi.tencentcloud.ApiGatewayServiceArgs;
import com.pulumi.tencentcloud.ApiGatewayIpStrategy;
import com.pulumi.tencentcloud.ApiGatewayIpStrategyArgs;
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 service = new ApiGatewayService("service", ApiGatewayServiceArgs.builder()
.serviceName("niceservice")
.protocol("http&https")
.serviceDesc("your nice service")
.netTypes(
"INNER",
"OUTER")
.ipVersion("IPv4")
.build());
var test = new ApiGatewayIpStrategy("test", ApiGatewayIpStrategyArgs.builder()
.serviceId(service.apiGatewayServiceId())
.strategyName("tf_test")
.strategyType("BLACK")
.strategyData("9.9.9.9")
.build());
}
}
resources:
service:
type: tencentcloud:ApiGatewayService
properties:
serviceName: niceservice
protocol: http&https
serviceDesc: your nice service
netTypes:
- INNER
- OUTER
ipVersion: IPv4
test:
type: tencentcloud:ApiGatewayIpStrategy
properties:
serviceId: ${service.apiGatewayServiceId}
strategyName: tf_test
strategyType: BLACK
strategyData: 9.9.9.9
Create ApiGatewayIpStrategy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApiGatewayIpStrategy(name: string, args: ApiGatewayIpStrategyArgs, opts?: CustomResourceOptions);
@overload
def ApiGatewayIpStrategy(resource_name: str,
args: ApiGatewayIpStrategyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ApiGatewayIpStrategy(resource_name: str,
opts: Optional[ResourceOptions] = None,
service_id: Optional[str] = None,
strategy_data: Optional[str] = None,
strategy_name: Optional[str] = None,
strategy_type: Optional[str] = None,
api_gateway_ip_strategy_id: Optional[str] = None)
func NewApiGatewayIpStrategy(ctx *Context, name string, args ApiGatewayIpStrategyArgs, opts ...ResourceOption) (*ApiGatewayIpStrategy, error)
public ApiGatewayIpStrategy(string name, ApiGatewayIpStrategyArgs args, CustomResourceOptions? opts = null)
public ApiGatewayIpStrategy(String name, ApiGatewayIpStrategyArgs args)
public ApiGatewayIpStrategy(String name, ApiGatewayIpStrategyArgs args, CustomResourceOptions options)
type: tencentcloud:ApiGatewayIpStrategy
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 ApiGatewayIpStrategyArgs
- 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 ApiGatewayIpStrategyArgs
- 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 ApiGatewayIpStrategyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApiGatewayIpStrategyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApiGatewayIpStrategyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ApiGatewayIpStrategy 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 ApiGatewayIpStrategy resource accepts the following input properties:
- Service
Id string - The ID of the API gateway service.
- Strategy
Data string - IP address data.
- Strategy
Name string - User defined strategy name.
- Strategy
Type string - Blacklist or whitelist.
- Api
Gateway stringIp Strategy Id - ID of the resource.
- Service
Id string - The ID of the API gateway service.
- Strategy
Data string - IP address data.
- Strategy
Name string - User defined strategy name.
- Strategy
Type string - Blacklist or whitelist.
- Api
Gateway stringIp Strategy Id - ID of the resource.
- service
Id String - The ID of the API gateway service.
- strategy
Data String - IP address data.
- strategy
Name String - User defined strategy name.
- strategy
Type String - Blacklist or whitelist.
- api
Gateway StringIp Strategy Id - ID of the resource.
- service
Id string - The ID of the API gateway service.
- strategy
Data string - IP address data.
- strategy
Name string - User defined strategy name.
- strategy
Type string - Blacklist or whitelist.
- api
Gateway stringIp Strategy Id - ID of the resource.
- service_
id str - The ID of the API gateway service.
- strategy_
data str - IP address data.
- strategy_
name str - User defined strategy name.
- strategy_
type str - Blacklist or whitelist.
- api_
gateway_ strip_ strategy_ id - ID of the resource.
- service
Id String - The ID of the API gateway service.
- strategy
Data String - IP address data.
- strategy
Name String - User defined strategy name.
- strategy
Type String - Blacklist or whitelist.
- api
Gateway StringIp Strategy Id - ID of the resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the ApiGatewayIpStrategy resource produces the following output properties:
- Create
Time string - Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- Id string
- The provider-assigned unique ID for this managed resource.
- Strategy
Id string - IP policy ID.
- Create
Time string - Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- Id string
- The provider-assigned unique ID for this managed resource.
- Strategy
Id string - IP policy ID.
- create
Time String - Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- id String
- The provider-assigned unique ID for this managed resource.
- strategy
Id String - IP policy ID.
- create
Time string - Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- id string
- The provider-assigned unique ID for this managed resource.
- strategy
Id string - IP policy ID.
- create_
time str - Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- id str
- The provider-assigned unique ID for this managed resource.
- strategy_
id str - IP policy ID.
- create
Time String - Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- id String
- The provider-assigned unique ID for this managed resource.
- strategy
Id String - IP policy ID.
Look up Existing ApiGatewayIpStrategy Resource
Get an existing ApiGatewayIpStrategy 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?: ApiGatewayIpStrategyState, opts?: CustomResourceOptions): ApiGatewayIpStrategy
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
api_gateway_ip_strategy_id: Optional[str] = None,
create_time: Optional[str] = None,
service_id: Optional[str] = None,
strategy_data: Optional[str] = None,
strategy_id: Optional[str] = None,
strategy_name: Optional[str] = None,
strategy_type: Optional[str] = None) -> ApiGatewayIpStrategy
func GetApiGatewayIpStrategy(ctx *Context, name string, id IDInput, state *ApiGatewayIpStrategyState, opts ...ResourceOption) (*ApiGatewayIpStrategy, error)
public static ApiGatewayIpStrategy Get(string name, Input<string> id, ApiGatewayIpStrategyState? state, CustomResourceOptions? opts = null)
public static ApiGatewayIpStrategy get(String name, Output<String> id, ApiGatewayIpStrategyState state, CustomResourceOptions options)
resources: _: type: tencentcloud:ApiGatewayIpStrategy 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 stringIp Strategy Id - ID of the resource.
- Create
Time string - Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- Service
Id string - The ID of the API gateway service.
- Strategy
Data string - IP address data.
- Strategy
Id string - IP policy ID.
- Strategy
Name string - User defined strategy name.
- Strategy
Type string - Blacklist or whitelist.
- Api
Gateway stringIp Strategy Id - ID of the resource.
- Create
Time string - Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- Service
Id string - The ID of the API gateway service.
- Strategy
Data string - IP address data.
- Strategy
Id string - IP policy ID.
- Strategy
Name string - User defined strategy name.
- Strategy
Type string - Blacklist or whitelist.
- api
Gateway StringIp Strategy Id - ID of the resource.
- create
Time String - Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- service
Id String - The ID of the API gateway service.
- strategy
Data String - IP address data.
- strategy
Id String - IP policy ID.
- strategy
Name String - User defined strategy name.
- strategy
Type String - Blacklist or whitelist.
- api
Gateway stringIp Strategy Id - ID of the resource.
- create
Time string - Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- service
Id string - The ID of the API gateway service.
- strategy
Data string - IP address data.
- strategy
Id string - IP policy ID.
- strategy
Name string - User defined strategy name.
- strategy
Type string - Blacklist or whitelist.
- api_
gateway_ strip_ strategy_ id - ID of the resource.
- create_
time str - Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- service_
id str - The ID of the API gateway service.
- strategy_
data str - IP address data.
- strategy_
id str - IP policy ID.
- strategy_
name str - User defined strategy name.
- strategy_
type str - Blacklist or whitelist.
- api
Gateway StringIp Strategy Id - ID of the resource.
- create
Time String - Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- service
Id String - The ID of the API gateway service.
- strategy
Data String - IP address data.
- strategy
Id String - IP policy ID.
- strategy
Name String - User defined strategy name.
- strategy
Type String - Blacklist or whitelist.
Import
IP strategy of API gateway can be imported using the id, e.g.
$ pulumi import tencentcloud:index/apiGatewayIpStrategy:ApiGatewayIpStrategy test service-ohxqslqe#IPStrategy-q1lk8ud2
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.