ExternalKey class
Manages a single-Region or multi-Region primary KMS key that uses external key material.
To instead manage a single-Region or multi-Region primary KMS key where AWS automatically generates and potentially rotates key material, see the aws.kms.Key resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.kms.ExternalKey("example", {description: "KMS EXTERNAL for AMI encryption"});
import pulumi
import pulumi_aws as aws
example = aws.kms.ExternalKey("example", description="KMS EXTERNAL for AMI encryption")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Kms.ExternalKey("example", new()
{
Description = "KMS EXTERNAL for AMI encryption",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/kms"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := kms.NewExternalKey(ctx, "example", &kms.ExternalKeyArgs{
Description: pulumi.String("KMS EXTERNAL for AMI encryption"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
aws = {
source = "pulumi/aws"
}
}
}
resource "aws_kms_externalkey" "example" {
description = "KMS EXTERNAL for AMI encryption"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.kms.ExternalKey;
import com.pulumi.aws.kms.ExternalKeyArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 = new ExternalKey("example", ExternalKeyArgs.builder()
.description("KMS EXTERNAL for AMI encryption")
.build());
}
}
resources:
example:
type: aws:kms:ExternalKey
properties:
description: KMS EXTERNAL for AMI encryption
Import
Using pulumi import, import KMS External Keys using the id. For example:
$ pulumi import aws:kms/externalKey:ExternalKey a arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab
Constructors
- ExternalKey(String name, {ExternalKeyArgs? args, CustomResourceOptions? options})
-
Creates a new ExternalKey.
nameThe Pulumi resource name.argsArguments used to configure this ExternalKey. The set of arguments for ExternalKey.optionsResource options controlling this resource's behavior. - ExternalKey.reference(String urn)
- Creates a typed reference to an existing ExternalKey resource.
Properties
-
arn
↔ Output<
String> -
ARN of the key.
latefinal
-
bypassPolicyLockoutSafetyCheck
↔ Output<
bool?> -
Whether to disable the policy lockout check performed when creating or updating the key's policy. Setting this value to
trueincreases the risk that the key becomes unmanageable. For more information, refer to the scenario in the Default Key Policy section in the KMS Developer Guide. Defaults tofalse.latefinal -
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
deletionWindowInDays
↔ Output<
int?> -
Duration in days after which the key is deleted after destruction of the resource. Must be between
7and30days. Defaults to30.latefinal -
description
↔ Output<
String?> -
Description of the key.
latefinal
-
enabled
↔ Output<
bool> -
Specifies whether the key is enabled. Keys pending import can only be
false. Imported keys default totrueunless expired.latefinal -
expirationModel
↔ Output<
String> -
Whether the key material expires. Empty when pending key material import, otherwise
KEY_MATERIAL_EXPIRESorKEY_MATERIAL_DOES_NOT_EXPIRE.latefinal - hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
keyMaterialBase64
↔ Output<
String?> -
Base64 encoded 256-bit symmetric encryption key material to import. The CMK is permanently associated with this key material. The same key material can be reimported, but you cannot import different key material.
latefinal
-
keySpec
↔ Output<
String> -
Specifies whether the key contains a symmetric key or an asymmetric key pair and the encryption algorithms or signing algorithms that the key supports. Valid values:
SYMMETRIC_DEFAULT,RSA_2048,RSA_3072,RSA_4096,HMAC_224,HMAC_256,HMAC_384,HMAC_512,ECC_NIST_P256,ECC_NIST_P384,ECC_NIST_P521,ECC_SECG_P256K1,ML_DSA_44,ML_DSA_65,ML_DSA_87, orSM2(China Regions only). Defaults toSYMMETRIC_DEFAULT. For help with choosing a key spec, see the AWS KMS Developer Guide.latefinal -
keyState
↔ Output<
String> -
The state of the CMK.
latefinal
-
keyUsage
↔ Output<
String> -
Specifies the intended use of the key. Valid values:
ENCRYPT_DECRYPT,SIGN_VERIFY, orGENERATE_VERIFY_MAC. Defaults toENCRYPT_DECRYPT.latefinal -
multiRegion
↔ Output<
bool> -
Indicates whether the KMS key is a multi-Region (
true) or regional (false) key. Defaults tofalse.latefinal -
policy
↔ Output<
String> -
A key policy JSON document. If you do not provide a key policy, AWS KMS attaches a default key policy to the CMK.
latefinal
-
region
↔ Output<
String> -
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
A key-value map of tags to assign to the key. If configured with a provider
defaultTagsconfiguration block present, tags with matching keys will overwrite those defined at the provider-level.latefinal -
A map of tags assigned to the resource, including those inherited from the provider
defaultTagsconfiguration block.latefinal -
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
-
validTo
↔ Output<
String?> -
Time at which the imported key material expires. When the key material expires, AWS KMS deletes the key material and the CMK becomes unusable. If not specified, key material does not expire. Valid values: RFC3339 time string (
YYYY-MM-DDTHH:MM:SSZ)latefinal
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {ExternalKeyState? state, CustomResourceOptions? options}) → ExternalKey -
Gets an existing ExternalKey resource's state with the given
nameandid.