# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from . import outputs
from ._inputs import *

__all__ = ['BucketServerSideEncryptionConfigurationArgs', 'BucketServerSideEncryptionConfiguration']

@pulumi.input_type
class BucketServerSideEncryptionConfigurationArgs:
    def __init__(__self__, *,
                 bucket: pulumi.Input[_builtins.str],
                 rules: pulumi.Input[Sequence[pulumi.Input['BucketServerSideEncryptionConfigurationRuleArgs']]]):
        """
        The set of arguments for constructing a BucketServerSideEncryptionConfiguration resource.
        :param pulumi.Input[_builtins.str] bucket: The bucket's name or regional ID.
        :param pulumi.Input[Sequence[pulumi.Input['BucketServerSideEncryptionConfigurationRuleArgs']]] rules: Set of server-side encryption configuration rules
        """
        pulumi.set(__self__, "bucket", bucket)
        pulumi.set(__self__, "rules", rules)

    @_builtins.property
    @pulumi.getter
    def bucket(self) -> pulumi.Input[_builtins.str]:
        """
        The bucket's name or regional ID.
        """
        return pulumi.get(self, "bucket")

    @bucket.setter
    def bucket(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "bucket", value)

    @_builtins.property
    @pulumi.getter
    def rules(self) -> pulumi.Input[Sequence[pulumi.Input['BucketServerSideEncryptionConfigurationRuleArgs']]]:
        """
        Set of server-side encryption configuration rules
        """
        return pulumi.get(self, "rules")

    @rules.setter
    def rules(self, value: pulumi.Input[Sequence[pulumi.Input['BucketServerSideEncryptionConfigurationRuleArgs']]]):
        pulumi.set(self, "rules", value)


@pulumi.input_type
class _BucketServerSideEncryptionConfigurationState:
    def __init__(__self__, *,
                 bucket: Optional[pulumi.Input[_builtins.str]] = None,
                 rules: Optional[pulumi.Input[Sequence[pulumi.Input['BucketServerSideEncryptionConfigurationRuleArgs']]]] = None):
        """
        Input properties used for looking up and filtering BucketServerSideEncryptionConfiguration resources.
        :param pulumi.Input[_builtins.str] bucket: The bucket's name or regional ID.
        :param pulumi.Input[Sequence[pulumi.Input['BucketServerSideEncryptionConfigurationRuleArgs']]] rules: Set of server-side encryption configuration rules
        """
        if bucket is not None:
            pulumi.set(__self__, "bucket", bucket)
        if rules is not None:
            pulumi.set(__self__, "rules", rules)

    @_builtins.property
    @pulumi.getter
    def bucket(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The bucket's name or regional ID.
        """
        return pulumi.get(self, "bucket")

    @bucket.setter
    def bucket(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "bucket", value)

    @_builtins.property
    @pulumi.getter
    def rules(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['BucketServerSideEncryptionConfigurationRuleArgs']]]]:
        """
        Set of server-side encryption configuration rules
        """
        return pulumi.get(self, "rules")

    @rules.setter
    def rules(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['BucketServerSideEncryptionConfigurationRuleArgs']]]]):
        pulumi.set(self, "rules", value)


@pulumi.type_token("scaleway:object/bucketServerSideEncryptionConfiguration:BucketServerSideEncryptionConfiguration")
class BucketServerSideEncryptionConfiguration(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 bucket: Optional[pulumi.Input[_builtins.str]] = None,
                 rules: Optional[pulumi.Input[Sequence[pulumi.Input[Union['BucketServerSideEncryptionConfigurationRuleArgs', 'BucketServerSideEncryptionConfigurationRuleArgsDict']]]]] = None,
                 __props__=None):
        """
        The `object.BucketServerSideEncryptionConfiguration` resource allows you to manage server-side encryption configuration for [Scaleway Object Storage](https://www.scaleway.com/en/docs/object-storage/) buckets.

        Refer to the [dedicated documentation](https://www.scaleway.com/en/docs/object-storage/api-cli/enable-sse-one/) for more information on server-side encryption.

        ## Example Usage

        ```python
        import pulumi
        import pulumiverse_scaleway as scaleway

        test = scaleway.object.Bucket("test",
            name="my-unique-bucket-name",
            region="fr-par")
        test_bucket_server_side_encryption_configuration = scaleway.object.BucketServerSideEncryptionConfiguration("test",
            bucket=test.name,
            region="fr-par",
            rules=[{
                "apply_server_side_encryption_by_default": {
                    "sse_algorithm": "AES256",
                },
            }])
        ```

        ```python
        import pulumi
        import pulumiverse_scaleway as scaleway

        test = scaleway.object.Bucket("test", name="my-unique-bucket-name")
        test_bucket_server_side_encryption_configuration = scaleway.object.BucketServerSideEncryptionConfiguration("test",
            bucket=test.name,
            rules=[{
                "apply_server_side_encryption_by_default": {
                    "sse_algorithm": "AES256",
                },
            }])
        ```

        ## Import

        Server-side encryption configurations can be imported using the `{region}/{bucketName}` identifier, as shown below:

        bash

        ```sh
        $ pulumi import scaleway:object/bucketServerSideEncryptionConfiguration:BucketServerSideEncryptionConfiguration test fr-par/my-bucket-name
        ```

        ~> **Important:** The `project_id` attribute has a particular behavior with S3 products because the S3 API is scoped by project.

        If you are using a project different from the default one, you have to specify the project ID at the end of the import command.

        bash

        ```sh
        $ pulumi import scaleway:object/bucketServerSideEncryptionConfiguration:BucketServerSideEncryptionConfiguration test fr-par/my-bucket-name@11111111-1111-1111-1111-111111111111
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] bucket: The bucket's name or regional ID.
        :param pulumi.Input[Sequence[pulumi.Input[Union['BucketServerSideEncryptionConfigurationRuleArgs', 'BucketServerSideEncryptionConfigurationRuleArgsDict']]]] rules: Set of server-side encryption configuration rules
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: BucketServerSideEncryptionConfigurationArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        The `object.BucketServerSideEncryptionConfiguration` resource allows you to manage server-side encryption configuration for [Scaleway Object Storage](https://www.scaleway.com/en/docs/object-storage/) buckets.

        Refer to the [dedicated documentation](https://www.scaleway.com/en/docs/object-storage/api-cli/enable-sse-one/) for more information on server-side encryption.

        ## Example Usage

        ```python
        import pulumi
        import pulumiverse_scaleway as scaleway

        test = scaleway.object.Bucket("test",
            name="my-unique-bucket-name",
            region="fr-par")
        test_bucket_server_side_encryption_configuration = scaleway.object.BucketServerSideEncryptionConfiguration("test",
            bucket=test.name,
            region="fr-par",
            rules=[{
                "apply_server_side_encryption_by_default": {
                    "sse_algorithm": "AES256",
                },
            }])
        ```

        ```python
        import pulumi
        import pulumiverse_scaleway as scaleway

        test = scaleway.object.Bucket("test", name="my-unique-bucket-name")
        test_bucket_server_side_encryption_configuration = scaleway.object.BucketServerSideEncryptionConfiguration("test",
            bucket=test.name,
            rules=[{
                "apply_server_side_encryption_by_default": {
                    "sse_algorithm": "AES256",
                },
            }])
        ```

        ## Import

        Server-side encryption configurations can be imported using the `{region}/{bucketName}` identifier, as shown below:

        bash

        ```sh
        $ pulumi import scaleway:object/bucketServerSideEncryptionConfiguration:BucketServerSideEncryptionConfiguration test fr-par/my-bucket-name
        ```

        ~> **Important:** The `project_id` attribute has a particular behavior with S3 products because the S3 API is scoped by project.

        If you are using a project different from the default one, you have to specify the project ID at the end of the import command.

        bash

        ```sh
        $ pulumi import scaleway:object/bucketServerSideEncryptionConfiguration:BucketServerSideEncryptionConfiguration test fr-par/my-bucket-name@11111111-1111-1111-1111-111111111111
        ```

        :param str resource_name: The name of the resource.
        :param BucketServerSideEncryptionConfigurationArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(BucketServerSideEncryptionConfigurationArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 bucket: Optional[pulumi.Input[_builtins.str]] = None,
                 rules: Optional[pulumi.Input[Sequence[pulumi.Input[Union['BucketServerSideEncryptionConfigurationRuleArgs', 'BucketServerSideEncryptionConfigurationRuleArgsDict']]]]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = BucketServerSideEncryptionConfigurationArgs.__new__(BucketServerSideEncryptionConfigurationArgs)

            if bucket is None and not opts.urn:
                raise TypeError("Missing required property 'bucket'")
            __props__.__dict__["bucket"] = bucket
            if rules is None and not opts.urn:
                raise TypeError("Missing required property 'rules'")
            __props__.__dict__["rules"] = rules
        super(BucketServerSideEncryptionConfiguration, __self__).__init__(
            'scaleway:object/bucketServerSideEncryptionConfiguration:BucketServerSideEncryptionConfiguration',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            bucket: Optional[pulumi.Input[_builtins.str]] = None,
            rules: Optional[pulumi.Input[Sequence[pulumi.Input[Union['BucketServerSideEncryptionConfigurationRuleArgs', 'BucketServerSideEncryptionConfigurationRuleArgsDict']]]]] = None) -> 'BucketServerSideEncryptionConfiguration':
        """
        Get an existing BucketServerSideEncryptionConfiguration resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] bucket: The bucket's name or regional ID.
        :param pulumi.Input[Sequence[pulumi.Input[Union['BucketServerSideEncryptionConfigurationRuleArgs', 'BucketServerSideEncryptionConfigurationRuleArgsDict']]]] rules: Set of server-side encryption configuration rules
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _BucketServerSideEncryptionConfigurationState.__new__(_BucketServerSideEncryptionConfigurationState)

        __props__.__dict__["bucket"] = bucket
        __props__.__dict__["rules"] = rules
        return BucketServerSideEncryptionConfiguration(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter
    def bucket(self) -> pulumi.Output[_builtins.str]:
        """
        The bucket's name or regional ID.
        """
        return pulumi.get(self, "bucket")

    @_builtins.property
    @pulumi.getter
    def rules(self) -> pulumi.Output[Sequence['outputs.BucketServerSideEncryptionConfigurationRule']]:
        """
        Set of server-side encryption configuration rules
        """
        return pulumi.get(self, "rules")

