Skip to main content

server_tls_policies

Creates, updates, deletes, gets or lists a server_tls_policies resource.

Overview

Nameserver_tls_policies
TypeResource
Idgoogle.networksecurity.server_tls_policies

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringRequired. Name of the ServerTlsPolicy resource. It matches the pattern projects/*/locations/{location}/serverTlsPolicies/{server_tls_policy}
allowOpenbooleanThis field applies only for Traffic Director policies. It is must be set to false for Application Load Balancer policies. Determines if server allows plaintext connections. If set to true, server allows plain text connections. By default, it is set to false. This setting is not exclusive of other encryption modes. For example, if allow_open and mtls_policy are set, server allows both plain text and mTLS connections. See documentation of other encryption modes to confirm compatibility. Consider using it if you wish to upgrade in place your deployment to TLS while having mixed TLS and non-TLS traffic reaching port :80.
createTimestring (google-datetime)Output only. The timestamp when the resource was created.
descriptionstringFree-text description of the resource.
labelsobjectSet of label tags associated with the resource.
mtlsPolicyobjectThis field is required if the policy is used with Application Load Balancers. This field can be empty for Traffic Director. Defines a mechanism to provision peer validation certificates for peer to peer authentication (Mutual TLS - mTLS). If not specified, client certificate will not be requested. The connection is treated as TLS and not mTLS. If allow_open and mtls_policy are set, server allows both plain text and mTLS connections. (id: MTLSPolicy)
serverCertificateobjectOptional if policy is to be used with Traffic Director. For Application Load Balancers must be empty. Defines a mechanism to provision server identity (public and private keys). Cannot be combined with allow_open as a permissive mode that allows both plain text and TLS is not supported. (id: GoogleCloudNetworksecurityV1CertificateProvider)
updateTimestring (google-datetime)Output only. The timestamp when the resource was updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_server_tls_policies_getselectprojectsId, locationsId, serverTlsPoliciesIdGets details of a single ServerTlsPolicy.
projects_locations_server_tls_policies_listselectprojectsId, locationsIdpageSize, pageToken, returnPartialSuccessLists ServerTlsPolicies in a given project and location.
projects_locations_server_tls_policies_createinsertprojectsId, locationsIdserverTlsPolicyIdCreates a new ServerTlsPolicy in a given project and location.
projects_locations_server_tls_policies_patchupdateprojectsId, locationsId, serverTlsPoliciesIdupdateMaskUpdates the parameters of a single ServerTlsPolicy.
projects_locations_server_tls_policies_deletedeleteprojectsId, locationsId, serverTlsPoliciesIdDeletes a single ServerTlsPolicy.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
projectsIdstring
serverTlsPoliciesIdstring
pageSizeinteger (int32)
pageTokenstring
returnPartialSuccessboolean
serverTlsPolicyIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details of a single ServerTlsPolicy.

SELECT
name,
allowOpen,
createTime,
description,
labels,
mtlsPolicy,
serverCertificate,
updateTime
FROM google.networksecurity.server_tls_policies
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND serverTlsPoliciesId = '{{ serverTlsPoliciesId }}' -- required;

INSERT examples

Creates a new ServerTlsPolicy in a given project and location.

INSERT INTO google.networksecurity.server_tls_policies (
data__name,
data__description,
data__labels,
data__allowOpen,
data__serverCertificate,
data__mtlsPolicy,
projectsId,
locationsId,
serverTlsPolicyId
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ labels }}',
{{ allowOpen }},
'{{ serverCertificate }}',
'{{ mtlsPolicy }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ serverTlsPolicyId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the parameters of a single ServerTlsPolicy.

UPDATE google.networksecurity.server_tls_policies
SET
data__name = '{{ name }}',
data__description = '{{ description }}',
data__labels = '{{ labels }}',
data__allowOpen = {{ allowOpen }},
data__serverCertificate = '{{ serverCertificate }}',
data__mtlsPolicy = '{{ mtlsPolicy }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND serverTlsPoliciesId = '{{ serverTlsPoliciesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single ServerTlsPolicy.

DELETE FROM google.networksecurity.server_tls_policies
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND serverTlsPoliciesId = '{{ serverTlsPoliciesId }}' --required;