All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.gcp.compute.kotlin.RegionSslCertificateArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.compute.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.RegionSslCertificateArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * A RegionSslCertificate resource, used for HTTPS load balancing. This resource
 * provides a mechanism to upload an SSL key and certificate to
 * the load balancer to serve secure connections from the user.
 * To get more information about RegionSslCertificate, see:
 * * [API documentation](https://cloud.google.com/compute/docs/reference/rest/v1/regionSslCertificates)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/load-balancing/docs/ssl-certificates)
 * ## Example Usage
 * ### Region Ssl Certificate Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as std from "@pulumi/std";
 * const _default = new gcp.compute.RegionSslCertificate("default", {
 *     region: "us-central1",
 *     namePrefix: "my-certificate-",
 *     description: "a description",
 *     privateKey: std.file({
 *         input: "path/to/private.key",
 *     }).then(invoke => invoke.result),
 *     certificate: std.file({
 *         input: "path/to/certificate.crt",
 *     }).then(invoke => invoke.result),
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * import pulumi_std as std
 * default = gcp.compute.RegionSslCertificate("default",
 *     region="us-central1",
 *     name_prefix="my-certificate-",
 *     description="a description",
 *     private_key=std.file(input="path/to/private.key").result,
 *     certificate=std.file(input="path/to/certificate.crt").result)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * using Std = Pulumi.Std;
 * return await Deployment.RunAsync(() =>
 * {
 *     var @default = new Gcp.Compute.RegionSslCertificate("default", new()
 *     {
 *         Region = "us-central1",
 *         NamePrefix = "my-certificate-",
 *         Description = "a description",
 *         PrivateKey = Std.File.Invoke(new()
 *         {
 *             Input = "path/to/private.key",
 *         }).Apply(invoke => invoke.Result),
 *         Certificate = Std.File.Invoke(new()
 *         {
 *             Input = "path/to/certificate.crt",
 *         }).Apply(invoke => invoke.Result),
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-std/sdk/go/std"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		invokeFile, err := std.File(ctx, &std.FileArgs{
 * 			Input: "path/to/private.key",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeFile1, err := std.File(ctx, &std.FileArgs{
 * 			Input: "path/to/certificate.crt",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewRegionSslCertificate(ctx, "default", &compute.RegionSslCertificateArgs{
 * 			Region:      pulumi.String("us-central1"),
 * 			NamePrefix:  pulumi.String("my-certificate-"),
 * 			Description: pulumi.String("a description"),
 * 			PrivateKey:  invokeFile.Result,
 * 			Certificate: invokeFile1.Result,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.compute.RegionSslCertificate;
 * import com.pulumi.gcp.compute.RegionSslCertificateArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * 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 RegionSslCertificate("default", RegionSslCertificateArgs.builder()
 *             .region("us-central1")
 *             .namePrefix("my-certificate-")
 *             .description("a description")
 *             .privateKey(StdFunctions.file(FileArgs.builder()
 *                 .input("path/to/private.key")
 *                 .build()).result())
 *             .certificate(StdFunctions.file(FileArgs.builder()
 *                 .input("path/to/certificate.crt")
 *                 .build()).result())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:compute:RegionSslCertificate
 *     properties:
 *       region: us-central1
 *       namePrefix: my-certificate-
 *       description: a description
 *       privateKey:
 *         fn::invoke:
 *           Function: std:file
 *           Arguments:
 *             input: path/to/private.key
 *           Return: result
 *       certificate:
 *         fn::invoke:
 *           Function: std:file
 *           Arguments:
 *             input: path/to/certificate.crt
 *           Return: result
 * ```
 * 
 * ### Region Ssl Certificate Random Provider
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as random from "@pulumi/random";
 * import * as std from "@pulumi/std";
 * const certificate = new random.RandomId("certificate", {
 *     byteLength: 4,
 *     prefix: "my-certificate-",
 *     keepers: {
 *         private_key: std.filebase64sha256({
 *             input: "path/to/private.key",
 *         }).then(invoke => invoke.result),
 *         certificate: std.filebase64sha256({
 *             input: "path/to/certificate.crt",
 *         }).then(invoke => invoke.result),
 *     },
 * });
 * // You may also want to control name generation explicitly:
 * const _default = new gcp.compute.RegionSslCertificate("default", {
 *     region: "us-central1",
 *     name: certificate.hex,
 *     privateKey: std.file({
 *         input: "path/to/private.key",
 *     }).then(invoke => invoke.result),
 *     certificate: std.file({
 *         input: "path/to/certificate.crt",
 *     }).then(invoke => invoke.result),
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * import pulumi_random as random
 * import pulumi_std as std
 * certificate = random.RandomId("certificate",
 *     byte_length=4,
 *     prefix="my-certificate-",
 *     keepers={
 *         "private_key": std.filebase64sha256(input="path/to/private.key").result,
 *         "certificate": std.filebase64sha256(input="path/to/certificate.crt").result,
 *     })
 * # You may also want to control name generation explicitly:
 * default = gcp.compute.RegionSslCertificate("default",
 *     region="us-central1",
 *     name=certificate.hex,
 *     private_key=std.file(input="path/to/private.key").result,
 *     certificate=std.file(input="path/to/certificate.crt").result)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * using Random = Pulumi.Random;
 * using Std = Pulumi.Std;
 * return await Deployment.RunAsync(() =>
 * {
 *     var certificate = new Random.RandomId("certificate", new()
 *     {
 *         ByteLength = 4,
 *         Prefix = "my-certificate-",
 *         Keepers =
 *         {
 *             { "private_key", Std.Filebase64sha256.Invoke(new()
 *             {
 *                 Input = "path/to/private.key",
 *             }).Apply(invoke => invoke.Result) },
 *             { "certificate", Std.Filebase64sha256.Invoke(new()
 *             {
 *                 Input = "path/to/certificate.crt",
 *             }).Apply(invoke => invoke.Result) },
 *         },
 *     });
 *     // You may also want to control name generation explicitly:
 *     var @default = new Gcp.Compute.RegionSslCertificate("default", new()
 *     {
 *         Region = "us-central1",
 *         Name = certificate.Hex,
 *         PrivateKey = Std.File.Invoke(new()
 *         {
 *             Input = "path/to/private.key",
 *         }).Apply(invoke => invoke.Result),
 *         Certificate = Std.File.Invoke(new()
 *         {
 *             Input = "path/to/certificate.crt",
 *         }).Apply(invoke => invoke.Result),
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
 * 	"github.com/pulumi/pulumi-std/sdk/go/std"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		invokeFilebase64sha256, err := std.Filebase64sha256(ctx, &std.Filebase64sha256Args{
 * 			Input: "path/to/private.key",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeFilebase64sha2561, err := std.Filebase64sha256(ctx, &std.Filebase64sha256Args{
 * 			Input: "path/to/certificate.crt",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		certificate, err := random.NewRandomId(ctx, "certificate", &random.RandomIdArgs{
 * 			ByteLength: pulumi.Int(4),
 * 			Prefix:     pulumi.String("my-certificate-"),
 * 			Keepers: pulumi.StringMap{
 * 				"private_key": invokeFilebase64sha256.Result,
 * 				"certificate": invokeFilebase64sha2561.Result,
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeFile2, err := std.File(ctx, &std.FileArgs{
 * 			Input: "path/to/private.key",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeFile3, err := std.File(ctx, &std.FileArgs{
 * 			Input: "path/to/certificate.crt",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		// You may also want to control name generation explicitly:
 * 		_, err = compute.NewRegionSslCertificate(ctx, "default", &compute.RegionSslCertificateArgs{
 * 			Region:      pulumi.String("us-central1"),
 * 			Name:        certificate.Hex,
 * 			PrivateKey:  invokeFile2.Result,
 * 			Certificate: invokeFile3.Result,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.random.RandomId;
 * import com.pulumi.random.RandomIdArgs;
 * import com.pulumi.gcp.compute.RegionSslCertificate;
 * import com.pulumi.gcp.compute.RegionSslCertificateArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * 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 certificate = new RandomId("certificate", RandomIdArgs.builder()
 *             .byteLength(4)
 *             .prefix("my-certificate-")
 *             .keepers(Map.ofEntries(
 *                 Map.entry("private_key", StdFunctions.filebase64sha256(Filebase64sha256Args.builder()
 *                     .input("path/to/private.key")
 *                     .build()).result()),
 *                 Map.entry("certificate", StdFunctions.filebase64sha256(Filebase64sha256Args.builder()
 *                     .input("path/to/certificate.crt")
 *                     .build()).result())
 *             ))
 *             .build());
 *         // You may also want to control name generation explicitly:
 *         var default_ = new RegionSslCertificate("default", RegionSslCertificateArgs.builder()
 *             .region("us-central1")
 *             .name(certificate.hex())
 *             .privateKey(StdFunctions.file(FileArgs.builder()
 *                 .input("path/to/private.key")
 *                 .build()).result())
 *             .certificate(StdFunctions.file(FileArgs.builder()
 *                 .input("path/to/certificate.crt")
 *                 .build()).result())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   # You may also want to control name generation explicitly:
 *   default:
 *     type: gcp:compute:RegionSslCertificate
 *     properties:
 *       region: us-central1
 *       name: ${certificate.hex}
 *       privateKey:
 *         fn::invoke:
 *           Function: std:file
 *           Arguments:
 *             input: path/to/private.key
 *           Return: result
 *       certificate:
 *         fn::invoke:
 *           Function: std:file
 *           Arguments:
 *             input: path/to/certificate.crt
 *           Return: result
 *   certificate:
 *     type: random:RandomId
 *     properties:
 *       byteLength: 4
 *       prefix: my-certificate-
 *       keepers:
 *         private_key:
 *           fn::invoke:
 *             Function: std:filebase64sha256
 *             Arguments:
 *               input: path/to/private.key
 *             Return: result
 *         certificate:
 *           fn::invoke:
 *             Function: std:filebase64sha256
 *             Arguments:
 *               input: path/to/certificate.crt
 *             Return: result
 * ```
 * 
 * ### Region Ssl Certificate Target Https Proxies
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * import * as std from "@pulumi/std";
 * // Using with Region Target HTTPS Proxies
 * //
 * // SSL certificates cannot be updated after creation. In order to apply
 * // the specified configuration, the provider will destroy the existing
 * // resource and create a replacement. To effectively use an SSL
 * // certificate resource with a Target HTTPS Proxy resource, it's
 * // recommended to specify create_before_destroy in a lifecycle block.
 * // Either omit the Instance Template name attribute, specify a partial
 * // name with name_prefix, or use random_id resource. Example:
 * const _default = new gcp.compute.RegionSslCertificate("default", {
 *     region: "us-central1",
 *     namePrefix: "my-certificate-",
 *     privateKey: std.file({
 *         input: "path/to/private.key",
 *     }).then(invoke => invoke.result),
 *     certificate: std.file({
 *         input: "path/to/certificate.crt",
 *     }).then(invoke => invoke.result),
 * });
 * const defaultRegionHealthCheck = new gcp.compute.RegionHealthCheck("default", {
 *     region: "us-central1",
 *     name: "http-health-check",
 *     httpHealthCheck: {
 *         port: 80,
 *     },
 * });
 * const defaultRegionBackendService = new gcp.compute.RegionBackendService("default", {
 *     region: "us-central1",
 *     name: "backend-service",
 *     protocol: "HTTP",
 *     loadBalancingScheme: "INTERNAL_MANAGED",
 *     timeoutSec: 10,
 *     healthChecks: defaultRegionHealthCheck.id,
 * });
 * const defaultRegionUrlMap = new gcp.compute.RegionUrlMap("default", {
 *     region: "us-central1",
 *     name: "url-map",
 *     description: "a description",
 *     defaultService: defaultRegionBackendService.id,
 *     hostRules: [{
 *         hosts: ["mysite.com"],
 *         pathMatcher: "allpaths",
 *     }],
 *     pathMatchers: [{
 *         name: "allpaths",
 *         defaultService: defaultRegionBackendService.id,
 *         pathRules: [{
 *             paths: ["/*"],
 *             service: defaultRegionBackendService.id,
 *         }],
 *     }],
 * });
 * const defaultRegionTargetHttpsProxy = new gcp.compute.RegionTargetHttpsProxy("default", {
 *     region: "us-central1",
 *     name: "test-proxy",
 *     urlMap: defaultRegionUrlMap.id,
 *     sslCertificates: [_default.id],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * import pulumi_std as std
 * # Using with Region Target HTTPS Proxies
 * # SSL certificates cannot be updated after creation. In order to apply
 * # the specified configuration, the provider will destroy the existing
 * # resource and create a replacement. To effectively use an SSL
 * # certificate resource with a Target HTTPS Proxy resource, it's
 * # recommended to specify create_before_destroy in a lifecycle block.
 * # Either omit the Instance Template name attribute, specify a partial
 * # name with name_prefix, or use random_id resource. Example:
 * default = gcp.compute.RegionSslCertificate("default",
 *     region="us-central1",
 *     name_prefix="my-certificate-",
 *     private_key=std.file(input="path/to/private.key").result,
 *     certificate=std.file(input="path/to/certificate.crt").result)
 * default_region_health_check = gcp.compute.RegionHealthCheck("default",
 *     region="us-central1",
 *     name="http-health-check",
 *     http_health_check=gcp.compute.RegionHealthCheckHttpHealthCheckArgs(
 *         port=80,
 *     ))
 * default_region_backend_service = gcp.compute.RegionBackendService("default",
 *     region="us-central1",
 *     name="backend-service",
 *     protocol="HTTP",
 *     load_balancing_scheme="INTERNAL_MANAGED",
 *     timeout_sec=10,
 *     health_checks=default_region_health_check.id)
 * default_region_url_map = gcp.compute.RegionUrlMap("default",
 *     region="us-central1",
 *     name="url-map",
 *     description="a description",
 *     default_service=default_region_backend_service.id,
 *     host_rules=[gcp.compute.RegionUrlMapHostRuleArgs(
 *         hosts=["mysite.com"],
 *         path_matcher="allpaths",
 *     )],
 *     path_matchers=[gcp.compute.RegionUrlMapPathMatcherArgs(
 *         name="allpaths",
 *         default_service=default_region_backend_service.id,
 *         path_rules=[gcp.compute.RegionUrlMapPathMatcherPathRuleArgs(
 *             paths=["/*"],
 *             service=default_region_backend_service.id,
 *         )],
 *     )])
 * default_region_target_https_proxy = gcp.compute.RegionTargetHttpsProxy("default",
 *     region="us-central1",
 *     name="test-proxy",
 *     url_map=default_region_url_map.id,
 *     ssl_certificates=[default.id])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * using Std = Pulumi.Std;
 * return await Deployment.RunAsync(() =>
 * {
 *     // Using with Region Target HTTPS Proxies
 *     //
 *     // SSL certificates cannot be updated after creation. In order to apply
 *     // the specified configuration, the provider will destroy the existing
 *     // resource and create a replacement. To effectively use an SSL
 *     // certificate resource with a Target HTTPS Proxy resource, it's
 *     // recommended to specify create_before_destroy in a lifecycle block.
 *     // Either omit the Instance Template name attribute, specify a partial
 *     // name with name_prefix, or use random_id resource. Example:
 *     var @default = new Gcp.Compute.RegionSslCertificate("default", new()
 *     {
 *         Region = "us-central1",
 *         NamePrefix = "my-certificate-",
 *         PrivateKey = Std.File.Invoke(new()
 *         {
 *             Input = "path/to/private.key",
 *         }).Apply(invoke => invoke.Result),
 *         Certificate = Std.File.Invoke(new()
 *         {
 *             Input = "path/to/certificate.crt",
 *         }).Apply(invoke => invoke.Result),
 *     });
 *     var defaultRegionHealthCheck = new Gcp.Compute.RegionHealthCheck("default", new()
 *     {
 *         Region = "us-central1",
 *         Name = "http-health-check",
 *         HttpHealthCheck = new Gcp.Compute.Inputs.RegionHealthCheckHttpHealthCheckArgs
 *         {
 *             Port = 80,
 *         },
 *     });
 *     var defaultRegionBackendService = new Gcp.Compute.RegionBackendService("default", new()
 *     {
 *         Region = "us-central1",
 *         Name = "backend-service",
 *         Protocol = "HTTP",
 *         LoadBalancingScheme = "INTERNAL_MANAGED",
 *         TimeoutSec = 10,
 *         HealthChecks = defaultRegionHealthCheck.Id,
 *     });
 *     var defaultRegionUrlMap = new Gcp.Compute.RegionUrlMap("default", new()
 *     {
 *         Region = "us-central1",
 *         Name = "url-map",
 *         Description = "a description",
 *         DefaultService = defaultRegionBackendService.Id,
 *         HostRules = new[]
 *         {
 *             new Gcp.Compute.Inputs.RegionUrlMapHostRuleArgs
 *             {
 *                 Hosts = new[]
 *                 {
 *                     "mysite.com",
 *                 },
 *                 PathMatcher = "allpaths",
 *             },
 *         },
 *         PathMatchers = new[]
 *         {
 *             new Gcp.Compute.Inputs.RegionUrlMapPathMatcherArgs
 *             {
 *                 Name = "allpaths",
 *                 DefaultService = defaultRegionBackendService.Id,
 *                 PathRules = new[]
 *                 {
 *                     new Gcp.Compute.Inputs.RegionUrlMapPathMatcherPathRuleArgs
 *                     {
 *                         Paths = new[]
 *                         {
 *                             "/*",
 *                         },
 *                         Service = defaultRegionBackendService.Id,
 *                     },
 *                 },
 *             },
 *         },
 *     });
 *     var defaultRegionTargetHttpsProxy = new Gcp.Compute.RegionTargetHttpsProxy("default", new()
 *     {
 *         Region = "us-central1",
 *         Name = "test-proxy",
 *         UrlMap = defaultRegionUrlMap.Id,
 *         SslCertificates = new[]
 *         {
 *             @default.Id,
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-std/sdk/go/std"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		invokeFile, err := std.File(ctx, &std.FileArgs{
 * 			Input: "path/to/private.key",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeFile1, err := std.File(ctx, &std.FileArgs{
 * 			Input: "path/to/certificate.crt",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		// Using with Region Target HTTPS Proxies
 * 		//
 * 		// SSL certificates cannot be updated after creation. In order to apply
 * 		// the specified configuration, the provider will destroy the existing
 * 		// resource and create a replacement. To effectively use an SSL
 * 		// certificate resource with a Target HTTPS Proxy resource, it's
 * 		// recommended to specify create_before_destroy in a lifecycle block.
 * 		// Either omit the Instance Template name attribute, specify a partial
 * 		// name with name_prefix, or use random_id resource. Example:
 * 		_, err = compute.NewRegionSslCertificate(ctx, "default", &compute.RegionSslCertificateArgs{
 * 			Region:      pulumi.String("us-central1"),
 * 			NamePrefix:  pulumi.String("my-certificate-"),
 * 			PrivateKey:  invokeFile.Result,
 * 			Certificate: invokeFile1.Result,
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultRegionHealthCheck, err := compute.NewRegionHealthCheck(ctx, "default", &compute.RegionHealthCheckArgs{
 * 			Region: pulumi.String("us-central1"),
 * 			Name:   pulumi.String("http-health-check"),
 * 			HttpHealthCheck: &compute.RegionHealthCheckHttpHealthCheckArgs{
 * 				Port: pulumi.Int(80),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultRegionBackendService, err := compute.NewRegionBackendService(ctx, "default", &compute.RegionBackendServiceArgs{
 * 			Region:              pulumi.String("us-central1"),
 * 			Name:                pulumi.String("backend-service"),
 * 			Protocol:            pulumi.String("HTTP"),
 * 			LoadBalancingScheme: pulumi.String("INTERNAL_MANAGED"),
 * 			TimeoutSec:          pulumi.Int(10),
 * 			HealthChecks:        defaultRegionHealthCheck.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultRegionUrlMap, err := compute.NewRegionUrlMap(ctx, "default", &compute.RegionUrlMapArgs{
 * 			Region:         pulumi.String("us-central1"),
 * 			Name:           pulumi.String("url-map"),
 * 			Description:    pulumi.String("a description"),
 * 			DefaultService: defaultRegionBackendService.ID(),
 * 			HostRules: compute.RegionUrlMapHostRuleArray{
 * 				&compute.RegionUrlMapHostRuleArgs{
 * 					Hosts: pulumi.StringArray{
 * 						pulumi.String("mysite.com"),
 * 					},
 * 					PathMatcher: pulumi.String("allpaths"),
 * 				},
 * 			},
 * 			PathMatchers: compute.RegionUrlMapPathMatcherArray{
 * 				&compute.RegionUrlMapPathMatcherArgs{
 * 					Name:           pulumi.String("allpaths"),
 * 					DefaultService: defaultRegionBackendService.ID(),
 * 					PathRules: compute.RegionUrlMapPathMatcherPathRuleArray{
 * 						&compute.RegionUrlMapPathMatcherPathRuleArgs{
 * 							Paths: pulumi.StringArray{
 * 								pulumi.String("/*"),
 * 							},
 * 							Service: defaultRegionBackendService.ID(),
 * 						},
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewRegionTargetHttpsProxy(ctx, "default", &compute.RegionTargetHttpsProxyArgs{
 * 			Region: pulumi.String("us-central1"),
 * 			Name:   pulumi.String("test-proxy"),
 * 			UrlMap: defaultRegionUrlMap.ID(),
 * 			SslCertificates: pulumi.StringArray{
 * 				_default.ID(),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.compute.RegionSslCertificate;
 * import com.pulumi.gcp.compute.RegionSslCertificateArgs;
 * import com.pulumi.gcp.compute.RegionHealthCheck;
 * import com.pulumi.gcp.compute.RegionHealthCheckArgs;
 * import com.pulumi.gcp.compute.inputs.RegionHealthCheckHttpHealthCheckArgs;
 * import com.pulumi.gcp.compute.RegionBackendService;
 * import com.pulumi.gcp.compute.RegionBackendServiceArgs;
 * import com.pulumi.gcp.compute.RegionUrlMap;
 * import com.pulumi.gcp.compute.RegionUrlMapArgs;
 * import com.pulumi.gcp.compute.inputs.RegionUrlMapHostRuleArgs;
 * import com.pulumi.gcp.compute.inputs.RegionUrlMapPathMatcherArgs;
 * import com.pulumi.gcp.compute.RegionTargetHttpsProxy;
 * import com.pulumi.gcp.compute.RegionTargetHttpsProxyArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * 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) {
 *         // Using with Region Target HTTPS Proxies
 *         //
 *         // SSL certificates cannot be updated after creation. In order to apply
 *         // the specified configuration, the provider will destroy the existing
 *         // resource and create a replacement. To effectively use an SSL
 *         // certificate resource with a Target HTTPS Proxy resource, it's
 *         // recommended to specify create_before_destroy in a lifecycle block.
 *         // Either omit the Instance Template name attribute, specify a partial
 *         // name with name_prefix, or use random_id resource. Example:
 *         var default_ = new RegionSslCertificate("default", RegionSslCertificateArgs.builder()
 *             .region("us-central1")
 *             .namePrefix("my-certificate-")
 *             .privateKey(StdFunctions.file(FileArgs.builder()
 *                 .input("path/to/private.key")
 *                 .build()).result())
 *             .certificate(StdFunctions.file(FileArgs.builder()
 *                 .input("path/to/certificate.crt")
 *                 .build()).result())
 *             .build());
 *         var defaultRegionHealthCheck = new RegionHealthCheck("defaultRegionHealthCheck", RegionHealthCheckArgs.builder()
 *             .region("us-central1")
 *             .name("http-health-check")
 *             .httpHealthCheck(RegionHealthCheckHttpHealthCheckArgs.builder()
 *                 .port(80)
 *                 .build())
 *             .build());
 *         var defaultRegionBackendService = new RegionBackendService("defaultRegionBackendService", RegionBackendServiceArgs.builder()
 *             .region("us-central1")
 *             .name("backend-service")
 *             .protocol("HTTP")
 *             .loadBalancingScheme("INTERNAL_MANAGED")
 *             .timeoutSec(10)
 *             .healthChecks(defaultRegionHealthCheck.id())
 *             .build());
 *         var defaultRegionUrlMap = new RegionUrlMap("defaultRegionUrlMap", RegionUrlMapArgs.builder()
 *             .region("us-central1")
 *             .name("url-map")
 *             .description("a description")
 *             .defaultService(defaultRegionBackendService.id())
 *             .hostRules(RegionUrlMapHostRuleArgs.builder()
 *                 .hosts("mysite.com")
 *                 .pathMatcher("allpaths")
 *                 .build())
 *             .pathMatchers(RegionUrlMapPathMatcherArgs.builder()
 *                 .name("allpaths")
 *                 .defaultService(defaultRegionBackendService.id())
 *                 .pathRules(RegionUrlMapPathMatcherPathRuleArgs.builder()
 *                     .paths("/*")
 *                     .service(defaultRegionBackendService.id())
 *                     .build())
 *                 .build())
 *             .build());
 *         var defaultRegionTargetHttpsProxy = new RegionTargetHttpsProxy("defaultRegionTargetHttpsProxy", RegionTargetHttpsProxyArgs.builder()
 *             .region("us-central1")
 *             .name("test-proxy")
 *             .urlMap(defaultRegionUrlMap.id())
 *             .sslCertificates(default_.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   # Using with Region Target HTTPS Proxies
 *   # //
 *   # // SSL certificates cannot be updated after creation. In order to apply
 *   # // the specified configuration, the provider will destroy the existing
 *   # // resource and create a replacement. To effectively use an SSL
 *   # // certificate resource with a Target HTTPS Proxy resource, it's
 *   # // recommended to specify create_before_destroy in a lifecycle block.
 *   # // Either omit the Instance Template name attribute, specify a partial
 *   # // name with name_prefix, or use random_id resource. Example:
 *   default:
 *     type: gcp:compute:RegionSslCertificate
 *     properties:
 *       region: us-central1
 *       namePrefix: my-certificate-
 *       privateKey:
 *         fn::invoke:
 *           Function: std:file
 *           Arguments:
 *             input: path/to/private.key
 *           Return: result
 *       certificate:
 *         fn::invoke:
 *           Function: std:file
 *           Arguments:
 *             input: path/to/certificate.crt
 *           Return: result
 *   defaultRegionTargetHttpsProxy:
 *     type: gcp:compute:RegionTargetHttpsProxy
 *     name: default
 *     properties:
 *       region: us-central1
 *       name: test-proxy
 *       urlMap: ${defaultRegionUrlMap.id}
 *       sslCertificates:
 *         - ${default.id}
 *   defaultRegionUrlMap:
 *     type: gcp:compute:RegionUrlMap
 *     name: default
 *     properties:
 *       region: us-central1
 *       name: url-map
 *       description: a description
 *       defaultService: ${defaultRegionBackendService.id}
 *       hostRules:
 *         - hosts:
 *             - mysite.com
 *           pathMatcher: allpaths
 *       pathMatchers:
 *         - name: allpaths
 *           defaultService: ${defaultRegionBackendService.id}
 *           pathRules:
 *             - paths:
 *                 - /*
 *               service: ${defaultRegionBackendService.id}
 *   defaultRegionBackendService:
 *     type: gcp:compute:RegionBackendService
 *     name: default
 *     properties:
 *       region: us-central1
 *       name: backend-service
 *       protocol: HTTP
 *       loadBalancingScheme: INTERNAL_MANAGED
 *       timeoutSec: 10
 *       healthChecks: ${defaultRegionHealthCheck.id}
 *   defaultRegionHealthCheck:
 *     type: gcp:compute:RegionHealthCheck
 *     name: default
 *     properties:
 *       region: us-central1
 *       name: http-health-check
 *       httpHealthCheck:
 *         port: 80
 * ```
 * 
 * ## Import
 * RegionSslCertificate can be imported using any of these accepted formats:
 * * `projects/{{project}}/regions/{{region}}/sslCertificates/{{name}}`
 * * `{{project}}/{{region}}/{{name}}`
 * * `{{region}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, RegionSslCertificate can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:compute/regionSslCertificate:RegionSslCertificate default projects/{{project}}/regions/{{region}}/sslCertificates/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/regionSslCertificate:RegionSslCertificate default {{project}}/{{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/regionSslCertificate:RegionSslCertificate default {{region}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:compute/regionSslCertificate:RegionSslCertificate default {{name}}
 * ```
 * @property certificate The certificate in PEM format.
 * The certificate chain must be no greater than 5 certs long.
 * The chain must include at least one intermediate cert.
 * **Note**: This property is sensitive and will not be displayed in the plan.
 * @property description An optional description of this resource.
 * @property name 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.
 * These are in the same namespace as the managed SSL certificates.
 * @property namePrefix Creates a unique name beginning with the
 * specified prefix. Conflicts with `name`.
 * @property privateKey The write-only private key in PEM format.
 * **Note**: This property is sensitive and will not be displayed in the plan.
 * - - -
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 * @property region The Region in which the created regional ssl certificate should reside.
 * If it is not provided, the provider region is used.
 * */*/*/*/*/*/
 */
public data class RegionSslCertificateArgs(
    public val certificate: Output? = null,
    public val description: Output? = null,
    public val name: Output? = null,
    public val namePrefix: Output? = null,
    public val privateKey: Output? = null,
    public val project: Output? = null,
    public val region: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.compute.RegionSslCertificateArgs =
        com.pulumi.gcp.compute.RegionSslCertificateArgs.builder()
            .certificate(certificate?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .namePrefix(namePrefix?.applyValue({ args0 -> args0 }))
            .privateKey(privateKey?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .region(region?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [RegionSslCertificateArgs].
 */
@PulumiTagMarker
public class RegionSslCertificateArgsBuilder internal constructor() {
    private var certificate: Output? = null

    private var description: Output? = null

    private var name: Output? = null

    private var namePrefix: Output? = null

    private var privateKey: Output? = null

    private var project: Output? = null

    private var region: Output? = null

    /**
     * @param value The certificate in PEM format.
     * The certificate chain must be no greater than 5 certs long.
     * The chain must include at least one intermediate cert.
     * **Note**: This property is sensitive and will not be displayed in the plan.
     */
    @JvmName("uccknkgdqxtsejbl")
    public suspend fun certificate(`value`: Output) {
        this.certificate = value
    }

    /**
     * @param value An optional description of this resource.
     */
    @JvmName("ycpccrkwufvmmicc")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value 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.
     * These are in the same namespace as the managed SSL certificates.
     */
    @JvmName("tvsxqmtnlldslsja")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Creates a unique name beginning with the
     * specified prefix. Conflicts with `name`.
     */
    @JvmName("cnfoqytwhgfnchrs")
    public suspend fun namePrefix(`value`: Output) {
        this.namePrefix = value
    }

    /**
     * @param value The write-only private key in PEM format.
     * **Note**: This property is sensitive and will not be displayed in the plan.
     * - - -
     */
    @JvmName("kufcbvkaymkujoxw")
    public suspend fun privateKey(`value`: Output) {
        this.privateKey = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("vfyabigqsplhxedq")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value The Region in which the created regional ssl certificate should reside.
     * If it is not provided, the provider region is used.
     */
    @JvmName("wteypooxbsmgkltd")
    public suspend fun region(`value`: Output) {
        this.region = value
    }

    /**
     * @param value The certificate in PEM format.
     * The certificate chain must be no greater than 5 certs long.
     * The chain must include at least one intermediate cert.
     * **Note**: This property is sensitive and will not be displayed in the plan.
     */
    @JvmName("ahfccojerriwnryo")
    public suspend fun certificate(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.certificate = mapped
    }

    /**
     * @param value An optional description of this resource.
     */
    @JvmName("kfqsdgfdkxvuslpc")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value 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.
     * These are in the same namespace as the managed SSL certificates.
     */
    @JvmName("phxsejpbtrjytwai")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Creates a unique name beginning with the
     * specified prefix. Conflicts with `name`.
     */
    @JvmName("oxwhsaxvyqaieeue")
    public suspend fun namePrefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.namePrefix = mapped
    }

    /**
     * @param value The write-only private key in PEM format.
     * **Note**: This property is sensitive and will not be displayed in the plan.
     * - - -
     */
    @JvmName("lyflcacptaabsnoa")
    public suspend fun privateKey(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.privateKey = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("gkycatheromcjtoj")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value The Region in which the created regional ssl certificate should reside.
     * If it is not provided, the provider region is used.
     */
    @JvmName("ocqgunmkaixvhios")
    public suspend fun region(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.region = mapped
    }

    internal fun build(): RegionSslCertificateArgs = RegionSslCertificateArgs(
        certificate = certificate,
        description = description,
        name = name,
        namePrefix = namePrefix,
        privateKey = privateKey,
        project = project,
        region = region,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy