1. Packages
  2. Volcengine
  3. API Docs
  4. kms
  5. KeyPrimaryRegion
Volcengine v0.0.46 published on Friday, Feb 27, 2026 by Volcengine
volcengine logo
Volcengine v0.0.46 published on Friday, Feb 27, 2026 by Volcengine

    Provides a resource to manage kms key primary region

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@volcengine/pulumi";
    
    const primary = new volcengine.kms.KeyPrimaryRegion("primary", {
        keyName: "mrk-Tf-test",
        keyringName: "test",
        primaryRegion: "cn-shanghai",
    });
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    primary = volcengine.kms.KeyPrimaryRegion("primary",
        key_name="mrk-Tf-test",
        keyring_name="test",
        primary_region="cn-shanghai")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/kms"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := kms.NewKeyPrimaryRegion(ctx, "primary", &kms.KeyPrimaryRegionArgs{
    			KeyName:       pulumi.String("mrk-Tf-test"),
    			KeyringName:   pulumi.String("test"),
    			PrimaryRegion: pulumi.String("cn-shanghai"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var primary = new Volcengine.Kms.KeyPrimaryRegion("primary", new()
        {
            KeyName = "mrk-Tf-test",
            KeyringName = "test",
            PrimaryRegion = "cn-shanghai",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.kms.KeyPrimaryRegion;
    import com.pulumi.volcengine.kms.KeyPrimaryRegionArgs;
    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 primary = new KeyPrimaryRegion("primary", KeyPrimaryRegionArgs.builder()        
                .keyName("mrk-Tf-test")
                .keyringName("test")
                .primaryRegion("cn-shanghai")
                .build());
    
        }
    }
    
    resources:
      primary:
        type: volcengine:kms:KeyPrimaryRegion
        properties:
          keyName: mrk-Tf-test
          keyringName: test
          # Note: The primary region is switched from cn-beijing to cn-shanghai, so cn-beijing will become a replica key 
          #     // and will no longer support operations such as key rotation and switching the primary region.
          #     // To continue operating on the key, need to switch the region to cn-shanghai.
          primaryRegion: cn-shanghai
    

    Create KeyPrimaryRegion Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new KeyPrimaryRegion(name: string, args: KeyPrimaryRegionArgs, opts?: CustomResourceOptions);
    @overload
    def KeyPrimaryRegion(resource_name: str,
                         args: KeyPrimaryRegionArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def KeyPrimaryRegion(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         primary_region: Optional[str] = None,
                         key_id: Optional[str] = None,
                         key_name: Optional[str] = None,
                         keyring_name: Optional[str] = None)
    func NewKeyPrimaryRegion(ctx *Context, name string, args KeyPrimaryRegionArgs, opts ...ResourceOption) (*KeyPrimaryRegion, error)
    public KeyPrimaryRegion(string name, KeyPrimaryRegionArgs args, CustomResourceOptions? opts = null)
    public KeyPrimaryRegion(String name, KeyPrimaryRegionArgs args)
    public KeyPrimaryRegion(String name, KeyPrimaryRegionArgs args, CustomResourceOptions options)
    
    type: volcengine:kms:KeyPrimaryRegion
    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 KeyPrimaryRegionArgs
    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 KeyPrimaryRegionArgs
    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 KeyPrimaryRegionArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args KeyPrimaryRegionArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args KeyPrimaryRegionArgs
    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 keyPrimaryRegionResource = new Volcengine.Kms.KeyPrimaryRegion("keyPrimaryRegionResource", new()
    {
        PrimaryRegion = "string",
        KeyId = "string",
        KeyName = "string",
        KeyringName = "string",
    });
    
    example, err := kms.NewKeyPrimaryRegion(ctx, "keyPrimaryRegionResource", &kms.KeyPrimaryRegionArgs{
    	PrimaryRegion: pulumi.String("string"),
    	KeyId:         pulumi.String("string"),
    	KeyName:       pulumi.String("string"),
    	KeyringName:   pulumi.String("string"),
    })
    
    var keyPrimaryRegionResource = new KeyPrimaryRegion("keyPrimaryRegionResource", KeyPrimaryRegionArgs.builder()
        .primaryRegion("string")
        .keyId("string")
        .keyName("string")
        .keyringName("string")
        .build());
    
    key_primary_region_resource = volcengine.kms.KeyPrimaryRegion("keyPrimaryRegionResource",
        primary_region="string",
        key_id="string",
        key_name="string",
        keyring_name="string")
    
    const keyPrimaryRegionResource = new volcengine.kms.KeyPrimaryRegion("keyPrimaryRegionResource", {
        primaryRegion: "string",
        keyId: "string",
        keyName: "string",
        keyringName: "string",
    });
    
    type: volcengine:kms:KeyPrimaryRegion
    properties:
        keyId: string
        keyName: string
        keyringName: string
        primaryRegion: string
    

    KeyPrimaryRegion 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 KeyPrimaryRegion resource accepts the following input properties:

    PrimaryRegion string
    The new primary region.
    KeyId string
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    KeyName string
    The name of the key. Note: Only multi-region keys support updating primary region.
    KeyringName string
    The name of the keyring.
    PrimaryRegion string
    The new primary region.
    KeyId string
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    KeyName string
    The name of the key. Note: Only multi-region keys support updating primary region.
    KeyringName string
    The name of the keyring.
    primaryRegion String
    The new primary region.
    keyId String
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    keyName String
    The name of the key. Note: Only multi-region keys support updating primary region.
    keyringName String
    The name of the keyring.
    primaryRegion string
    The new primary region.
    keyId string
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    keyName string
    The name of the key. Note: Only multi-region keys support updating primary region.
    keyringName string
    The name of the keyring.
    primary_region str
    The new primary region.
    key_id str
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    key_name str
    The name of the key. Note: Only multi-region keys support updating primary region.
    keyring_name str
    The name of the keyring.
    primaryRegion String
    The new primary region.
    keyId String
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    keyName String
    The name of the key. Note: Only multi-region keys support updating primary region.
    keyringName String
    The name of the keyring.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the KeyPrimaryRegion 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 KeyPrimaryRegion Resource

    Get an existing KeyPrimaryRegion 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?: KeyPrimaryRegionState, opts?: CustomResourceOptions): KeyPrimaryRegion
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            key_id: Optional[str] = None,
            key_name: Optional[str] = None,
            keyring_name: Optional[str] = None,
            primary_region: Optional[str] = None) -> KeyPrimaryRegion
    func GetKeyPrimaryRegion(ctx *Context, name string, id IDInput, state *KeyPrimaryRegionState, opts ...ResourceOption) (*KeyPrimaryRegion, error)
    public static KeyPrimaryRegion Get(string name, Input<string> id, KeyPrimaryRegionState? state, CustomResourceOptions? opts = null)
    public static KeyPrimaryRegion get(String name, Output<String> id, KeyPrimaryRegionState state, CustomResourceOptions options)
    resources:  _:    type: volcengine:kms:KeyPrimaryRegion    get:      id: ${id}
    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.
    The following state arguments are supported:
    KeyId string
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    KeyName string
    The name of the key. Note: Only multi-region keys support updating primary region.
    KeyringName string
    The name of the keyring.
    PrimaryRegion string
    The new primary region.
    KeyId string
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    KeyName string
    The name of the key. Note: Only multi-region keys support updating primary region.
    KeyringName string
    The name of the keyring.
    PrimaryRegion string
    The new primary region.
    keyId String
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    keyName String
    The name of the key. Note: Only multi-region keys support updating primary region.
    keyringName String
    The name of the keyring.
    primaryRegion String
    The new primary region.
    keyId string
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    keyName string
    The name of the key. Note: Only multi-region keys support updating primary region.
    keyringName string
    The name of the keyring.
    primaryRegion string
    The new primary region.
    key_id str
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    key_name str
    The name of the key. Note: Only multi-region keys support updating primary region.
    keyring_name str
    The name of the keyring.
    primary_region str
    The new primary region.
    keyId String
    The id of the key. When key_id is not specified, both keyring_name and key_name must be specified.
    keyName String
    The name of the key. Note: Only multi-region keys support updating primary region.
    keyringName String
    The name of the keyring.
    primaryRegion String
    The new primary region.

    Import

    KmsKeyPrimaryRegion can be imported using the id, e.g.

    $ pulumi import volcengine:kms/keyPrimaryRegion:KeyPrimaryRegion default key_id
    

    or

    $ pulumi import volcengine:kms/keyPrimaryRegion:KeyPrimaryRegion default key_name:keyring_name
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.46 published on Friday, Feb 27, 2026 by Volcengine
      Meet Neo: Your AI Platform Teammate