tencentcloud.ApiGatewayApiKey
Explore with Pulumi AI
Use this resource to create API gateway access key.
Example Usage
Automatically generate key for API gateway access key.
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const exampleAuto = new tencentcloud.ApiGatewayApiKey("exampleAuto", {
secretName: "tf_example_auto",
status: "on",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example_auto = tencentcloud.ApiGatewayApiKey("exampleAuto",
secret_name="tf_example_auto",
status="on")
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 {
_, err := tencentcloud.NewApiGatewayApiKey(ctx, "exampleAuto", &tencentcloud.ApiGatewayApiKeyArgs{
SecretName: pulumi.String("tf_example_auto"),
Status: pulumi.String("on"),
})
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 exampleAuto = new Tencentcloud.ApiGatewayApiKey("exampleAuto", new()
{
SecretName = "tf_example_auto",
Status = "on",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.ApiGatewayApiKey;
import com.pulumi.tencentcloud.ApiGatewayApiKeyArgs;
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 exampleAuto = new ApiGatewayApiKey("exampleAuto", ApiGatewayApiKeyArgs.builder()
.secretName("tf_example_auto")
.status("on")
.build());
}
}
resources:
exampleAuto:
type: tencentcloud:ApiGatewayApiKey
properties:
secretName: tf_example_auto
status: on
Manually generate a secret key for API gateway access key.
import * as pulumi from "@pulumi/pulumi";
import * as tencentcloud from "@pulumi/tencentcloud";
const exampleManual = new tencentcloud.ApiGatewayApiKey("exampleManual", {
accessKeyId: "28e287e340507fa147b2c8284dab542f",
accessKeySecret: "0198a4b8c3105080f4acd9e507599eff",
accessKeyType: "manual",
secretName: "tf_example_manual",
status: "on",
});
import pulumi
import pulumi_tencentcloud as tencentcloud
example_manual = tencentcloud.ApiGatewayApiKey("exampleManual",
access_key_id="28e287e340507fa147b2c8284dab542f",
access_key_secret="0198a4b8c3105080f4acd9e507599eff",
access_key_type="manual",
secret_name="tf_example_manual",
status="on")
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 {
_, err := tencentcloud.NewApiGatewayApiKey(ctx, "exampleManual", &tencentcloud.ApiGatewayApiKeyArgs{
AccessKeyId: pulumi.String("28e287e340507fa147b2c8284dab542f"),
AccessKeySecret: pulumi.String("0198a4b8c3105080f4acd9e507599eff"),
AccessKeyType: pulumi.String("manual"),
SecretName: pulumi.String("tf_example_manual"),
Status: pulumi.String("on"),
})
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 exampleManual = new Tencentcloud.ApiGatewayApiKey("exampleManual", new()
{
AccessKeyId = "28e287e340507fa147b2c8284dab542f",
AccessKeySecret = "0198a4b8c3105080f4acd9e507599eff",
AccessKeyType = "manual",
SecretName = "tf_example_manual",
Status = "on",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tencentcloud.ApiGatewayApiKey;
import com.pulumi.tencentcloud.ApiGatewayApiKeyArgs;
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 exampleManual = new ApiGatewayApiKey("exampleManual", ApiGatewayApiKeyArgs.builder()
.accessKeyId("28e287e340507fa147b2c8284dab542f")
.accessKeySecret("0198a4b8c3105080f4acd9e507599eff")
.accessKeyType("manual")
.secretName("tf_example_manual")
.status("on")
.build());
}
}
resources:
exampleManual:
type: tencentcloud:ApiGatewayApiKey
properties:
accessKeyId: 28e287e340507fa147b2c8284dab542f
accessKeySecret: 0198a4b8c3105080f4acd9e507599eff
accessKeyType: manual
secretName: tf_example_manual
status: on
Create ApiGatewayApiKey Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ApiGatewayApiKey(name: string, args: ApiGatewayApiKeyArgs, opts?: CustomResourceOptions);
@overload
def ApiGatewayApiKey(resource_name: str,
args: ApiGatewayApiKeyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ApiGatewayApiKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
secret_name: Optional[str] = None,
access_key_id: Optional[str] = None,
access_key_secret: Optional[str] = None,
access_key_type: Optional[str] = None,
api_gateway_api_key_id: Optional[str] = None,
status: Optional[str] = None)
func NewApiGatewayApiKey(ctx *Context, name string, args ApiGatewayApiKeyArgs, opts ...ResourceOption) (*ApiGatewayApiKey, error)
public ApiGatewayApiKey(string name, ApiGatewayApiKeyArgs args, CustomResourceOptions? opts = null)
public ApiGatewayApiKey(String name, ApiGatewayApiKeyArgs args)
public ApiGatewayApiKey(String name, ApiGatewayApiKeyArgs args, CustomResourceOptions options)
type: tencentcloud:ApiGatewayApiKey
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 ApiGatewayApiKeyArgs
- 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 ApiGatewayApiKeyArgs
- 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 ApiGatewayApiKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ApiGatewayApiKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ApiGatewayApiKeyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ApiGatewayApiKey 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 ApiGatewayApiKey resource accepts the following input properties:
- Secret
Name string - Custom key name.
- Access
Key stringId - User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters, numbers, and English underscores.
- Access
Key stringSecret - The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of letters, numbers, and English underscores.
- Access
Key stringType - Key type, supports both auto and manual (custom keys), defaults to auto.
- Api
Gateway stringApi Key Id - ID of the resource.
- Status string
- Key status. Valid values:
on
,off
.
- Secret
Name string - Custom key name.
- Access
Key stringId - User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters, numbers, and English underscores.
- Access
Key stringSecret - The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of letters, numbers, and English underscores.
- Access
Key stringType - Key type, supports both auto and manual (custom keys), defaults to auto.
- Api
Gateway stringApi Key Id - ID of the resource.
- Status string
- Key status. Valid values:
on
,off
.
- secret
Name String - Custom key name.
- access
Key StringId - User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters, numbers, and English underscores.
- access
Key StringSecret - The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of letters, numbers, and English underscores.
- access
Key StringType - Key type, supports both auto and manual (custom keys), defaults to auto.
- api
Gateway StringApi Key Id - ID of the resource.
- status String
- Key status. Valid values:
on
,off
.
- secret
Name string - Custom key name.
- access
Key stringId - User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters, numbers, and English underscores.
- access
Key stringSecret - The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of letters, numbers, and English underscores.
- access
Key stringType - Key type, supports both auto and manual (custom keys), defaults to auto.
- api
Gateway stringApi Key Id - ID of the resource.
- status string
- Key status. Valid values:
on
,off
.
- secret_
name str - Custom key name.
- access_
key_ strid - User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters, numbers, and English underscores.
- access_
key_ strsecret - The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of letters, numbers, and English underscores.
- access_
key_ strtype - Key type, supports both auto and manual (custom keys), defaults to auto.
- api_
gateway_ strapi_ key_ id - ID of the resource.
- status str
- Key status. Valid values:
on
,off
.
- secret
Name String - Custom key name.
- access
Key StringId - User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters, numbers, and English underscores.
- access
Key StringSecret - The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of letters, numbers, and English underscores.
- access
Key StringType - Key type, supports both auto and manual (custom keys), defaults to auto.
- api
Gateway StringApi Key Id - ID of the resource.
- status String
- Key status. Valid values:
on
,off
.
Outputs
All input properties are implicitly available as output properties. Additionally, the ApiGatewayApiKey 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.
- Modify
Time string - Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- 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.
- Modify
Time string - Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- 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.
- modify
Time String - Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- 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.
- modify
Time string - Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- 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.
- modify_
time str - Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- 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.
- modify
Time String - Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
Look up Existing ApiGatewayApiKey Resource
Get an existing ApiGatewayApiKey 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?: ApiGatewayApiKeyState, opts?: CustomResourceOptions): ApiGatewayApiKey
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
access_key_id: Optional[str] = None,
access_key_secret: Optional[str] = None,
access_key_type: Optional[str] = None,
api_gateway_api_key_id: Optional[str] = None,
create_time: Optional[str] = None,
modify_time: Optional[str] = None,
secret_name: Optional[str] = None,
status: Optional[str] = None) -> ApiGatewayApiKey
func GetApiGatewayApiKey(ctx *Context, name string, id IDInput, state *ApiGatewayApiKeyState, opts ...ResourceOption) (*ApiGatewayApiKey, error)
public static ApiGatewayApiKey Get(string name, Input<string> id, ApiGatewayApiKeyState? state, CustomResourceOptions? opts = null)
public static ApiGatewayApiKey get(String name, Output<String> id, ApiGatewayApiKeyState state, CustomResourceOptions options)
resources: _: type: tencentcloud:ApiGatewayApiKey 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.
- Access
Key stringId - User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters, numbers, and English underscores.
- Access
Key stringSecret - The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of letters, numbers, and English underscores.
- Access
Key stringType - Key type, supports both auto and manual (custom keys), defaults to auto.
- Api
Gateway stringApi Key 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.
- Modify
Time string - Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- Secret
Name string - Custom key name.
- Status string
- Key status. Valid values:
on
,off
.
- Access
Key stringId - User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters, numbers, and English underscores.
- Access
Key stringSecret - The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of letters, numbers, and English underscores.
- Access
Key stringType - Key type, supports both auto and manual (custom keys), defaults to auto.
- Api
Gateway stringApi Key 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.
- Modify
Time string - Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- Secret
Name string - Custom key name.
- Status string
- Key status. Valid values:
on
,off
.
- access
Key StringId - User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters, numbers, and English underscores.
- access
Key StringSecret - The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of letters, numbers, and English underscores.
- access
Key StringType - Key type, supports both auto and manual (custom keys), defaults to auto.
- api
Gateway StringApi Key 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.
- modify
Time String - Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- secret
Name String - Custom key name.
- status String
- Key status. Valid values:
on
,off
.
- access
Key stringId - User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters, numbers, and English underscores.
- access
Key stringSecret - The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of letters, numbers, and English underscores.
- access
Key stringType - Key type, supports both auto and manual (custom keys), defaults to auto.
- api
Gateway stringApi Key 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.
- modify
Time string - Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- secret
Name string - Custom key name.
- status string
- Key status. Valid values:
on
,off
.
- access_
key_ strid - User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters, numbers, and English underscores.
- access_
key_ strsecret - The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of letters, numbers, and English underscores.
- access_
key_ strtype - Key type, supports both auto and manual (custom keys), defaults to auto.
- api_
gateway_ strapi_ key_ 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.
- modify_
time str - Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- secret_
name str - Custom key name.
- status str
- Key status. Valid values:
on
,off
.
- access
Key StringId - User defined key ID, required when access_key_type is manual. The length is 5-50 characters, consisting of letters, numbers, and English underscores.
- access
Key StringSecret - The user-defined key must be passed when the access_key_type is manual. The length is 10-50 characters, consisting of letters, numbers, and English underscores.
- access
Key StringType - Key type, supports both auto and manual (custom keys), defaults to auto.
- api
Gateway StringApi Key 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.
- modify
Time String - Last modified time in the format of YYYY-MM-DDThh:mm:ssZ according to ISO 8601 standard. UTC time is used.
- secret
Name String - Custom key name.
- status String
- Key status. Valid values:
on
,off
.
Import
API gateway access key can be imported using the id, e.g.
$ pulumi import tencentcloud:index/apiGatewayApiKey:ApiGatewayApiKey test AKIDMZwceezso9ps5p8jkro8a9fwe1e7nzF2k50B
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.