1. Packages
  2. Tencentcloud Provider
  3. API Docs
  4. ApiGatewayIpStrategy
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

tencentcloud.ApiGatewayIpStrategy

Explore with Pulumi AI

tencentcloud logo
tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack

    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:

    ServiceId string
    The ID of the API gateway service.
    StrategyData string
    IP address data.
    StrategyName string
    User defined strategy name.
    StrategyType string
    Blacklist or whitelist.
    ApiGatewayIpStrategyId string
    ID of the resource.
    ServiceId string
    The ID of the API gateway service.
    StrategyData string
    IP address data.
    StrategyName string
    User defined strategy name.
    StrategyType string
    Blacklist or whitelist.
    ApiGatewayIpStrategyId string
    ID of the resource.
    serviceId String
    The ID of the API gateway service.
    strategyData String
    IP address data.
    strategyName String
    User defined strategy name.
    strategyType String
    Blacklist or whitelist.
    apiGatewayIpStrategyId String
    ID of the resource.
    serviceId string
    The ID of the API gateway service.
    strategyData string
    IP address data.
    strategyName string
    User defined strategy name.
    strategyType string
    Blacklist or whitelist.
    apiGatewayIpStrategyId string
    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_ip_strategy_id str
    ID of the resource.
    serviceId String
    The ID of the API gateway service.
    strategyData String
    IP address data.
    strategyName String
    User defined strategy name.
    strategyType String
    Blacklist or whitelist.
    apiGatewayIpStrategyId String
    ID of the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ApiGatewayIpStrategy resource produces the following output properties:

    CreateTime 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.
    StrategyId string
    IP policy ID.
    CreateTime 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.
    StrategyId string
    IP policy ID.
    createTime 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.
    strategyId String
    IP policy ID.
    createTime 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.
    strategyId 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.
    createTime 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.
    strategyId 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.
    The following state arguments are supported:
    ApiGatewayIpStrategyId string
    ID of the resource.
    CreateTime string
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    ServiceId string
    The ID of the API gateway service.
    StrategyData string
    IP address data.
    StrategyId string
    IP policy ID.
    StrategyName string
    User defined strategy name.
    StrategyType string
    Blacklist or whitelist.
    ApiGatewayIpStrategyId string
    ID of the resource.
    CreateTime string
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    ServiceId string
    The ID of the API gateway service.
    StrategyData string
    IP address data.
    StrategyId string
    IP policy ID.
    StrategyName string
    User defined strategy name.
    StrategyType string
    Blacklist or whitelist.
    apiGatewayIpStrategyId String
    ID of the resource.
    createTime String
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    serviceId String
    The ID of the API gateway service.
    strategyData String
    IP address data.
    strategyId String
    IP policy ID.
    strategyName String
    User defined strategy name.
    strategyType String
    Blacklist or whitelist.
    apiGatewayIpStrategyId string
    ID of the resource.
    createTime string
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    serviceId string
    The ID of the API gateway service.
    strategyData string
    IP address data.
    strategyId string
    IP policy ID.
    strategyName string
    User defined strategy name.
    strategyType string
    Blacklist or whitelist.
    api_gateway_ip_strategy_id str
    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.
    apiGatewayIpStrategyId String
    ID of the resource.
    createTime String
    Creation time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
    serviceId String
    The ID of the API gateway service.
    strategyData String
    IP address data.
    strategyId String
    IP policy ID.
    strategyName String
    User defined strategy name.
    strategyType 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.
    tencentcloud logo
    tencentcloud 1.81.189 published on Wednesday, Apr 30, 2025 by tencentcloudstack