# 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 warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from . import outputs
from ._inputs import *

__all__ = ['Cluster']


class Cluster(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 availability_zones: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 cluster_name: Optional[pulumi.Input[str]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 iam_role_arn: Optional[pulumi.Input[str]] = None,
                 maintenance_window: Optional[pulumi.Input[str]] = None,
                 node_type: Optional[pulumi.Input[str]] = None,
                 notification_topic_arn: Optional[pulumi.Input[str]] = None,
                 parameter_group_name: Optional[pulumi.Input[str]] = None,
                 replication_factor: Optional[pulumi.Input[int]] = None,
                 security_group_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 server_side_encryption: Optional[pulumi.Input[pulumi.InputType['ClusterServerSideEncryptionArgs']]] = None,
                 subnet_group_name: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        Provides a DAX Cluster resource.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_aws as aws

        bar = aws.dax.Cluster("bar",
            cluster_name="cluster-example",
            iam_role_arn=data["aws_iam_role"]["example"]["arn"],
            node_type="dax.r4.large",
            replication_factor=1)
        ```

        ## Import

        DAX Clusters can be imported using the `cluster_name`, e.g.

        ```sh
         $ pulumi import aws:dax/cluster:Cluster my_cluster my_cluster
        ```

         [1]http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.concepts.cluster.html#DAX.concepts.nodes

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] availability_zones: List of Availability Zones in which the
               nodes will be created
        :param pulumi.Input[str] cluster_name: Group identifier. DAX converts this name to
               lowercase
        :param pulumi.Input[str] description: Description for the cluster
        :param pulumi.Input[str] iam_role_arn: A valid Amazon Resource Name (ARN) that identifies
               an IAM role. At runtime, DAX will assume this role and use the role's
               permissions to access DynamoDB on your behalf
        :param pulumi.Input[str] maintenance_window: Specifies the weekly time range for when
               maintenance on the cluster is performed. The format is `ddd:hh24:mi-ddd:hh24:mi`
               (24H Clock UTC). The minimum maintenance window is a 60 minute period. Example:
               `sun:05:00-sun:09:00`
        :param pulumi.Input[str] node_type: The compute and memory capacity of the nodes. See
               [Nodes](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.concepts.cluster.html#DAX.concepts.nodes) for supported node types
        :param pulumi.Input[str] notification_topic_arn: An Amazon Resource Name (ARN) of an
               SNS topic to send DAX notifications to. Example:
               `arn:aws:sns:us-east-1:012345678999:my_sns_topic`
        :param pulumi.Input[str] parameter_group_name: Name of the parameter group to associate
               with this DAX cluster
        :param pulumi.Input[int] replication_factor: The number of nodes in the DAX cluster. A
               replication factor of 1 will create a single-node cluster, without any read
               replicas
        :param pulumi.Input[Sequence[pulumi.Input[str]]] security_group_ids: One or more VPC security groups associated
               with the cluster
        :param pulumi.Input[pulumi.InputType['ClusterServerSideEncryptionArgs']] server_side_encryption: Encrypt at rest options
        :param pulumi.Input[str] subnet_group_name: Name of the subnet group to be used for the
               cluster
        :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource
        """
        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__['availability_zones'] = availability_zones
            if cluster_name is None:
                raise TypeError("Missing required property 'cluster_name'")
            __props__['cluster_name'] = cluster_name
            __props__['description'] = description
            if iam_role_arn is None:
                raise TypeError("Missing required property 'iam_role_arn'")
            __props__['iam_role_arn'] = iam_role_arn
            __props__['maintenance_window'] = maintenance_window
            if node_type is None:
                raise TypeError("Missing required property 'node_type'")
            __props__['node_type'] = node_type
            __props__['notification_topic_arn'] = notification_topic_arn
            __props__['parameter_group_name'] = parameter_group_name
            if replication_factor is None:
                raise TypeError("Missing required property 'replication_factor'")
            __props__['replication_factor'] = replication_factor
            __props__['security_group_ids'] = security_group_ids
            __props__['server_side_encryption'] = server_side_encryption
            __props__['subnet_group_name'] = subnet_group_name
            __props__['tags'] = tags
            __props__['arn'] = None
            __props__['cluster_address'] = None
            __props__['configuration_endpoint'] = None
            __props__['nodes'] = None
            __props__['port'] = None
        super(Cluster, __self__).__init__(
            'aws:dax/cluster:Cluster',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            arn: Optional[pulumi.Input[str]] = None,
            availability_zones: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            cluster_address: Optional[pulumi.Input[str]] = None,
            cluster_name: Optional[pulumi.Input[str]] = None,
            configuration_endpoint: Optional[pulumi.Input[str]] = None,
            description: Optional[pulumi.Input[str]] = None,
            iam_role_arn: Optional[pulumi.Input[str]] = None,
            maintenance_window: Optional[pulumi.Input[str]] = None,
            node_type: Optional[pulumi.Input[str]] = None,
            nodes: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ClusterNodeArgs']]]]] = None,
            notification_topic_arn: Optional[pulumi.Input[str]] = None,
            parameter_group_name: Optional[pulumi.Input[str]] = None,
            port: Optional[pulumi.Input[int]] = None,
            replication_factor: Optional[pulumi.Input[int]] = None,
            security_group_ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            server_side_encryption: Optional[pulumi.Input[pulumi.InputType['ClusterServerSideEncryptionArgs']]] = None,
            subnet_group_name: Optional[pulumi.Input[str]] = None,
            tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None) -> 'Cluster':
        """
        Get an existing Cluster 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[str] arn: The ARN of the DAX cluster
        :param pulumi.Input[Sequence[pulumi.Input[str]]] availability_zones: List of Availability Zones in which the
               nodes will be created
        :param pulumi.Input[str] cluster_address: The DNS name of the DAX cluster without the port appended
        :param pulumi.Input[str] cluster_name: Group identifier. DAX converts this name to
               lowercase
        :param pulumi.Input[str] configuration_endpoint: The configuration endpoint for this DAX cluster,
               consisting of a DNS name and a port number
        :param pulumi.Input[str] description: Description for the cluster
        :param pulumi.Input[str] iam_role_arn: A valid Amazon Resource Name (ARN) that identifies
               an IAM role. At runtime, DAX will assume this role and use the role's
               permissions to access DynamoDB on your behalf
        :param pulumi.Input[str] maintenance_window: Specifies the weekly time range for when
               maintenance on the cluster is performed. The format is `ddd:hh24:mi-ddd:hh24:mi`
               (24H Clock UTC). The minimum maintenance window is a 60 minute period. Example:
               `sun:05:00-sun:09:00`
        :param pulumi.Input[str] node_type: The compute and memory capacity of the nodes. See
               [Nodes](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.concepts.cluster.html#DAX.concepts.nodes) for supported node types
        :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['ClusterNodeArgs']]]] nodes: List of node objects including `id`, `address`, `port` and
               `availability_zone`. Referenceable e.g. as
               `${aws_dax_cluster.test.nodes.0.address}`
        :param pulumi.Input[str] notification_topic_arn: An Amazon Resource Name (ARN) of an
               SNS topic to send DAX notifications to. Example:
               `arn:aws:sns:us-east-1:012345678999:my_sns_topic`
        :param pulumi.Input[str] parameter_group_name: Name of the parameter group to associate
               with this DAX cluster
        :param pulumi.Input[int] port: The port used by the configuration endpoint
        :param pulumi.Input[int] replication_factor: The number of nodes in the DAX cluster. A
               replication factor of 1 will create a single-node cluster, without any read
               replicas
        :param pulumi.Input[Sequence[pulumi.Input[str]]] security_group_ids: One or more VPC security groups associated
               with the cluster
        :param pulumi.Input[pulumi.InputType['ClusterServerSideEncryptionArgs']] server_side_encryption: Encrypt at rest options
        :param pulumi.Input[str] subnet_group_name: Name of the subnet group to be used for the
               cluster
        :param pulumi.Input[Mapping[str, pulumi.Input[str]]] tags: A map of tags to assign to the resource
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["arn"] = arn
        __props__["availability_zones"] = availability_zones
        __props__["cluster_address"] = cluster_address
        __props__["cluster_name"] = cluster_name
        __props__["configuration_endpoint"] = configuration_endpoint
        __props__["description"] = description
        __props__["iam_role_arn"] = iam_role_arn
        __props__["maintenance_window"] = maintenance_window
        __props__["node_type"] = node_type
        __props__["nodes"] = nodes
        __props__["notification_topic_arn"] = notification_topic_arn
        __props__["parameter_group_name"] = parameter_group_name
        __props__["port"] = port
        __props__["replication_factor"] = replication_factor
        __props__["security_group_ids"] = security_group_ids
        __props__["server_side_encryption"] = server_side_encryption
        __props__["subnet_group_name"] = subnet_group_name
        __props__["tags"] = tags
        return Cluster(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def arn(self) -> pulumi.Output[str]:
        """
        The ARN of the DAX cluster
        """
        return pulumi.get(self, "arn")

    @property
    @pulumi.getter(name="availabilityZones")
    def availability_zones(self) -> pulumi.Output[Optional[Sequence[str]]]:
        """
        List of Availability Zones in which the
        nodes will be created
        """
        return pulumi.get(self, "availability_zones")

    @property
    @pulumi.getter(name="clusterAddress")
    def cluster_address(self) -> pulumi.Output[str]:
        """
        The DNS name of the DAX cluster without the port appended
        """
        return pulumi.get(self, "cluster_address")

    @property
    @pulumi.getter(name="clusterName")
    def cluster_name(self) -> pulumi.Output[str]:
        """
        Group identifier. DAX converts this name to
        lowercase
        """
        return pulumi.get(self, "cluster_name")

    @property
    @pulumi.getter(name="configurationEndpoint")
    def configuration_endpoint(self) -> pulumi.Output[str]:
        """
        The configuration endpoint for this DAX cluster,
        consisting of a DNS name and a port number
        """
        return pulumi.get(self, "configuration_endpoint")

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[Optional[str]]:
        """
        Description for the cluster
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="iamRoleArn")
    def iam_role_arn(self) -> pulumi.Output[str]:
        """
        A valid Amazon Resource Name (ARN) that identifies
        an IAM role. At runtime, DAX will assume this role and use the role's
        permissions to access DynamoDB on your behalf
        """
        return pulumi.get(self, "iam_role_arn")

    @property
    @pulumi.getter(name="maintenanceWindow")
    def maintenance_window(self) -> pulumi.Output[str]:
        """
        Specifies the weekly time range for when
        maintenance on the cluster is performed. The format is `ddd:hh24:mi-ddd:hh24:mi`
        (24H Clock UTC). The minimum maintenance window is a 60 minute period. Example:
        `sun:05:00-sun:09:00`
        """
        return pulumi.get(self, "maintenance_window")

    @property
    @pulumi.getter(name="nodeType")
    def node_type(self) -> pulumi.Output[str]:
        """
        The compute and memory capacity of the nodes. See
        [Nodes](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.concepts.cluster.html#DAX.concepts.nodes) for supported node types
        """
        return pulumi.get(self, "node_type")

    @property
    @pulumi.getter
    def nodes(self) -> pulumi.Output[Sequence['outputs.ClusterNode']]:
        """
        List of node objects including `id`, `address`, `port` and
        `availability_zone`. Referenceable e.g. as
        `${aws_dax_cluster.test.nodes.0.address}`
        """
        return pulumi.get(self, "nodes")

    @property
    @pulumi.getter(name="notificationTopicArn")
    def notification_topic_arn(self) -> pulumi.Output[Optional[str]]:
        """
        An Amazon Resource Name (ARN) of an
        SNS topic to send DAX notifications to. Example:
        `arn:aws:sns:us-east-1:012345678999:my_sns_topic`
        """
        return pulumi.get(self, "notification_topic_arn")

    @property
    @pulumi.getter(name="parameterGroupName")
    def parameter_group_name(self) -> pulumi.Output[str]:
        """
        Name of the parameter group to associate
        with this DAX cluster
        """
        return pulumi.get(self, "parameter_group_name")

    @property
    @pulumi.getter
    def port(self) -> pulumi.Output[int]:
        """
        The port used by the configuration endpoint
        """
        return pulumi.get(self, "port")

    @property
    @pulumi.getter(name="replicationFactor")
    def replication_factor(self) -> pulumi.Output[int]:
        """
        The number of nodes in the DAX cluster. A
        replication factor of 1 will create a single-node cluster, without any read
        replicas
        """
        return pulumi.get(self, "replication_factor")

    @property
    @pulumi.getter(name="securityGroupIds")
    def security_group_ids(self) -> pulumi.Output[Sequence[str]]:
        """
        One or more VPC security groups associated
        with the cluster
        """
        return pulumi.get(self, "security_group_ids")

    @property
    @pulumi.getter(name="serverSideEncryption")
    def server_side_encryption(self) -> pulumi.Output[Optional['outputs.ClusterServerSideEncryption']]:
        """
        Encrypt at rest options
        """
        return pulumi.get(self, "server_side_encryption")

    @property
    @pulumi.getter(name="subnetGroupName")
    def subnet_group_name(self) -> pulumi.Output[str]:
        """
        Name of the subnet group to be used for the
        cluster
        """
        return pulumi.get(self, "subnet_group_name")

    @property
    @pulumi.getter
    def tags(self) -> pulumi.Output[Optional[Mapping[str, str]]]:
        """
        A map of tags to assign to the resource
        """
        return pulumi.get(self, "tags")

    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

