1. Packages
  2. Scaleway
  3. API Docs
  4. getKeyManagerKey
Scaleway v1.40.0 published on Friday, Dec 19, 2025 by pulumiverse
scaleway logo
Scaleway v1.40.0 published on Friday, Dec 19, 2025 by pulumiverse

    Gets information about a Key Manager Key. For more information, refer to the Key Manager API documentation.

    Example Usage

    Create a key and get its information

    The following commands allow you to:

    • create a key named my-kms-key
    • retrieve the key’s information using the key’s ID
    import * as pulumi from "@pulumi/pulumi";
    import * as scaleway from "@pulumiverse/scaleway";
    
    // Create a key
    const symmetric = new scaleway.KeyManagerKey("symmetric", {
        name: "my-kms-key",
        region: "fr-par",
        projectId: "your-project-id",
        usage: "symmetric_encryption",
        algorithm: "aes_256_gcm",
        description: "Key for encrypting secrets",
        tags: [
            "env:prod",
            "kms",
        ],
        unprotected: true,
        rotationPolicy: {
            rotationPeriod: "720h",
        },
    });
    // Get the key information by its ID
    const byID = scaleway.getKeyManagerKey({
        keyId: "11111111-1111-1111-1111-111111111111",
    });
    
    import pulumi
    import pulumi_scaleway as scaleway
    import pulumiverse_scaleway as scaleway
    
    # Create a key
    symmetric = scaleway.KeyManagerKey("symmetric",
        name="my-kms-key",
        region="fr-par",
        project_id="your-project-id",
        usage="symmetric_encryption",
        algorithm="aes_256_gcm",
        description="Key for encrypting secrets",
        tags=[
            "env:prod",
            "kms",
        ],
        unprotected=True,
        rotation_policy={
            "rotation_period": "720h",
        })
    # Get the key information by its ID
    by_id = scaleway.get_key_manager_key(key_id="11111111-1111-1111-1111-111111111111")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-scaleway/sdk/go/scaleway"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Create a key
    		_, err := scaleway.NewKeyManagerKey(ctx, "symmetric", &scaleway.KeyManagerKeyArgs{
    			Name:        pulumi.String("my-kms-key"),
    			Region:      pulumi.String("fr-par"),
    			ProjectId:   pulumi.String("your-project-id"),
    			Usage:       pulumi.String("symmetric_encryption"),
    			Algorithm:   pulumi.String("aes_256_gcm"),
    			Description: pulumi.String("Key for encrypting secrets"),
    			Tags: pulumi.StringArray{
    				pulumi.String("env:prod"),
    				pulumi.String("kms"),
    			},
    			Unprotected: pulumi.Bool(true),
    			RotationPolicy: &scaleway.KeyManagerKeyRotationPolicyArgs{
    				RotationPeriod: pulumi.String("720h"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		// Get the key information by its ID
    		_, err = scaleway.LookupKeyManagerKey(ctx, &scaleway.LookupKeyManagerKeyArgs{
    			KeyId: "11111111-1111-1111-1111-111111111111",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Scaleway = Pulumi.Scaleway;
    using Scaleway = Pulumiverse.Scaleway;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a key
        var symmetric = new Scaleway.KeyManagerKey("symmetric", new()
        {
            Name = "my-kms-key",
            Region = "fr-par",
            ProjectId = "your-project-id",
            Usage = "symmetric_encryption",
            Algorithm = "aes_256_gcm",
            Description = "Key for encrypting secrets",
            Tags = new[]
            {
                "env:prod",
                "kms",
            },
            Unprotected = true,
            RotationPolicy = new Scaleway.Inputs.KeyManagerKeyRotationPolicyArgs
            {
                RotationPeriod = "720h",
            },
        });
    
        // Get the key information by its ID
        var byID = Scaleway.GetKeyManagerKey.Invoke(new()
        {
            KeyId = "11111111-1111-1111-1111-111111111111",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.scaleway.KeyManagerKey;
    import com.pulumi.scaleway.KeyManagerKeyArgs;
    import com.pulumi.scaleway.inputs.KeyManagerKeyRotationPolicyArgs;
    import com.pulumi.scaleway.ScalewayFunctions;
    import com.pulumi.scaleway.inputs.GetKeyManagerKeyArgs;
    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) {
            // Create a key
            var symmetric = new KeyManagerKey("symmetric", KeyManagerKeyArgs.builder()
                .name("my-kms-key")
                .region("fr-par")
                .projectId("your-project-id")
                .usage("symmetric_encryption")
                .algorithm("aes_256_gcm")
                .description("Key for encrypting secrets")
                .tags(            
                    "env:prod",
                    "kms")
                .unprotected(true)
                .rotationPolicy(KeyManagerKeyRotationPolicyArgs.builder()
                    .rotationPeriod("720h")
                    .build())
                .build());
    
            // Get the key information by its ID
            final var byID = ScalewayFunctions.getKeyManagerKey(GetKeyManagerKeyArgs.builder()
                .keyId("11111111-1111-1111-1111-111111111111")
                .build());
    
        }
    }
    
    resources:
      # Create a key
      symmetric:
        type: scaleway:KeyManagerKey
        properties:
          name: my-kms-key
          region: fr-par
          projectId: your-project-id
          usage: symmetric_encryption
          algorithm: aes_256_gcm
          description: Key for encrypting secrets
          tags:
            - env:prod
            - kms
          unprotected: true
          rotationPolicy:
            rotationPeriod: 720h
    variables:
      # Get the key information by its ID
      byID:
        fn::invoke:
          function: scaleway:getKeyManagerKey
          arguments:
            keyId: 11111111-1111-1111-1111-111111111111
    

    Using getKeyManagerKey

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getKeyManagerKey(args: GetKeyManagerKeyArgs, opts?: InvokeOptions): Promise<GetKeyManagerKeyResult>
    function getKeyManagerKeyOutput(args: GetKeyManagerKeyOutputArgs, opts?: InvokeOptions): Output<GetKeyManagerKeyResult>
    def get_key_manager_key(key_id: Optional[str] = None,
                            region: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetKeyManagerKeyResult
    def get_key_manager_key_output(key_id: Optional[pulumi.Input[str]] = None,
                            region: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetKeyManagerKeyResult]
    func LookupKeyManagerKey(ctx *Context, args *LookupKeyManagerKeyArgs, opts ...InvokeOption) (*LookupKeyManagerKeyResult, error)
    func LookupKeyManagerKeyOutput(ctx *Context, args *LookupKeyManagerKeyOutputArgs, opts ...InvokeOption) LookupKeyManagerKeyResultOutput

    > Note: This function is named LookupKeyManagerKey in the Go SDK.

    public static class GetKeyManagerKey 
    {
        public static Task<GetKeyManagerKeyResult> InvokeAsync(GetKeyManagerKeyArgs args, InvokeOptions? opts = null)
        public static Output<GetKeyManagerKeyResult> Invoke(GetKeyManagerKeyInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetKeyManagerKeyResult> getKeyManagerKey(GetKeyManagerKeyArgs args, InvokeOptions options)
    public static Output<GetKeyManagerKeyResult> getKeyManagerKey(GetKeyManagerKeyArgs args, InvokeOptions options)
    
    fn::invoke:
      function: scaleway:index/getKeyManagerKey:getKeyManagerKey
      arguments:
        # arguments dictionary

    The following arguments are supported:

    KeyId string
    ID of the key to target. Can be a plain UUID or a regional ID.
    Region string
    region) The region in which the key was created.
    KeyId string
    ID of the key to target. Can be a plain UUID or a regional ID.
    Region string
    region) The region in which the key was created.
    keyId String
    ID of the key to target. Can be a plain UUID or a regional ID.
    region String
    region) The region in which the key was created.
    keyId string
    ID of the key to target. Can be a plain UUID or a regional ID.
    region string
    region) The region in which the key was created.
    key_id str
    ID of the key to target. Can be a plain UUID or a regional ID.
    region str
    region) The region in which the key was created.
    keyId String
    ID of the key to target. Can be a plain UUID or a regional ID.
    region String
    region) The region in which the key was created.

    getKeyManagerKey Result

    The following output properties are available:

    Algorithm string
    CreatedAt string
    Description string
    Id string
    KeyId string
    Locked bool
    Name string
    Origin string
    ProjectId string
    Protected bool
    RotatedAt string
    RotationCount int
    RotationPolicies []GetKeyManagerKeyRotationPolicy
    State string
    Tags []string
    Unprotected bool
    UpdatedAt string
    Usage string
    Region string
    algorithm String
    createdAt String
    description String
    id String
    keyId String
    locked Boolean
    name String
    origin String
    projectId String
    protected_ Boolean
    rotatedAt String
    rotationCount Integer
    rotationPolicies List<GetKeyManagerKeyRotationPolicy>
    state String
    tags List<String>
    unprotected Boolean
    updatedAt String
    usage String
    region String
    algorithm string
    createdAt string
    description string
    id string
    keyId string
    locked boolean
    name string
    origin string
    projectId string
    protected boolean
    rotatedAt string
    rotationCount number
    rotationPolicies GetKeyManagerKeyRotationPolicy[]
    state string
    tags string[]
    unprotected boolean
    updatedAt string
    usage string
    region string
    algorithm String
    createdAt String
    description String
    id String
    keyId String
    locked Boolean
    name String
    origin String
    projectId String
    protected Boolean
    rotatedAt String
    rotationCount Number
    rotationPolicies List<Property Map>
    state String
    tags List<String>
    unprotected Boolean
    updatedAt String
    usage String
    region String

    Supporting Types

    GetKeyManagerKeyRotationPolicy

    NextRotationAt string
    Timestamp indicating the next scheduled rotation.
    RotationPeriod string
    Time interval between two key rotations. The minimum duration is 24 hours and the maximum duration is 1 year (876000 hours).
    NextRotationAt string
    Timestamp indicating the next scheduled rotation.
    RotationPeriod string
    Time interval between two key rotations. The minimum duration is 24 hours and the maximum duration is 1 year (876000 hours).
    nextRotationAt String
    Timestamp indicating the next scheduled rotation.
    rotationPeriod String
    Time interval between two key rotations. The minimum duration is 24 hours and the maximum duration is 1 year (876000 hours).
    nextRotationAt string
    Timestamp indicating the next scheduled rotation.
    rotationPeriod string
    Time interval between two key rotations. The minimum duration is 24 hours and the maximum duration is 1 year (876000 hours).
    next_rotation_at str
    Timestamp indicating the next scheduled rotation.
    rotation_period str
    Time interval between two key rotations. The minimum duration is 24 hours and the maximum duration is 1 year (876000 hours).
    nextRotationAt String
    Timestamp indicating the next scheduled rotation.
    rotationPeriod String
    Time interval between two key rotations. The minimum duration is 24 hours and the maximum duration is 1 year (876000 hours).

    Package Details

    Repository
    scaleway pulumiverse/pulumi-scaleway
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the scaleway Terraform Provider.
    scaleway logo
    Scaleway v1.40.0 published on Friday, Dec 19, 2025 by pulumiverse
      Meet Neo: Your AI Platform Teammate