gcp.kms.KeyRing
Explore with Pulumi AI
A KeyRing
is a toplevel logical grouping of CryptoKeys
.
Note: KeyRings cannot be deleted from Google Cloud Platform. Destroying a provider-managed KeyRing will remove it from state but will not delete the resource from the project.
To get more information about KeyRing, see:
- API documentation
- How-to Guides
Example Usage
Kms Key Ring Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const example_keyring = new gcp.kms.KeyRing("example-keyring", {
name: "keyring-example",
location: "global",
});
import pulumi
import pulumi_gcp as gcp
example_keyring = gcp.kms.KeyRing("example-keyring",
name="keyring-example",
location="global")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/kms"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := kms.NewKeyRing(ctx, "example-keyring", &kms.KeyRingArgs{
Name: pulumi.String("keyring-example"),
Location: pulumi.String("global"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var example_keyring = new Gcp.Kms.KeyRing("example-keyring", new()
{
Name = "keyring-example",
Location = "global",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.kms.KeyRing;
import com.pulumi.gcp.kms.KeyRingArgs;
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 example_keyring = new KeyRing("example-keyring", KeyRingArgs.builder()
.name("keyring-example")
.location("global")
.build());
}
}
resources:
example-keyring:
type: gcp:kms:KeyRing
properties:
name: keyring-example
location: global
Create KeyRing Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new KeyRing(name: string, args: KeyRingArgs, opts?: CustomResourceOptions);
@overload
def KeyRing(resource_name: str,
args: KeyRingArgs,
opts: Optional[ResourceOptions] = None)
@overload
def KeyRing(resource_name: str,
opts: Optional[ResourceOptions] = None,
location: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None)
func NewKeyRing(ctx *Context, name string, args KeyRingArgs, opts ...ResourceOption) (*KeyRing, error)
public KeyRing(string name, KeyRingArgs args, CustomResourceOptions? opts = null)
public KeyRing(String name, KeyRingArgs args)
public KeyRing(String name, KeyRingArgs args, CustomResourceOptions options)
type: gcp:kms:KeyRing
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args KeyRingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args KeyRingArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args KeyRingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args KeyRingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args KeyRingArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var keyRingResource = new Gcp.Kms.KeyRing("keyRingResource", new()
{
Location = "string",
Name = "string",
Project = "string",
});
example, err := kms.NewKeyRing(ctx, "keyRingResource", &kms.KeyRingArgs{
Location: pulumi.String("string"),
Name: pulumi.String("string"),
Project: pulumi.String("string"),
})
var keyRingResource = new KeyRing("keyRingResource", KeyRingArgs.builder()
.location("string")
.name("string")
.project("string")
.build());
key_ring_resource = gcp.kms.KeyRing("keyRingResource",
location="string",
name="string",
project="string")
const keyRingResource = new gcp.kms.KeyRing("keyRingResource", {
location: "string",
name: "string",
project: "string",
});
type: gcp:kms:KeyRing
properties:
location: string
name: string
project: string
KeyRing Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The KeyRing resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the KeyRing resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing KeyRing Resource
Get an existing KeyRing resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: KeyRingState, opts?: CustomResourceOptions): KeyRing
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
location: Optional[str] = None,
name: Optional[str] = None,
project: Optional[str] = None) -> KeyRing
func GetKeyRing(ctx *Context, name string, id IDInput, state *KeyRingState, opts ...ResourceOption) (*KeyRing, error)
public static KeyRing Get(string name, Input<string> id, KeyRingState? state, CustomResourceOptions? opts = null)
public static KeyRing get(String name, Output<String> id, KeyRingState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
Import
KeyRing can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/keyRings/{{name}}
{{project}}/{{location}}/{{name}}
{{location}}/{{name}}
When using the pulumi import
command, KeyRing can be imported using one of the formats above. For example:
$ pulumi import gcp:kms/keyRing:KeyRing default projects/{{project}}/locations/{{location}}/keyRings/{{name}}
$ pulumi import gcp:kms/keyRing:KeyRing default {{project}}/{{location}}/{{name}}
$ pulumi import gcp:kms/keyRing:KeyRing default {{location}}/{{name}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.