DefaultKmsKey
Provides a resource to manage the default customer master key (CMK) that your AWS account uses to encrypt EBS volumes.
Your AWS account has an AWS-managed default CMK that is used for encrypting an EBS volume when no CMK is specified in the API call that creates the volume.
By using the aws.ebs.DefaultKmsKey resource, you can specify a customer-managed CMK to use in place of the AWS-managed default CMK.
NOTE: Creating an
aws.ebs.DefaultKmsKeyresource does not enable default EBS encryption. Use theaws.ebs.EncryptionByDefaultto enable default EBS encryption.NOTE: Destroying this resource will reset the default CMK to the account’s AWS-managed default CMK for EBS.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.Ebs.DefaultKmsKey("example", new Aws.Ebs.DefaultKmsKeyArgs
{
KeyArn = aws_kms_key.Example.Arn,
});
}
}
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/ebs"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ebs.NewDefaultKmsKey(ctx, "example", &ebs.DefaultKmsKeyArgs{
KeyArn: pulumi.String(aws_kms_key.Example.Arn),
})
if err != nil {
return err
}
return nil
})
}import pulumi
import pulumi_aws as aws
example = aws.ebs.DefaultKmsKey("example", key_arn=aws_kms_key["example"]["arn"])import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ebs.DefaultKmsKey("example", {
keyArn: aws_kms_key_example.arn,
});Create a DefaultKmsKey Resource
new DefaultKmsKey(name: string, args: DefaultKmsKeyArgs, opts?: CustomResourceOptions);def DefaultKmsKey(resource_name, opts=None, key_arn=None, __props__=None);func NewDefaultKmsKey(ctx *Context, name string, args DefaultKmsKeyArgs, opts ...ResourceOption) (*DefaultKmsKey, error)public DefaultKmsKey(string name, DefaultKmsKeyArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args DefaultKmsKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DefaultKmsKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DefaultKmsKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
DefaultKmsKey Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The DefaultKmsKey resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the DefaultKmsKey resource produces the following output properties:
Look up an Existing DefaultKmsKey Resource
Get an existing DefaultKmsKey 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?: DefaultKmsKeyState, opts?: CustomResourceOptions): DefaultKmsKeystatic get(resource_name, id, opts=None, key_arn=None, __props__=None);func GetDefaultKmsKey(ctx *Context, name string, id IDInput, state *DefaultKmsKeyState, opts ...ResourceOption) (*DefaultKmsKey, error)public static DefaultKmsKey Get(string name, Input<string> id, DefaultKmsKeyState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.