Creates a custom security policy for a Network Load Balancer (NLB) instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateSecurityPolicy

The operation that you want to perform. Set the value to CreateSecurityPolicy.

TlsVersions.N String No TLSv1.0

The supported versions of the Transport Layer Security (TLS) protocol. Valid values: TLSv1.0, TLSv1.1, TLSv1.2, and TLSv1.3. You can specify at most four TLS protocol versions.

SecurityPolicyName String No TLSCipherPolicy

The name of the security policy.

The name must be 1 to 200 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-).

ResourceGroupId String No rg-atstuj3rtop****

The resource group ID.

Ciphers.N String No ECDHE-ECDSA-AES128-SHA

The supported cipher suites, which are determined by the TLS protocol version. You can specify at most 32 cipher suites.

TLS 1.0 and TLS 1.1 support the following cipher suites:

  • ECDHE-ECDSA-AES128-SHA
  • ECDHE-ECDSA-AES256-SHA
  • ECDHE-RSA-AES128-SHA
  • ECDHE-RSA-AES256-SHA
  • AES128-SHA
  • AES256-SHA
  • DES-CBC3-SHA

TLS 1.2 supports the following cipher suites:

  • ECDHE-ECDSA-AES128-SHA
  • ECDHE-ECDSA-AES256-SHA
  • ECDHE-RSA-AES128-SHA
  • ECDHE-RSA-AES256-SHA
  • AES128-SHA
  • AES256-SHA
  • DES-CBC3-SHA
  • ECDHE-ECDSA-AES128-GCM-SHA256
  • ECDHE-ECDSA-AES256-GCM-SHA384
  • ECDHE-ECDSA-AES128-SHA256
  • ECDHE-ECDSA-AES256-SHA384
  • ECDHE-RSA-AES128-GCM-SHA256
  • ECDHE-RSA-AES256-GCM-SHA384
  • ECDHE-RSA-AES128-SHA256
  • ECDHE-RSA-AES256-SHA384
  • AES128-GCM-SHA256
  • AES256-GCM-SHA384
  • AES128-SHA256
  • AES256-SHA256

TLS 1.3 supports the following cipher suites:

  • TLS_AES_128_GCM_SHA256
  • TLS_AES_256_GCM_SHA384
  • TLS_CHACHA20_POLY1305_SHA256
  • TLS_AES_128_CCM_SHA256
  • TLS_AES_128_CCM_8_SHA256
DryRun Boolean No false

Specifies whether to perform only a dry run, without performing the actual request. Valid values:

  • true: performs only a dry run. The system checks the request for potential issues, including missing parameter values, incorrect request syntax, and service limits. If the request fails the dry run, an error message is returned. If the request passes the dry run, the DryRunOperation error code is returned.
  • false (default): performs a dry run and performs the actual request. If the request passes the dry run, a 2xx HTTP status code is returned and the operation is performed.
ClientToken String No 123e4567-e89b-12d3-a456-426655440000

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters.

Note If you do not specify this parameter, the system automatically uses the request ID as the client token. The request ID may be different for each request.
RegionId String No cn-hangzhou

The region ID of the NLB instance.

You can call the DescribeRegions operation to query the most recent region list.

Response parameters

Parameter Type Example Description
RequestId String D7A8875F-373A-5F48-8484-25B07A61F2AF

The request ID.

SecurityPolicyId String tls-bp14bb1e7dll4f****

The ID of the TLS security policy.

JobId String 72dcd26b-f12d-4c27-b3af-18f6aed5****

The ID of the asynchronous task.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateSecurityPolicy
&TlsVersions=["TLSv1.0"]
&SecurityPolicyName=TLSCipherPolicy
&ResourceGroupId=rg-atstuj3rtop****
&Ciphers=["ECDHE-ECDSA-AES128-SHA"]
&DryRun=false
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&RegionId=cn-hangzhou
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateSecurityPolicyResponse>
    <RequestId>D7A8875F-373A-5F48-8484-25B07A61F2AF</RequestId>
    <SecurityPolicyId>tls-bp14bb1e7dll4f****</SecurityPolicyId>
    <JobId>72dcd26b-f12d-4c27-b3af-18f6aed5****</JobId>
</CreateSecurityPolicyResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "D7A8875F-373A-5F48-8484-25B07A61F2AF",
  "SecurityPolicyId" : "tls-bp14bb1e7dll4f****",
  "JobId" : "72dcd26b-f12d-4c27-b3af-18f6aed5****"
}

Error codes

For a list of error codes, visit the API Error Center.