Class BucketServerSideEncryptionConfigurationV2


  • @Deprecated
    public class BucketServerSideEncryptionConfigurationV2
    extends com.pulumi.resources.CustomResource
    Deprecated.
    aws.s3/bucketserversideencryptionconfigurationv2.BucketServerSideEncryptionConfigurationV2 has been deprecated in favor of aws.s3/bucketserversideencryptionconfiguration.BucketServerSideEncryptionConfiguration
    Provides a S3 bucket server-side encryption configuration resource. > **NOTE:** Destroying an `aws.s3.BucketServerSideEncryptionConfiguration` resource resets the bucket to [Amazon S3 bucket default encryption](https://docs.aws.amazon.com/AmazonS3/latest/userguide/default-encryption-faq.html). > **NOTE:** Starting in April 2026, Amazon S3 will automatically block server-side encryption with customer-provided keys (SSE-C) for all new buckets. Use the `blockedEncryptionTypes` argument to manage this behavior. For more information, see the [SSE-C changes FAQ](https://docs.aws.amazon.com/AmazonS3/latest/userguide/default-s3-c-encryption-setting-faq.html). ## Example Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.kms.Key;
     import com.pulumi.aws.kms.KeyArgs;
     import com.pulumi.aws.s3.Bucket;
     import com.pulumi.aws.s3.BucketArgs;
     import com.pulumi.aws.s3.BucketServerSideEncryptionConfiguration;
     import com.pulumi.aws.s3.BucketServerSideEncryptionConfigurationArgs;
     import com.pulumi.aws.s3.inputs.BucketServerSideEncryptionConfigurationRuleArgs;
     import com.pulumi.aws.s3.inputs.BucketServerSideEncryptionConfigurationRuleApplyServerSideEncryptionByDefaultArgs;
     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 mykey = new Key("mykey", KeyArgs.builder()
                 .description("This key is used to encrypt bucket objects")
                 .deletionWindowInDays(10)
                 .build());
     
             var mybucket = new Bucket("mybucket", BucketArgs.builder()
                 .bucket("mybucket")
                 .build());
     
             var example = new BucketServerSideEncryptionConfiguration("example", BucketServerSideEncryptionConfigurationArgs.builder()
                 .rules(BucketServerSideEncryptionConfigurationRuleArgs.builder()
                     .applyServerSideEncryptionByDefault(BucketServerSideEncryptionConfigurationRuleApplyServerSideEncryptionByDefaultArgs.builder()
                         .kmsMasterKeyId(mykey.arn())
                         .sseAlgorithm("aws:kms")
                         .build())
                     .build())
                 .bucket(mybucket.id())
                 .build());
     
         }
     }
     
     
    ### Blocking SSE-C Uploads
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.kms.Key;
     import com.pulumi.aws.kms.KeyArgs;
     import com.pulumi.aws.s3.Bucket;
     import com.pulumi.aws.s3.BucketArgs;
     import com.pulumi.aws.s3.BucketServerSideEncryptionConfiguration;
     import com.pulumi.aws.s3.BucketServerSideEncryptionConfigurationArgs;
     import com.pulumi.aws.s3.inputs.BucketServerSideEncryptionConfigurationRuleArgs;
     import com.pulumi.aws.s3.inputs.BucketServerSideEncryptionConfigurationRuleApplyServerSideEncryptionByDefaultArgs;
     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 mykey = new Key("mykey", KeyArgs.builder()
                 .description("This key is used to encrypt bucket objects")
                 .deletionWindowInDays(10)
                 .build());
     
             var mybucket = new Bucket("mybucket", BucketArgs.builder()
                 .bucket("mybucket")
                 .build());
     
             var example = new BucketServerSideEncryptionConfiguration("example", BucketServerSideEncryptionConfigurationArgs.builder()
                 .rules(BucketServerSideEncryptionConfigurationRuleArgs.builder()
                     .applyServerSideEncryptionByDefault(BucketServerSideEncryptionConfigurationRuleApplyServerSideEncryptionByDefaultArgs.builder()
                         .kmsMasterKeyId(mykey.arn())
                         .sseAlgorithm("aws:kms")
                         .build())
                     .bucketKeyEnabled(true)
                     .blockedEncryptionTypes("SSE-C")
                     .build())
                 .bucket(mybucket.id())
                 .build());
     
         }
     }
     
     
    ## Import ### Identity Schema #### Required * `bucket` (String) S3 bucket name. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. If the owner (account ID) of the source bucket differs from the account used to configure the AWS Provider, import using the `bucket` and `expectedBucketOwner` separated by a comma (`,`): **Using `pulumi import` to import** S3 bucket server-side encryption configuration using the `bucket` or using the `bucket` and `expectedBucketOwner` separated by a comma (`,`). For example: If the owner (account ID) of the source bucket is the same account used to configure the AWS Provider, import using the `bucket`: ```sh $ pulumi import aws:s3/bucketServerSideEncryptionConfigurationV2:BucketServerSideEncryptionConfigurationV2 example bucket-name ``` If the owner (account ID) of the source bucket differs from the account used to configure the AWS Provider, import using the `bucket` and `expectedBucketOwner` separated by a comma (`,`): ```sh $ pulumi import aws:s3/bucketServerSideEncryptionConfigurationV2:BucketServerSideEncryptionConfigurationV2 example bucket-name,123456789012 ```
    • Constructor Detail

      • BucketServerSideEncryptionConfigurationV2

        public BucketServerSideEncryptionConfigurationV2​(java.lang.String name)
        Deprecated.
        Parameters:
        name - The _unique_ name of the resulting resource.
      • BucketServerSideEncryptionConfigurationV2

        public BucketServerSideEncryptionConfigurationV2​(java.lang.String name,
                                                         BucketServerSideEncryptionConfigurationV2Args args)
        Deprecated.
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • BucketServerSideEncryptionConfigurationV2

        public BucketServerSideEncryptionConfigurationV2​(java.lang.String name,
                                                         BucketServerSideEncryptionConfigurationV2Args args,
                                                         @Nullable
                                                         com.pulumi.resources.CustomResourceOptions options)
        Deprecated.
        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

      • bucket

        public com.pulumi.core.Output<java.lang.String> bucket()
        Deprecated.
        Returns:
        ID (name) of the bucket.
      • expectedBucketOwner

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> expectedBucketOwner()
        Deprecated.
        Returns:
        Account ID of the expected bucket owner.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Deprecated.
        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.
      • rules

        public com.pulumi.core.Output<java.util.List<BucketServerSideEncryptionConfigurationV2Rule>> rules()
        Deprecated.
        Returns:
        Set of server-side encryption configuration rules. See below. Currently, only a single rule is supported.
      • get

        public static BucketServerSideEncryptionConfigurationV2 get​(java.lang.String name,
                                                                    com.pulumi.core.Output<java.lang.String> id,
                                                                    @Nullable
                                                                    BucketServerSideEncryptionConfigurationV2State state,
                                                                    @Nullable
                                                                    com.pulumi.resources.CustomResourceOptions options)
        Deprecated.
        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.