tencentcloud.ApiGatewayServiceRelease
Use this resource to create API gateway service release.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const service = new tencentcloud.ApiGatewayService("service", {
serviceName: "myservice",
protocol: "http",
serviceDesc: "my nice service",
netTypes: ["INNER"],
ipVersion: "IPv4",
});
const api = new tencentcloud.ApiGatewayApi("api", {
serviceId: service.apiGatewayServiceId,
apiName: "tf_example",
apiDesc: "my hello api update",
authType: "SECRET",
protocol: "HTTP",
enableCors: true,
requestConfigPath: "/user/info",
requestConfigMethod: "POST",
requestParameters: [{
name: "email",
position: "QUERY",
type: "string",
desc: "your email please?",
defaultValue: "tom@qq.com",
required: true,
}],
serviceConfigType: "HTTP",
serviceConfigTimeout: 10,
serviceConfigUrl: "http://www.tencent.com",
serviceConfigPath: "/user",
serviceConfigMethod: "POST",
responseType: "XML",
responseSuccessExample: "<note>success</note>",
responseFailExample: "<note>fail</note>",
responseErrorCodes: [{
code: 10,
msg: "system error",
desc: "system error code",
convertedCode: -10,
needConvert: true,
}],
});
const serviceApiGatewayServiceRelease = new tencentcloud.ApiGatewayServiceRelease("service", {
serviceId: api.service.id,
environmentName: "release",
releaseDesc: "test service release",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
service = tencentcloud.ApiGatewayService("service",
service_name="myservice",
protocol="http",
service_desc="my nice service",
net_types=["INNER"],
ip_version="IPv4")
api = tencentcloud.ApiGatewayApi("api",
service_id=service.api_gateway_service_id,
api_name="tf_example",
api_desc="my hello api update",
auth_type="SECRET",
protocol="HTTP",
enable_cors=True,
request_config_path="/user/info",
request_config_method="POST",
request_parameters=[{
"name": "email",
"position": "QUERY",
"type": "string",
"desc": "your email please?",
"default_value": "tom@qq.com",
"required": True,
}],
service_config_type="HTTP",
service_config_timeout=10,
service_config_url="http://www.tencent.com",
service_config_path="/user",
service_config_method="POST",
response_type="XML",
response_success_example="<note>success</note>",
response_fail_example="<note>fail</note>",
response_error_codes=[{
"code": 10,
"msg": "system error",
"desc": "system error code",
"converted_code": -10,
"need_convert": True,
}])
service_api_gateway_service_release = tencentcloud.ApiGatewayServiceRelease("service",
service_id=api.service["id"],
environment_name="release",
release_desc="test service release")
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("myservice"),
Protocol: pulumi.String("http"),
ServiceDesc: pulumi.String("my nice service"),
NetTypes: pulumi.StringArray{
pulumi.String("INNER"),
},
IpVersion: pulumi.String("IPv4"),
})
if err != nil {
return err
}
api, err := tencentcloud.NewApiGatewayApi(ctx, "api", &tencentcloud.ApiGatewayApiArgs{
ServiceId: service.ApiGatewayServiceId,
ApiName: pulumi.String("tf_example"),
ApiDesc: pulumi.String("my hello api update"),
AuthType: pulumi.String("SECRET"),
Protocol: pulumi.String("HTTP"),
EnableCors: pulumi.Bool(true),
RequestConfigPath: pulumi.String("/user/info"),
RequestConfigMethod: pulumi.String("POST"),
RequestParameters: tencentcloud.ApiGatewayApiRequestParameterArray{
&tencentcloud.ApiGatewayApiRequestParameterArgs{
Name: pulumi.String("email"),
Position: pulumi.String("QUERY"),
Type: pulumi.String("string"),
Desc: pulumi.String("your email please?"),
DefaultValue: pulumi.String("tom@qq.com"),
Required: pulumi.Bool(true),
},
},
ServiceConfigType: pulumi.String("HTTP"),
ServiceConfigTimeout: pulumi.Float64(10),
ServiceConfigUrl: pulumi.String("http://www.tencent.com"),
ServiceConfigPath: pulumi.String("/user"),
ServiceConfigMethod: pulumi.String("POST"),
ResponseType: pulumi.String("XML"),
ResponseSuccessExample: pulumi.String("<note>success</note>"),
ResponseFailExample: pulumi.String("<note>fail</note>"),
ResponseErrorCodes: tencentcloud.ApiGatewayApiResponseErrorCodeArray{
&tencentcloud.ApiGatewayApiResponseErrorCodeArgs{
Code: pulumi.Float64(10),
Msg: pulumi.String("system error"),
Desc: pulumi.String("system error code"),
ConvertedCode: pulumi.Float64(-10),
NeedConvert: pulumi.Bool(true),
},
},
})
if err != nil {
return err
}
_, err = tencentcloud.NewApiGatewayServiceRelease(ctx, "service", &tencentcloud.ApiGatewayServiceReleaseArgs{
ServiceId: api.Service.ID(),
EnvironmentName: pulumi.String("release"),
ReleaseDesc: pulumi.String("test service release"),
})
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 = "myservice",
Protocol = "http",
ServiceDesc = "my nice service",
NetTypes = new[]
{
"INNER",
},
IpVersion = "IPv4",
});
var api = new Tencentcloud.ApiGatewayApi("api", new()
{
ServiceId = service.ApiGatewayServiceId,
ApiName = "tf_example",
ApiDesc = "my hello api update",
AuthType = "SECRET",
Protocol = "HTTP",
EnableCors = true,
RequestConfigPath = "/user/info",
RequestConfigMethod = "POST",
RequestParameters = new[]
{
new Tencentcloud.Inputs.ApiGatewayApiRequestParameterArgs
{
Name = "email",
Position = "QUERY",
Type = "string",
Desc = "your email please?",
DefaultValue = "tom@qq.com",
Required = true,
},
},
ServiceConfigType = "HTTP",
ServiceConfigTimeout = 10,
ServiceConfigUrl = "http://www.tencent.com",
ServiceConfigPath = "/user",
ServiceConfigMethod = "POST",
ResponseType = "XML",
ResponseSuccessExample = "<note>success</note>",
ResponseFailExample = "<note>fail</note>",
ResponseErrorCodes = new[]
{
new Tencentcloud.Inputs.ApiGatewayApiResponseErrorCodeArgs
{
Code = 10,
Msg = "system error",
Desc = "system error code",
ConvertedCode = -10,
NeedConvert = true,
},
},
});
var serviceApiGatewayServiceRelease = new Tencentcloud.ApiGatewayServiceRelease("service", new()
{
ServiceId = api.Service.Id,
EnvironmentName = "release",
ReleaseDesc = "test service release",
});
});
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.ApiGatewayApi;
import com.pulumi.tencentcloud.ApiGatewayApiArgs;
import com.pulumi.tencentcloud.inputs.ApiGatewayApiRequestParameterArgs;
import com.pulumi.tencentcloud.inputs.ApiGatewayApiResponseErrorCodeArgs;
import com.pulumi.tencentcloud.ApiGatewayServiceRelease;
import com.pulumi.tencentcloud.ApiGatewayServiceReleaseArgs;
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("myservice")
.protocol("http")
.serviceDesc("my nice service")
.netTypes("INNER")
.ipVersion("IPv4")
.build());
var api = new ApiGatewayApi("api", ApiGatewayApiArgs.builder()
.serviceId(service.apiGatewayServiceId())
.apiName("tf_example")
.apiDesc("my hello api update")
.authType("SECRET")
.protocol("HTTP")
.enableCors(true)
.requestConfigPath("/user/info")
.requestConfigMethod("POST")
.requestParameters(ApiGatewayApiRequestParameterArgs.builder()
.name("email")
.position("QUERY")
.type("string")
.desc("your email please?")
.defaultValue("tom@qq.com")
.required(true)
.build())
.serviceConfigType("HTTP")
.serviceConfigTimeout(10.0)
.serviceConfigUrl("http://www.tencent.com")
.serviceConfigPath("/user")
.serviceConfigMethod("POST")
.responseType("XML")
.responseSuccessExample("<note>success</note>")
.responseFailExample("<note>fail</note>")
.responseErrorCodes(ApiGatewayApiResponseErrorCodeArgs.builder()
.code(10.0)
.msg("system error")
.desc("system error code")
.convertedCode(-10.0)
.needConvert(true)
.build())
.build());
var serviceApiGatewayServiceRelease = new ApiGatewayServiceRelease("serviceApiGatewayServiceRelease", ApiGatewayServiceReleaseArgs.builder()
.serviceId(api.service().id())
.environmentName("release")
.releaseDesc("test service release")
.build());
}
}
resources:
service:
type: tencentcloud:ApiGatewayService
properties:
serviceName: myservice
protocol: http
serviceDesc: my nice service
netTypes:
- INNER
ipVersion: IPv4
api:
type: tencentcloud:ApiGatewayApi
properties:
serviceId: ${service.apiGatewayServiceId}
apiName: tf_example
apiDesc: my hello api update
authType: SECRET
protocol: HTTP
enableCors: true
requestConfigPath: /user/info
requestConfigMethod: POST
requestParameters:
- name: email
position: QUERY
type: string
desc: your email please?
defaultValue: tom@qq.com
required: true
serviceConfigType: HTTP
serviceConfigTimeout: 10
serviceConfigUrl: http://www.tencent.com
serviceConfigPath: /user
serviceConfigMethod: POST
responseType: XML
responseSuccessExample: <note>success</note>
responseFailExample: <note>fail</note>
responseErrorCodes:
- code: 10
msg: system error
desc: system error code
convertedCode: -10
needConvert: true
serviceApiGatewayServiceRelease:
type: tencentcloud:ApiGatewayServiceRelease
name: service
properties:
serviceId: ${api.service.id}
environmentName: release
releaseDesc: test service release
Create ApiGatewayServiceRelease Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApiGatewayServiceRelease(name: string, args: ApiGatewayServiceReleaseArgs, opts?: CustomResourceOptions);@overload
def ApiGatewayServiceRelease(resource_name: str,
args: ApiGatewayServiceReleaseArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ApiGatewayServiceRelease(resource_name: str,
opts: Optional[ResourceOptions] = None,
environment_name: Optional[str] = None,
release_desc: Optional[str] = None,
service_id: Optional[str] = None,
api_gateway_service_release_id: Optional[str] = None,
release_version: Optional[str] = None)func NewApiGatewayServiceRelease(ctx *Context, name string, args ApiGatewayServiceReleaseArgs, opts ...ResourceOption) (*ApiGatewayServiceRelease, error)public ApiGatewayServiceRelease(string name, ApiGatewayServiceReleaseArgs args, CustomResourceOptions? opts = null)
public ApiGatewayServiceRelease(String name, ApiGatewayServiceReleaseArgs args)
public ApiGatewayServiceRelease(String name, ApiGatewayServiceReleaseArgs args, CustomResourceOptions options)
type: tencentcloud:ApiGatewayServiceRelease
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 ApiGatewayServiceReleaseArgs
- 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 ApiGatewayServiceReleaseArgs
- 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 ApiGatewayServiceReleaseArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApiGatewayServiceReleaseArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApiGatewayServiceReleaseArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ApiGatewayServiceRelease 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 ApiGatewayServiceRelease resource accepts the following input properties:
- Environment
Name string - API gateway service environment name to be released. Valid values:
test,prepub,release. - Release
Desc string - This release description of the API gateway service.
- Service
Id string - ID of API gateway service.
- Api
Gateway stringService Release Id - ID of the resource.
- Release
Version string - The release version.
- Environment
Name string - API gateway service environment name to be released. Valid values:
test,prepub,release. - Release
Desc string - This release description of the API gateway service.
- Service
Id string - ID of API gateway service.
- Api
Gateway stringService Release Id - ID of the resource.
- Release
Version string - The release version.
- environment
Name String - API gateway service environment name to be released. Valid values:
test,prepub,release. - release
Desc String - This release description of the API gateway service.
- service
Id String - ID of API gateway service.
- api
Gateway StringService Release Id - ID of the resource.
- release
Version String - The release version.
- environment
Name string - API gateway service environment name to be released. Valid values:
test,prepub,release. - release
Desc string - This release description of the API gateway service.
- service
Id string - ID of API gateway service.
- api
Gateway stringService Release Id - ID of the resource.
- release
Version string - The release version.
- environment_
name str - API gateway service environment name to be released. Valid values:
test,prepub,release. - release_
desc str - This release description of the API gateway service.
- service_
id str - ID of API gateway service.
- api_
gateway_ strservice_ release_ id - ID of the resource.
- release_
version str - The release version.
- environment
Name String - API gateway service environment name to be released. Valid values:
test,prepub,release. - release
Desc String - This release description of the API gateway service.
- service
Id String - ID of API gateway service.
- api
Gateway StringService Release Id - ID of the resource.
- release
Version String - The release version.
Outputs
All input properties are implicitly available as output properties. Additionally, the ApiGatewayServiceRelease 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 ApiGatewayServiceRelease Resource
Get an existing ApiGatewayServiceRelease 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?: ApiGatewayServiceReleaseState, opts?: CustomResourceOptions): ApiGatewayServiceRelease@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
api_gateway_service_release_id: Optional[str] = None,
environment_name: Optional[str] = None,
release_desc: Optional[str] = None,
release_version: Optional[str] = None,
service_id: Optional[str] = None) -> ApiGatewayServiceReleasefunc GetApiGatewayServiceRelease(ctx *Context, name string, id IDInput, state *ApiGatewayServiceReleaseState, opts ...ResourceOption) (*ApiGatewayServiceRelease, error)public static ApiGatewayServiceRelease Get(string name, Input<string> id, ApiGatewayServiceReleaseState? state, CustomResourceOptions? opts = null)public static ApiGatewayServiceRelease get(String name, Output<String> id, ApiGatewayServiceReleaseState state, CustomResourceOptions options)resources: _: type: tencentcloud:ApiGatewayServiceRelease 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 stringService Release Id - ID of the resource.
- Environment
Name string - API gateway service environment name to be released. Valid values:
test,prepub,release. - Release
Desc string - This release description of the API gateway service.
- Release
Version string - The release version.
- Service
Id string - ID of API gateway service.
- Api
Gateway stringService Release Id - ID of the resource.
- Environment
Name string - API gateway service environment name to be released. Valid values:
test,prepub,release. - Release
Desc string - This release description of the API gateway service.
- Release
Version string - The release version.
- Service
Id string - ID of API gateway service.
- api
Gateway StringService Release Id - ID of the resource.
- environment
Name String - API gateway service environment name to be released. Valid values:
test,prepub,release. - release
Desc String - This release description of the API gateway service.
- release
Version String - The release version.
- service
Id String - ID of API gateway service.
- api
Gateway stringService Release Id - ID of the resource.
- environment
Name string - API gateway service environment name to be released. Valid values:
test,prepub,release. - release
Desc string - This release description of the API gateway service.
- release
Version string - The release version.
- service
Id string - ID of API gateway service.
- api_
gateway_ strservice_ release_ id - ID of the resource.
- environment_
name str - API gateway service environment name to be released. Valid values:
test,prepub,release. - release_
desc str - This release description of the API gateway service.
- release_
version str - The release version.
- service_
id str - ID of API gateway service.
- api
Gateway StringService Release Id - ID of the resource.
- environment
Name String - API gateway service environment name to be released. Valid values:
test,prepub,release. - release
Desc String - This release description of the API gateway service.
- release
Version String - The release version.
- service
Id String - ID of API gateway service.
Import
API gateway service release can be imported using the id, e.g.
$ pulumi import tencentcloud:index/apiGatewayServiceRelease:ApiGatewayServiceRelease service service-jjt3fs3s#release#20201015121916d85fb161-eaec-4dda-a7e0-659aa5f401be
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
tencentcloudTerraform Provider.
