com.pulumi.gcp.networkservices.kotlin.EdgeCacheKeyset.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.networkservices.kotlin
import com.pulumi.core.Output
import com.pulumi.gcp.networkservices.kotlin.outputs.EdgeCacheKeysetPublicKey
import com.pulumi.gcp.networkservices.kotlin.outputs.EdgeCacheKeysetValidationSharedKey
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.gcp.networkservices.kotlin.outputs.EdgeCacheKeysetPublicKey.Companion.toKotlin as edgeCacheKeysetPublicKeyToKotlin
import com.pulumi.gcp.networkservices.kotlin.outputs.EdgeCacheKeysetValidationSharedKey.Companion.toKotlin as edgeCacheKeysetValidationSharedKeyToKotlin
/**
* Builder for [EdgeCacheKeyset].
*/
@PulumiTagMarker
public class EdgeCacheKeysetResourceBuilder internal constructor() {
public var name: String? = null
public var args: EdgeCacheKeysetArgs = EdgeCacheKeysetArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend EdgeCacheKeysetArgsBuilder.() -> Unit) {
val builder = EdgeCacheKeysetArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): EdgeCacheKeyset {
val builtJavaResource = com.pulumi.gcp.networkservices.EdgeCacheKeyset(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return EdgeCacheKeyset(builtJavaResource)
}
}
/**
* EdgeCacheKeyset represents a collection of public keys used for validating signed requests.
* To get more information about EdgeCacheKeyset, see:
* * [API documentation](https://cloud.google.com/media-cdn/docs/reference/rest/v1/projects.locations.edgeCacheKeysets)
* * How-to Guides
* * [Create keysets](https://cloud.google.com/media-cdn/docs/create-keyset)
* ## Example Usage
* ### Network Services Edge Cache Keyset Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.networkservices.EdgeCacheKeyset("default", {
* name: "my-keyset",
* description: "The default keyset",
* publicKeys: [
* {
* id: "my-public-key",
* value: "FHsTyFHNmvNpw4o7-rp-M1yqMyBF8vXSBRkZtkQ0RKY",
* },
* {
* id: "my-public-key-2",
* value: "hzd03llxB1u5FOLKFkZ6_wCJqC7jtN0bg7xlBqS6WVM",
* },
* ],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.networkservices.EdgeCacheKeyset("default",
* name="my-keyset",
* description="The default keyset",
* public_keys=[
* gcp.networkservices.EdgeCacheKeysetPublicKeyArgs(
* id="my-public-key",
* value="FHsTyFHNmvNpw4o7-rp-M1yqMyBF8vXSBRkZtkQ0RKY",
* ),
* gcp.networkservices.EdgeCacheKeysetPublicKeyArgs(
* id="my-public-key-2",
* value="hzd03llxB1u5FOLKFkZ6_wCJqC7jtN0bg7xlBqS6WVM",
* ),
* ])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.NetworkServices.EdgeCacheKeyset("default", new()
* {
* Name = "my-keyset",
* Description = "The default keyset",
* PublicKeys = new[]
* {
* new Gcp.NetworkServices.Inputs.EdgeCacheKeysetPublicKeyArgs
* {
* Id = "my-public-key",
* Value = "FHsTyFHNmvNpw4o7-rp-M1yqMyBF8vXSBRkZtkQ0RKY",
* },
* new Gcp.NetworkServices.Inputs.EdgeCacheKeysetPublicKeyArgs
* {
* Id = "my-public-key-2",
* Value = "hzd03llxB1u5FOLKFkZ6_wCJqC7jtN0bg7xlBqS6WVM",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkservices"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := networkservices.NewEdgeCacheKeyset(ctx, "default", &networkservices.EdgeCacheKeysetArgs{
* Name: pulumi.String("my-keyset"),
* Description: pulumi.String("The default keyset"),
* PublicKeys: networkservices.EdgeCacheKeysetPublicKeyArray{
* &networkservices.EdgeCacheKeysetPublicKeyArgs{
* Id: pulumi.String("my-public-key"),
* Value: pulumi.String("FHsTyFHNmvNpw4o7-rp-M1yqMyBF8vXSBRkZtkQ0RKY"),
* },
* &networkservices.EdgeCacheKeysetPublicKeyArgs{
* Id: pulumi.String("my-public-key-2"),
* Value: pulumi.String("hzd03llxB1u5FOLKFkZ6_wCJqC7jtN0bg7xlBqS6WVM"),
* },
* },
* })
* 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.networkservices.EdgeCacheKeyset;
* import com.pulumi.gcp.networkservices.EdgeCacheKeysetArgs;
* import com.pulumi.gcp.networkservices.inputs.EdgeCacheKeysetPublicKeyArgs;
* 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 EdgeCacheKeyset("default", EdgeCacheKeysetArgs.builder()
* .name("my-keyset")
* .description("The default keyset")
* .publicKeys(
* EdgeCacheKeysetPublicKeyArgs.builder()
* .id("my-public-key")
* .value("FHsTyFHNmvNpw4o7-rp-M1yqMyBF8vXSBRkZtkQ0RKY")
* .build(),
* EdgeCacheKeysetPublicKeyArgs.builder()
* .id("my-public-key-2")
* .value("hzd03llxB1u5FOLKFkZ6_wCJqC7jtN0bg7xlBqS6WVM")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:networkservices:EdgeCacheKeyset
* properties:
* name: my-keyset
* description: The default keyset
* publicKeys:
* - id: my-public-key
* value: FHsTyFHNmvNpw4o7-rp-M1yqMyBF8vXSBRkZtkQ0RKY
* - id: my-public-key-2
* value: hzd03llxB1u5FOLKFkZ6_wCJqC7jtN0bg7xlBqS6WVM
* ```
*
* ### Network Services Edge Cache Keyset Dual Token
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const secret_basic = new gcp.secretmanager.Secret("secret-basic", {
* secretId: "secret-name",
* replication: {
* auto: {},
* },
* });
* const secret_version_basic = new gcp.secretmanager.SecretVersion("secret-version-basic", {
* secret: secret_basic.id,
* secretData: "secret-data",
* });
* const _default = new gcp.networkservices.EdgeCacheKeyset("default", {
* name: "my-keyset",
* description: "The default keyset",
* publicKeys: [{
* id: "my-public-key",
* managed: true,
* }],
* validationSharedKeys: [{
* secretVersion: secret_version_basic.id,
* }],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* secret_basic = gcp.secretmanager.Secret("secret-basic",
* secret_id="secret-name",
* replication=gcp.secretmanager.SecretReplicationArgs(
* auto=gcp.secretmanager.SecretReplicationAutoArgs(),
* ))
* secret_version_basic = gcp.secretmanager.SecretVersion("secret-version-basic",
* secret=secret_basic.id,
* secret_data="secret-data")
* default = gcp.networkservices.EdgeCacheKeyset("default",
* name="my-keyset",
* description="The default keyset",
* public_keys=[gcp.networkservices.EdgeCacheKeysetPublicKeyArgs(
* id="my-public-key",
* managed=True,
* )],
* validation_shared_keys=[gcp.networkservices.EdgeCacheKeysetValidationSharedKeyArgs(
* secret_version=secret_version_basic.id,
* )])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var secret_basic = new Gcp.SecretManager.Secret("secret-basic", new()
* {
* SecretId = "secret-name",
* Replication = new Gcp.SecretManager.Inputs.SecretReplicationArgs
* {
* Auto = null,
* },
* });
* var secret_version_basic = new Gcp.SecretManager.SecretVersion("secret-version-basic", new()
* {
* Secret = secret_basic.Id,
* SecretData = "secret-data",
* });
* var @default = new Gcp.NetworkServices.EdgeCacheKeyset("default", new()
* {
* Name = "my-keyset",
* Description = "The default keyset",
* PublicKeys = new[]
* {
* new Gcp.NetworkServices.Inputs.EdgeCacheKeysetPublicKeyArgs
* {
* Id = "my-public-key",
* Managed = true,
* },
* },
* ValidationSharedKeys = new[]
* {
* new Gcp.NetworkServices.Inputs.EdgeCacheKeysetValidationSharedKeyArgs
* {
* SecretVersion = secret_version_basic.Id,
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkservices"
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/secretmanager"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := secretmanager.NewSecret(ctx, "secret-basic", &secretmanager.SecretArgs{
* SecretId: pulumi.String("secret-name"),
* Replication: &secretmanager.SecretReplicationArgs{
* Auto: nil,
* },
* })
* if err != nil {
* return err
* }
* _, err = secretmanager.NewSecretVersion(ctx, "secret-version-basic", &secretmanager.SecretVersionArgs{
* Secret: secret_basic.ID(),
* SecretData: pulumi.String("secret-data"),
* })
* if err != nil {
* return err
* }
* _, err = networkservices.NewEdgeCacheKeyset(ctx, "default", &networkservices.EdgeCacheKeysetArgs{
* Name: pulumi.String("my-keyset"),
* Description: pulumi.String("The default keyset"),
* PublicKeys: networkservices.EdgeCacheKeysetPublicKeyArray{
* &networkservices.EdgeCacheKeysetPublicKeyArgs{
* Id: pulumi.String("my-public-key"),
* Managed: pulumi.Bool(true),
* },
* },
* ValidationSharedKeys: networkservices.EdgeCacheKeysetValidationSharedKeyArray{
* &networkservices.EdgeCacheKeysetValidationSharedKeyArgs{
* SecretVersion: secret_version_basic.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.secretmanager.Secret;
* import com.pulumi.gcp.secretmanager.SecretArgs;
* import com.pulumi.gcp.secretmanager.inputs.SecretReplicationArgs;
* import com.pulumi.gcp.secretmanager.inputs.SecretReplicationAutoArgs;
* import com.pulumi.gcp.secretmanager.SecretVersion;
* import com.pulumi.gcp.secretmanager.SecretVersionArgs;
* import com.pulumi.gcp.networkservices.EdgeCacheKeyset;
* import com.pulumi.gcp.networkservices.EdgeCacheKeysetArgs;
* import com.pulumi.gcp.networkservices.inputs.EdgeCacheKeysetPublicKeyArgs;
* import com.pulumi.gcp.networkservices.inputs.EdgeCacheKeysetValidationSharedKeyArgs;
* 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 secret_basic = new Secret("secret-basic", SecretArgs.builder()
* .secretId("secret-name")
* .replication(SecretReplicationArgs.builder()
* .auto()
* .build())
* .build());
* var secret_version_basic = new SecretVersion("secret-version-basic", SecretVersionArgs.builder()
* .secret(secret_basic.id())
* .secretData("secret-data")
* .build());
* var default_ = new EdgeCacheKeyset("default", EdgeCacheKeysetArgs.builder()
* .name("my-keyset")
* .description("The default keyset")
* .publicKeys(EdgeCacheKeysetPublicKeyArgs.builder()
* .id("my-public-key")
* .managed(true)
* .build())
* .validationSharedKeys(EdgeCacheKeysetValidationSharedKeyArgs.builder()
* .secretVersion(secret_version_basic.id())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* secret-basic:
* type: gcp:secretmanager:Secret
* properties:
* secretId: secret-name
* replication:
* auto: {}
* secret-version-basic:
* type: gcp:secretmanager:SecretVersion
* properties:
* secret: ${["secret-basic"].id}
* secretData: secret-data
* default:
* type: gcp:networkservices:EdgeCacheKeyset
* properties:
* name: my-keyset
* description: The default keyset
* publicKeys:
* - id: my-public-key
* managed: true
* validationSharedKeys:
* - secretVersion: ${["secret-version-basic"].id}
* ```
*
* ## Import
* EdgeCacheKeyset can be imported using any of these accepted formats:
* * `projects/{{project}}/locations/global/edgeCacheKeysets/{{name}}`
* * `{{project}}/{{name}}`
* * `{{name}}`
* When using the `pulumi import` command, EdgeCacheKeyset can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:networkservices/edgeCacheKeyset:EdgeCacheKeyset default projects/{{project}}/locations/global/edgeCacheKeysets/{{name}}
* ```
* ```sh
* $ pulumi import gcp:networkservices/edgeCacheKeyset:EdgeCacheKeyset default {{project}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:networkservices/edgeCacheKeyset:EdgeCacheKeyset default {{name}}
* ```
*/
public class EdgeCacheKeyset internal constructor(
override val javaResource: com.pulumi.gcp.networkservices.EdgeCacheKeyset,
) : KotlinCustomResource(javaResource, EdgeCacheKeysetMapper) {
/**
* A human-readable description of the resource.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
public val effectiveLabels: Output
© 2015 - 2024 Weber Informatics LLC | Privacy Policy