Up-to-date reference of API arguments for API Gateway signature service you can get at documentation portal
opentelekomcloud_apigw_signature_v2¶
Manages a signature resource within OpenTelekomCloud.
Example Usage¶
Create a signature of the HMAC type¶
variable "gateway_id" {}
variable "signature_name" {}
variable "signature_key" {}
variable "signature_secret" {}
resource "opentelekomcloud_apigw_signature_v2" "hmac" {
instance_id = var.gateway_id
name = var.signature_name
type = "hmac"
key = var.signature_key
secret = var.signature_secret
}
Create a signature and automatically generate key and secret¶
variable "gateway_id" {}
variable "signature_name" {}
resource "opentelekomcloud_apigw_signature_v2" "hmac" {
instance_id = var.gateway_id
name = var.signature_name
type = "hmac"
}
Create a signature of the AES type¶
variable "gateway_id" {}
variable "signature_name" {}
variable "signature_key" {}
variable "signature_secret" {}
resource "opentelekomcloud_apigw_signature_v2" "aes" {
instance_id = var.gateway_id
name = var.signature_name
type = "aes"
algorithm = "aes-128-cfb"
key = var.signature_key
secret = var.signature_secret
}
Argument Reference¶
The following arguments are supported:
gateway_id- (Required, String, ForceNew) Specifies the ID of the dedicated gateway to which the signature belongs. Changing this will create a new resource.name- (Required, String) Specifies the signature name. The valid length is limited from3to64, only English letters, Chinese characters, digits and underscores_are allowed. The name must start with an English letter or Chinese character.type- (Required, String) Specifies the type of signature. The valid values are as follows:basic: Basic auth type.hmac: HMAC type.aes: AES type Changing this will create a new resource.
key- (Optional, String) Specifies the signature key.For
basictype: The value contains4to32characters, including letters, digits, underscores_and hyphens-. It must start with a letter.For
hmactype: The value contains8to32characters, including letters, digits, underscores_and hyphens-. It must start with a letter or digit.For
aestype: The value contains16characters if theaes-128-cfbalgorithm is used, or32characters if theaes-256-cfbalgorithm is used. Only letters, digits, and special characters_-!@#$%+/=are allowed. It must start with a letter, digit, plus sign+, or slash/. If not specified, the key will automatically generated. The auto-generation is only supported on first creation. Changing this will create a new resource.
secret- (Optional, String) Specifies the signature secret. If not specified, the secret will automatically generated. The auto-generation is only supported on first creation. Changing this will create a new resource.For
basictype: The value contains8to64characters. Letters, digits, and special characters_-!@#$%are allowed. It must start with a letter or digit. If not specified, a value is automatically generated.For
hmactype: The value contains16to64characters. Letters, digits, and special characters_-!@#$%are allowed. It must start with a letter or digit. If not specified, a value is automatically generated.For
aestype: The value contains16characters, including letters, digits, and special characters_-!@#$%+/=. It must start with a letter, digit, plus sign+, or slash/. If not specified, a value is automatically generated.
algorithm- (Optional, String) Specifies the signature algorithm. This parameter is required and only available when signaturetypeisaes. The valid values are as follows:aes-128-cfbaes-256-cfbChanging this will create a new resource.
Attribute Reference¶
In addition to all arguments above, the following attributes are exported:
id- The ID of the signature.region- Region where the signature is located.created_at- The creation time of the signature.updated_at- The latest update time of the signature.
Import¶
Signatures can be imported using their id and related dedicated gateway ID, separated by a slash, e.g.
$ terraform import opentelekomcloud_apigw_signature_v2.sig <gateway_id>/<id>