com.pulumi.gcp.compute.kotlin.ProjectMetadataItemArgs.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.compute.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.ProjectMetadataItemArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Manages a single key/value pair on metadata common to all instances for
* a project in GCE. Using `gcp.compute.ProjectMetadataItem` lets you
* manage a single key/value setting in the provider rather than the entire
* project metadata map.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.compute.ProjectMetadataItem("default", {
* key: "my_metadata",
* value: "my_value",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.compute.ProjectMetadataItem("default",
* key="my_metadata",
* value="my_value")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.Compute.ProjectMetadataItem("default", new()
* {
* Key = "my_metadata",
* Value = "my_value",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.NewProjectMetadataItem(ctx, "default", &compute.ProjectMetadataItemArgs{
* Key: pulumi.String("my_metadata"),
* Value: pulumi.String("my_value"),
* })
* 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.ProjectMetadataItem;
* import com.pulumi.gcp.compute.ProjectMetadataItemArgs;
* 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 ProjectMetadataItem("default", ProjectMetadataItemArgs.builder()
* .key("my_metadata")
* .value("my_value")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:compute:ProjectMetadataItem
* properties:
* key: my_metadata
* value: my_value
* ```
*
* ## Import
* Project metadata items can be imported using the `key`, e.g.
* * `{{key}}`
* When using the `pulumi import` command, project metadata items can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:compute/projectMetadataItem:ProjectMetadataItem default {{key}}
* ```
* @property key The metadata key to set.
* @property project The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
* @property value The value to set for the given metadata key.
* - - -
*/
public data class ProjectMetadataItemArgs(
public val key: Output? = null,
public val project: Output? = null,
public val `value`: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.compute.ProjectMetadataItemArgs =
com.pulumi.gcp.compute.ProjectMetadataItemArgs.builder()
.key(key?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 }))
.`value`(`value`?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ProjectMetadataItemArgs].
*/
@PulumiTagMarker
public class ProjectMetadataItemArgsBuilder internal constructor() {
private var key: Output? = null
private var project: Output? = null
private var `value`: Output? = null
/**
* @param value The metadata key to set.
*/
@JvmName("kpdnhpildksddyhg")
public suspend fun key(`value`: Output) {
this.key = value
}
/**
* @param value The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
*/
@JvmName("bldmtywyfjslucqe")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value The value to set for the given metadata key.
* - - -
*/
@JvmName("obpgkdjxaasalqtw")
public suspend fun `value`(`value`: Output) {
this.`value` = value
}
/**
* @param value The metadata key to set.
*/
@JvmName("bjqwptdumtsgvvnc")
public suspend fun key(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.key = mapped
}
/**
* @param value The ID of the project in which the resource belongs. If it
* is not provided, the provider project is used.
*/
@JvmName("pvkfslmhvvkeskvw")
public suspend fun project(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.project = mapped
}
/**
* @param value The value to set for the given metadata key.
* - - -
*/
@JvmName("lrtroifebrvplgnw")
public suspend fun `value`(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.`value` = mapped
}
internal fun build(): ProjectMetadataItemArgs = ProjectMetadataItemArgs(
key = key,
project = project,
`value` = `value`,
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy