ClientTlsPolicy class
ClientTlsPolicy is a resource that specifies how a client should authenticate connections to backends of a service. This resource itself does not affect configuration unless it is attached to a backend service resource.
To get more information about ClientTlsPolicy, see:
- API documentation
- How-to Guides
- Service Security
Example Usage
Network Security Client Tls Policy Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const _default = new gcp.networksecurity.ClientTlsPolicy("default", {
name: "my-client-tls-policy",
labels: {
foo: "bar",
},
description: "my description",
sni: "secure.example.com",
});
import pulumi
import pulumi_gcp as gcp
default = gcp.networksecurity.ClientTlsPolicy("default",
name="my-client-tls-policy",
labels={
"foo": "bar",
},
description="my description",
sni="secure.example.com")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var @default = new Gcp.NetworkSecurity.ClientTlsPolicy("default", new()
{
Name = "my-client-tls-policy",
Labels =
{
{ "foo", "bar" },
},
Description = "my description",
Sni = "secure.example.com",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/networksecurity"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := networksecurity.NewClientTlsPolicy(ctx, "default", &networksecurity.ClientTlsPolicyArgs{
Name: pulumi.String("my-client-tls-policy"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
Description: pulumi.String("my description"),
Sni: pulumi.String("secure.example.com"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_networksecurity_clienttlspolicy" "default" {
name = "my-client-tls-policy"
labels = {
"foo" = "bar"
}
description = "my description"
sni = "secure.example.com"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.networksecurity.ClientTlsPolicy;
import com.pulumi.gcp.networksecurity.ClientTlsPolicyArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 default_ = new ClientTlsPolicy("default", ClientTlsPolicyArgs.builder()
.name("my-client-tls-policy")
.labels(Map.of("foo", "bar"))
.description("my description")
.sni("secure.example.com")
.build());
}
}
resources:
default:
type: gcp:networksecurity:ClientTlsPolicy
properties:
name: my-client-tls-policy
labels:
foo: bar
description: my description
sni: secure.example.com
Network Security Client Tls Policy Advanced
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const _default = new gcp.networksecurity.ClientTlsPolicy("default", {
name: "my-client-tls-policy",
labels: {
foo: "bar",
},
description: "my description",
clientCertificate: {
certificateProviderInstance: {
pluginInstance: "google_cloud_private_spiffe",
},
},
serverValidationCas: [{
grpcEndpoint: {
targetUri: "unix:mypath",
},
}],
});
import pulumi
import pulumi_gcp as gcp
default = gcp.networksecurity.ClientTlsPolicy("default",
name="my-client-tls-policy",
labels={
"foo": "bar",
},
description="my description",
client_certificate={
"certificate_provider_instance": {
"plugin_instance": "google_cloud_private_spiffe",
},
},
server_validation_cas=[{
"grpc_endpoint": {
"target_uri": "unix:mypath",
},
}])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var @default = new Gcp.NetworkSecurity.ClientTlsPolicy("default", new()
{
Name = "my-client-tls-policy",
Labels =
{
{ "foo", "bar" },
},
Description = "my description",
ClientCertificate = new Gcp.NetworkSecurity.Inputs.ClientTlsPolicyClientCertificateArgs
{
CertificateProviderInstance = new Gcp.NetworkSecurity.Inputs.ClientTlsPolicyClientCertificateCertificateProviderInstanceArgs
{
PluginInstance = "google_cloud_private_spiffe",
},
},
ServerValidationCas = new[]
{
new Gcp.NetworkSecurity.Inputs.ClientTlsPolicyServerValidationCaArgs
{
GrpcEndpoint = new Gcp.NetworkSecurity.Inputs.ClientTlsPolicyServerValidationCaGrpcEndpointArgs
{
TargetUri = "unix:mypath",
},
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/networksecurity"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := networksecurity.NewClientTlsPolicy(ctx, "default", &networksecurity.ClientTlsPolicyArgs{
Name: pulumi.String("my-client-tls-policy"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
Description: pulumi.String("my description"),
ClientCertificate: &networksecurity.ClientTlsPolicyClientCertificateArgs{
CertificateProviderInstance: &networksecurity.ClientTlsPolicyClientCertificateCertificateProviderInstanceArgs{
PluginInstance: pulumi.String("google_cloud_private_spiffe"),
},
},
ServerValidationCas: networksecurity.ClientTlsPolicyServerValidationCaArray{
&networksecurity.ClientTlsPolicyServerValidationCaArgs{
GrpcEndpoint: &networksecurity.ClientTlsPolicyServerValidationCaGrpcEndpointArgs{
TargetUri: pulumi.String("unix:mypath"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_networksecurity_clienttlspolicy" "default" {
name = "my-client-tls-policy"
labels = {
"foo" = "bar"
}
description = "my description"
client_certificate = {
certificate_provider_instance = {
plugin_instance = "google_cloud_private_spiffe"
}
}
server_validation_cas {
grpc_endpoint = {
target_uri = "unix:mypath"
}
}
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.networksecurity.ClientTlsPolicy;
import com.pulumi.gcp.networksecurity.ClientTlsPolicyArgs;
import com.pulumi.gcp.networksecurity.inputs.ClientTlsPolicyClientCertificateArgs;
import com.pulumi.gcp.networksecurity.inputs.ClientTlsPolicyClientCertificateCertificateProviderInstanceArgs;
import com.pulumi.gcp.networksecurity.inputs.ClientTlsPolicyServerValidationCaArgs;
import com.pulumi.gcp.networksecurity.inputs.ClientTlsPolicyServerValidationCaGrpcEndpointArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 default_ = new ClientTlsPolicy("default", ClientTlsPolicyArgs.builder()
.name("my-client-tls-policy")
.labels(Map.of("foo", "bar"))
.description("my description")
.clientCertificate(ClientTlsPolicyClientCertificateArgs.builder()
.certificateProviderInstance(ClientTlsPolicyClientCertificateCertificateProviderInstanceArgs.builder()
.pluginInstance("google_cloud_private_spiffe")
.build())
.build())
.serverValidationCas(ClientTlsPolicyServerValidationCaArgs.builder()
.grpcEndpoint(ClientTlsPolicyServerValidationCaGrpcEndpointArgs.builder()
.targetUri("unix:mypath")
.build())
.build())
.build());
}
}
resources:
default:
type: gcp:networksecurity:ClientTlsPolicy
properties:
name: my-client-tls-policy
labels:
foo: bar
description: my description
clientCertificate:
certificateProviderInstance:
pluginInstance: google_cloud_private_spiffe
serverValidationCas:
- grpcEndpoint:
targetUri: unix:mypath
Import
ClientTlsPolicy can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/clientTlsPolicies/{{name}}{{project}}/{{location}}/{{name}}{{location}}/{{name}}
When using the pulumi import command, ClientTlsPolicy can be imported using one of the formats above. For example:
$ pulumi import gcp:networksecurity/clientTlsPolicy:ClientTlsPolicy default projects/{{project}}/locations/{{location}}/clientTlsPolicies/{{name}}
$ pulumi import gcp:networksecurity/clientTlsPolicy:ClientTlsPolicy default {{project}}/{{location}}/{{name}}
$ pulumi import gcp:networksecurity/clientTlsPolicy:ClientTlsPolicy default {{location}}/{{name}}
Constructors
- ClientTlsPolicy(String name, {ClientTlsPolicyArgs? args, CustomResourceOptions? options})
-
Creates a new ClientTlsPolicy.
nameThe Pulumi resource name.argsArguments used to configure this ClientTlsPolicy. The set of arguments for ClientTlsPolicy.optionsResource options controlling this resource's behavior. - ClientTlsPolicy.reference(String urn)
- Creates a typed reference to an existing ClientTlsPolicy resource.
Properties
-
childResources
→ Set<
Resource> -
finalinherited
-
clientCertificate
↔ Output<
ClientTlsPolicyClientCertificate?> -
Defines a mechanism to provision client identity (public and private keys) for peer to peer authentication. The presence of this dictates mTLS.
Structure is documented below.
latefinal
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
createTime
↔ Output<
String> -
Time the ClientTlsPolicy was created in UTC.
latefinal
-
deletionPolicy
↔ Output<
String> -
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
When a 'terraform destroy' or 'pulumi up' would delete the resource,
the command will fail if this field is set to "PREVENT" in Terraform state.
When set to "ABANDON", the command will remove the resource from Terraform
management without updating or deleting the resource in the API.
When set to "DELETE", deleting the resource is allowed.
latefinal
-
description
↔ Output<
String?> -
A free-text description of the resource. Max length 1024 characters.
latefinal
-
effectiveLabels
↔ Output<
Map< String, String> > -
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
labels
↔ Output<
Map< String, String> ?> -
Set of label tags associated with the ClientTlsPolicy resource.
Note: This field is non-authoritative, and will only manage the labels present in your configuration.
Please refer to the field
effectiveLabelsfor all of the labels present on the resource.latefinal -
location
↔ Output<
String?> -
The location of the client tls policy.
The default value is
global.latefinal -
name
↔ Output<
String> -
Name of the ClientTlsPolicy resource.
latefinal
-
project
↔ Output<
String> -
The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
latefinal
-
pulumiLabels
↔ Output<
Map< String, String> > -
The combination of labels configured directly on the resource
and default labels configured on the provider.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
serverValidationCas
↔ Output<
List< ClientTlsPolicyServerValidationCa> ?> -
Defines the mechanism to obtain the Certificate Authority certificate to validate the server certificate. If empty, client does not validate the server certificate.
Structure is documented below.
latefinal
-
sni
↔ Output<
String?> -
Server Name Indication string to present to the server during TLS handshake. E.g: "secure.example.com".
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
updateTime
↔ Output<
String> -
Time the ClientTlsPolicy was updated in UTC.
latefinal
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {ClientTlsPolicyState? state, CustomResourceOptions? options}) → ClientTlsPolicy -
Gets an existing ClientTlsPolicy resource's state with the given
nameandid.