Package com.pulumi.aws.ebs
Class DefaultKmsKey
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.ebs.DefaultKmsKey
-
public class DefaultKmsKey extends com.pulumi.resources.CustomResourceProvides 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.DefaultKmsKey` resource does not enable default EBS encryption. Use the `aws.ebs.EncryptionByDefault` to 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
## Import Using `pulumi import`, import the EBS default KMS CMK using the KMS key ARN. For example: ```sh $ pulumi import aws:ebs/defaultKmsKey:DefaultKmsKey example arn:aws:kms:us-east-1:123456789012:key/abcd-1234 ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.ebs.DefaultKmsKey; import com.pulumi.aws.ebs.DefaultKmsKeyArgs; 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 DefaultKmsKey("example", DefaultKmsKeyArgs.builder() .keyArn(exampleAwsKmsKey.arn()) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description DefaultKmsKey(java.lang.String name)DefaultKmsKey(java.lang.String name, DefaultKmsKeyArgs args)DefaultKmsKey(java.lang.String name, DefaultKmsKeyArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultKmsKeyget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, DefaultKmsKeyState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>keyArn()com.pulumi.core.Output<java.lang.String>region()
-
-
-
Constructor Detail
-
DefaultKmsKey
public DefaultKmsKey(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
DefaultKmsKey
public DefaultKmsKey(java.lang.String name, DefaultKmsKeyArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
DefaultKmsKey
public DefaultKmsKey(java.lang.String name, DefaultKmsKeyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
keyArn
public com.pulumi.core.Output<java.lang.String> keyArn()
- Returns:
- ARN of the KMS customer master key (CMK) to use to encrypt the EBS volume.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
get
public static DefaultKmsKey get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable DefaultKmsKeyState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-