SSLPolicy class
Represents a SSL policy. SSL policies give you the ability to control the features of SSL that your SSL proxy or HTTPS load balancer negotiates.
To get more information about SslPolicy, see:
- API documentation
- How-to Guides
- Using SSL Policies
Example Usage
Ssl Policy Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const prod_ssl_policy = new gcp.compute.SSLPolicy("prod-ssl-policy", {
name: "production-ssl-policy",
profile: "MODERN",
});
const nonprod_ssl_policy = new gcp.compute.SSLPolicy("nonprod-ssl-policy", {
name: "nonprod-ssl-policy",
profile: "MODERN",
minTlsVersion: "TLS_1_2",
});
const custom_ssl_policy = new gcp.compute.SSLPolicy("custom-ssl-policy", {
name: "custom-ssl-policy",
minTlsVersion: "TLS_1_2",
profile: "CUSTOM",
customFeatures: [
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
],
});
import pulumi
import pulumi_gcp as gcp
prod_ssl_policy = gcp.compute.SSLPolicy("prod-ssl-policy",
name="production-ssl-policy",
profile="MODERN")
nonprod_ssl_policy = gcp.compute.SSLPolicy("nonprod-ssl-policy",
name="nonprod-ssl-policy",
profile="MODERN",
min_tls_version="TLS_1_2")
custom_ssl_policy = gcp.compute.SSLPolicy("custom-ssl-policy",
name="custom-ssl-policy",
min_tls_version="TLS_1_2",
profile="CUSTOM",
custom_features=[
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var prod_ssl_policy = new Gcp.Compute.SSLPolicy("prod-ssl-policy", new()
{
Name = "production-ssl-policy",
Profile = "MODERN",
});
var nonprod_ssl_policy = new Gcp.Compute.SSLPolicy("nonprod-ssl-policy", new()
{
Name = "nonprod-ssl-policy",
Profile = "MODERN",
MinTlsVersion = "TLS_1_2",
});
var custom_ssl_policy = new Gcp.Compute.SSLPolicy("custom-ssl-policy", new()
{
Name = "custom-ssl-policy",
MinTlsVersion = "TLS_1_2",
Profile = "CUSTOM",
CustomFeatures = new[]
{
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384",
},
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewSSLPolicy(ctx, "prod-ssl-policy", &compute.SSLPolicyArgs{
Name: pulumi.String("production-ssl-policy"),
Profile: pulumi.String("MODERN"),
})
if err != nil {
return err
}
_, err = compute.NewSSLPolicy(ctx, "nonprod-ssl-policy", &compute.SSLPolicyArgs{
Name: pulumi.String("nonprod-ssl-policy"),
Profile: pulumi.String("MODERN"),
MinTlsVersion: pulumi.String("TLS_1_2"),
})
if err != nil {
return err
}
_, err = compute.NewSSLPolicy(ctx, "custom-ssl-policy", &compute.SSLPolicyArgs{
Name: pulumi.String("custom-ssl-policy"),
MinTlsVersion: pulumi.String("TLS_1_2"),
Profile: pulumi.String("CUSTOM"),
CustomFeatures: pulumi.StringArray{
pulumi.String("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"),
pulumi.String("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"),
},
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_compute_sslpolicy" "prod-ssl-policy" {
name = "production-ssl-policy"
profile = "MODERN"
}
resource "gcp_compute_sslpolicy" "nonprod-ssl-policy" {
name = "nonprod-ssl-policy"
profile = "MODERN"
min_tls_version = "TLS_1_2"
}
resource "gcp_compute_sslpolicy" "custom-ssl-policy" {
name = "custom-ssl-policy"
min_tls_version = "TLS_1_2"
profile = "CUSTOM"
custom_features = ["TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"]
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.SSLPolicy;
import com.pulumi.gcp.compute.SSLPolicyArgs;
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 prod_ssl_policy = new SSLPolicy("prod-ssl-policy", SSLPolicyArgs.builder()
.name("production-ssl-policy")
.profile("MODERN")
.build());
var nonprod_ssl_policy = new SSLPolicy("nonprod-ssl-policy", SSLPolicyArgs.builder()
.name("nonprod-ssl-policy")
.profile("MODERN")
.minTlsVersion("TLS_1_2")
.build());
var custom_ssl_policy = new SSLPolicy("custom-ssl-policy", SSLPolicyArgs.builder()
.name("custom-ssl-policy")
.minTlsVersion("TLS_1_2")
.profile("CUSTOM")
.customFeatures(
"TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384",
"TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384")
.build());
}
}
resources:
prod-ssl-policy:
type: gcp:compute:SSLPolicy
properties:
name: production-ssl-policy
profile: MODERN
nonprod-ssl-policy:
type: gcp:compute:SSLPolicy
properties:
name: nonprod-ssl-policy
profile: MODERN
minTlsVersion: TLS_1_2
custom-ssl-policy:
type: gcp:compute:SSLPolicy
properties:
name: custom-ssl-policy
minTlsVersion: TLS_1_2
profile: CUSTOM
customFeatures:
- TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
Ssl Policy Post Quantum
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const post_quantum_ssl_policy = new gcp.compute.SSLPolicy("post-quantum-ssl-policy", {
name: "post-quantum-ssl-policy",
profile: "MODERN",
minTlsVersion: "TLS_1_2",
postQuantumKeyExchange: "ENABLED",
});
import pulumi
import pulumi_gcp as gcp
post_quantum_ssl_policy = gcp.compute.SSLPolicy("post-quantum-ssl-policy",
name="post-quantum-ssl-policy",
profile="MODERN",
min_tls_version="TLS_1_2",
post_quantum_key_exchange="ENABLED")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var post_quantum_ssl_policy = new Gcp.Compute.SSLPolicy("post-quantum-ssl-policy", new()
{
Name = "post-quantum-ssl-policy",
Profile = "MODERN",
MinTlsVersion = "TLS_1_2",
PostQuantumKeyExchange = "ENABLED",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewSSLPolicy(ctx, "post-quantum-ssl-policy", &compute.SSLPolicyArgs{
Name: pulumi.String("post-quantum-ssl-policy"),
Profile: pulumi.String("MODERN"),
MinTlsVersion: pulumi.String("TLS_1_2"),
PostQuantumKeyExchange: pulumi.String("ENABLED"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_compute_sslpolicy" "post-quantum-ssl-policy" {
name = "post-quantum-ssl-policy"
profile = "MODERN"
min_tls_version = "TLS_1_2"
post_quantum_key_exchange = "ENABLED"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.SSLPolicy;
import com.pulumi.gcp.compute.SSLPolicyArgs;
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 post_quantum_ssl_policy = new SSLPolicy("post-quantum-ssl-policy", SSLPolicyArgs.builder()
.name("post-quantum-ssl-policy")
.profile("MODERN")
.minTlsVersion("TLS_1_2")
.postQuantumKeyExchange("ENABLED")
.build());
}
}
resources:
post-quantum-ssl-policy:
type: gcp:compute:SSLPolicy
properties:
name: post-quantum-ssl-policy
profile: MODERN
minTlsVersion: TLS_1_2
postQuantumKeyExchange: ENABLED
Import
SslPolicy can be imported using any of these accepted formats:
projects/{{project}}/global/sslPolicies/{{name}}{{project}}/{{name}}{{name}}
When using the pulumi import command, SslPolicy can be imported using one of the formats above. For example:
$ pulumi import gcp:compute/sSLPolicy:SSLPolicy default projects/{{project}}/global/sslPolicies/{{name}}
$ pulumi import gcp:compute/sSLPolicy:SSLPolicy default {{project}}/{{name}}
$ pulumi import gcp:compute/sSLPolicy:SSLPolicy default {{name}}
Constructors
- SSLPolicy(String name, {SSLPolicyArgs? args, CustomResourceOptions? options})
-
Creates a new SSLPolicy.
nameThe Pulumi resource name.argsArguments used to configure this SSLPolicy. The set of arguments for SSLPolicy.optionsResource options controlling this resource's behavior. - SSLPolicy.reference(String urn)
- Creates a typed reference to an existing SSLPolicy resource.
Properties
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
creationTimestamp
↔ Output<
String> -
Creation timestamp in RFC3339 text format.
latefinal
-
customFeatures
↔ Output<
List< String> ?> -
Profile specifies the set of SSL features that can be used by the
load balancer when negotiating SSL with clients. This can be one of
COMPATIBLE,MODERN,RESTRICTED, orCUSTOM. If usingCUSTOM, the set of SSL features to enable must be specified in thecustomFeaturesfield. See the official documentation for which ciphers are available to use. Note: this argument must be present when using theCUSTOMprofile. This argument must not be present when using any other profile.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?> -
An optional description of this resource.
latefinal
-
enabledFeatures
↔ Output<
List< String> > -
The list of features enabled in the SSL policy.
latefinal
-
fingerprint
↔ Output<
String> -
Fingerprint of this resource. A hash of the contents stored in this
object. This field is used in optimistic locking.
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
-
minTlsVersion
↔ Output<
String?> -
The minimum version of SSL protocol that can be used by the clients
to establish a connection with the load balancer. When set to
TLS_1_3, the profile field must be set toRESTRICTED. Default value isTLS_1_0. Possible values are:TLS_1_0,TLS_1_1,TLS_1_2,TLS_1_3.latefinal -
name
↔ Output<
String> -
Name of the resource. Provided by the client when the resource is
created. The name must be 1-63 characters long, and comply with
RFC1035. Specifically, the name must be 1-63 characters long and match
the regular expression
a-z?which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.latefinal -
postQuantumKeyExchange
↔ Output<
String?> -
One of
DEFAULT,ENABLED, orDEFERRED. Controls whether the load balancer negotiates X25519MLKEM768 key exchange when clients advertise support for it. When set toDEFAULT, or if no SSL Policy is attached to the target proxy, the load balancer disallows X25519MLKEM768 key exchange before October 2026, and allows it afterward. When set toENABLED, the load balancer allows X25519MLKEM768 key exchange. When set toDEFERRED, the load balancer disallows X25519MLKEM768 key exchange until October 2027, and allows it afterward. Possible values are:DEFAULT,ENABLED,DEFERRED.latefinal -
profile
↔ Output<
String?> -
Profile specifies the set of SSL features that can be used by the
load balancer when negotiating SSL with clients. If using
CUSTOM, the set of SSL features to enable must be specified in thecustomFeaturesfield. See the official documentation for information on what cipher suites each profile provides. IfCUSTOMis used, thecustomFeaturesattribute must be set. If set toFIPS_202205,minTlsVersionmust also be set toTLS_1_2. Default value isCOMPATIBLE. Possible values are:COMPATIBLE,MODERN,RESTRICTED,CUSTOM,FIPS_202205.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
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
selfLink
↔ Output<
String> -
The URI of the created resource.
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
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