ProjectMetadataArgs

data class ProjectMetadataArgs(val metadata: Output<Map<String, String>>? = null, val project: Output<String>? = null) : ConvertibleToJava<ProjectMetadataArgs>

Authoritatively manages metadata common to all instances for a project in GCE. For more information see the official documentation and API.

Note: This resource manages all project-level metadata including project-level ssh keys. Keys unset in config but set on the server will be removed. If you want to manage only single key/value pairs within the project metadata rather than the entire set, then use google_compute_project_metadata_item.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ProjectMetadata;
import com.pulumi.gcp.compute.ProjectMetadataArgs;
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 ProjectMetadata("default", ProjectMetadataArgs.builder()
.metadata(Map.ofEntries(
Map.entry("13", "42"),
Map.entry("fizz", "buzz"),
Map.entry("foo", "bar")
))
.build());
}
}

Adding An SSH Key

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ProjectMetadata;
import com.pulumi.gcp.compute.ProjectMetadataArgs;
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 mySshKey = new ProjectMetadata("mySshKey", ProjectMetadataArgs.builder()
.metadata(Map.of("ssh-keys", """
dev:ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILg6UtHDNyMNAh0GjaytsJdrUxjtLy3APXqZfNZhvCeT dev
foo:ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILg6UtHDNyMNAh0GjaytsJdrUxjtLy3APXqZfNZhvCeT bar
"""))
.build());
}
}

Import

This resource can be imported using the project ID

$ pulumi import gcp:compute/projectMetadata:ProjectMetadata foo my-project-id`

Constructors

Link copied to clipboard
constructor(metadata: Output<Map<String, String>>? = null, project: Output<String>? = null)

Properties

Link copied to clipboard
val metadata: Output<Map<String, String>>? = null

A series of key value pairs.

Link copied to clipboard
val project: Output<String>? = null

The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

Functions

Link copied to clipboard
open override fun toJava(): ProjectMetadataArgs