# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from . import utilities, tables

class EtcdBackup(pulumi.CustomResource):
    annotations: pulumi.Output[dict]
    """
    Annotations for Etcd Backup object (map)
    """
    backup_config: pulumi.Output[dict]
    """
    Backup config for etcd backup (list maxitems:1)

      * `enabled` (`bool`) - Enable etcd backup (bool)
      * `intervalHours` (`float`) - Interval hours for etcd backup. Default `12` (int)
      * `retention` (`float`) - Retention for etcd backup. Default `6` (int)
      * `s3BackupConfig` (`dict`) - S3 config options for etcd backup. Valid for `imported` and `rke` clusters. (list maxitems:1)
        * `access_key` (`str`) - Access key for S3 service (string)
        * `bucketName` (`str`) - Bucket name for S3 service (string)
        * `customCa` (`str`) - Base64 encoded custom CA for S3 service. Use filebase64(<FILE>) for encoding file. Available from Rancher v2.2.5 (string)
        * `endpoint` (`str`) - Endpoint for S3 service (string)
        * `folder` (`str`) - Folder for S3 service. Available from Rancher v2.2.7 (string)
        * `region` (`str`) - Region for S3 service (string)
        * `secret_key` (`str`) - Secret key for S3 service (string)

      * `safeTimestamp` (`bool`)
    """
    cluster_id: pulumi.Output[str]
    """
    Cluster ID to config Etcd Backup (string)
    """
    filename: pulumi.Output[str]
    """
    Filename of the Etcd Backup (string)
    """
    labels: pulumi.Output[dict]
    """
    Labels for Etcd Backup object (map)
    """
    manual: pulumi.Output[bool]
    """
    Manual execution of the Etcd Backup. Default `false` (bool)
    """
    name: pulumi.Output[str]
    """
    The name of the Etcd Backup (string)
    """
    namespace_id: pulumi.Output[str]
    """
    Description for the Etcd Backup (string)
    """
    def __init__(__self__, resource_name, opts=None, annotations=None, backup_config=None, cluster_id=None, filename=None, labels=None, manual=None, name=None, namespace_id=None, __props__=None, __name__=None, __opts__=None):
        """
        Create a EtcdBackup resource with the given unique name, props, and options.
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[dict] annotations: Annotations for Etcd Backup object (map)
        :param pulumi.Input[dict] backup_config: Backup config for etcd backup (list maxitems:1)
        :param pulumi.Input[str] cluster_id: Cluster ID to config Etcd Backup (string)
        :param pulumi.Input[str] filename: Filename of the Etcd Backup (string)
        :param pulumi.Input[dict] labels: Labels for Etcd Backup object (map)
        :param pulumi.Input[bool] manual: Manual execution of the Etcd Backup. Default `false` (bool)
        :param pulumi.Input[str] name: The name of the Etcd Backup (string)
        :param pulumi.Input[str] namespace_id: Description for the Etcd Backup (string)

        The **backup_config** object supports the following:

          * `enabled` (`pulumi.Input[bool]`) - Enable etcd backup (bool)
          * `intervalHours` (`pulumi.Input[float]`) - Interval hours for etcd backup. Default `12` (int)
          * `retention` (`pulumi.Input[float]`) - Retention for etcd backup. Default `6` (int)
          * `s3BackupConfig` (`pulumi.Input[dict]`) - S3 config options for etcd backup. Valid for `imported` and `rke` clusters. (list maxitems:1)
            * `access_key` (`pulumi.Input[str]`) - Access key for S3 service (string)
            * `bucketName` (`pulumi.Input[str]`) - Bucket name for S3 service (string)
            * `customCa` (`pulumi.Input[str]`) - Base64 encoded custom CA for S3 service. Use filebase64(<FILE>) for encoding file. Available from Rancher v2.2.5 (string)
            * `endpoint` (`pulumi.Input[str]`) - Endpoint for S3 service (string)
            * `folder` (`pulumi.Input[str]`) - Folder for S3 service. Available from Rancher v2.2.7 (string)
            * `region` (`pulumi.Input[str]`) - Region for S3 service (string)
            * `secret_key` (`pulumi.Input[str]`) - Secret key for S3 service (string)

          * `safeTimestamp` (`pulumi.Input[bool]`)
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = utilities.get_version()
        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__ = dict()

            __props__['annotations'] = annotations
            __props__['backup_config'] = backup_config
            if cluster_id is None:
                raise TypeError("Missing required property 'cluster_id'")
            __props__['cluster_id'] = cluster_id
            __props__['filename'] = filename
            __props__['labels'] = labels
            __props__['manual'] = manual
            __props__['name'] = name
            __props__['namespace_id'] = namespace_id
        super(EtcdBackup, __self__).__init__(
            'rancher2:index/etcdBackup:EtcdBackup',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, annotations=None, backup_config=None, cluster_id=None, filename=None, labels=None, manual=None, name=None, namespace_id=None):
        """
        Get an existing EtcdBackup 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 str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[dict] annotations: Annotations for Etcd Backup object (map)
        :param pulumi.Input[dict] backup_config: Backup config for etcd backup (list maxitems:1)
        :param pulumi.Input[str] cluster_id: Cluster ID to config Etcd Backup (string)
        :param pulumi.Input[str] filename: Filename of the Etcd Backup (string)
        :param pulumi.Input[dict] labels: Labels for Etcd Backup object (map)
        :param pulumi.Input[bool] manual: Manual execution of the Etcd Backup. Default `false` (bool)
        :param pulumi.Input[str] name: The name of the Etcd Backup (string)
        :param pulumi.Input[str] namespace_id: Description for the Etcd Backup (string)

        The **backup_config** object supports the following:

          * `enabled` (`pulumi.Input[bool]`) - Enable etcd backup (bool)
          * `intervalHours` (`pulumi.Input[float]`) - Interval hours for etcd backup. Default `12` (int)
          * `retention` (`pulumi.Input[float]`) - Retention for etcd backup. Default `6` (int)
          * `s3BackupConfig` (`pulumi.Input[dict]`) - S3 config options for etcd backup. Valid for `imported` and `rke` clusters. (list maxitems:1)
            * `access_key` (`pulumi.Input[str]`) - Access key for S3 service (string)
            * `bucketName` (`pulumi.Input[str]`) - Bucket name for S3 service (string)
            * `customCa` (`pulumi.Input[str]`) - Base64 encoded custom CA for S3 service. Use filebase64(<FILE>) for encoding file. Available from Rancher v2.2.5 (string)
            * `endpoint` (`pulumi.Input[str]`) - Endpoint for S3 service (string)
            * `folder` (`pulumi.Input[str]`) - Folder for S3 service. Available from Rancher v2.2.7 (string)
            * `region` (`pulumi.Input[str]`) - Region for S3 service (string)
            * `secret_key` (`pulumi.Input[str]`) - Secret key for S3 service (string)

          * `safeTimestamp` (`pulumi.Input[bool]`)
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["annotations"] = annotations
        __props__["backup_config"] = backup_config
        __props__["cluster_id"] = cluster_id
        __props__["filename"] = filename
        __props__["labels"] = labels
        __props__["manual"] = manual
        __props__["name"] = name
        __props__["namespace_id"] = namespace_id
        return EtcdBackup(resource_name, opts=opts, __props__=__props__)
    def translate_output_property(self, prop):
        return tables._CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return tables._SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

