# 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

__all__ = ['ClusterTemplate']


class ClusterTemplate(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 apiserver_port: Optional[pulumi.Input[int]] = None,
                 cluster_distro: Optional[pulumi.Input[str]] = None,
                 coe: Optional[pulumi.Input[str]] = None,
                 dns_nameserver: Optional[pulumi.Input[str]] = None,
                 docker_storage_driver: Optional[pulumi.Input[str]] = None,
                 docker_volume_size: Optional[pulumi.Input[int]] = None,
                 external_network_id: Optional[pulumi.Input[str]] = None,
                 fixed_network: Optional[pulumi.Input[str]] = None,
                 fixed_subnet: Optional[pulumi.Input[str]] = None,
                 flavor: Optional[pulumi.Input[str]] = None,
                 floating_ip_enabled: Optional[pulumi.Input[bool]] = None,
                 http_proxy: Optional[pulumi.Input[str]] = None,
                 https_proxy: Optional[pulumi.Input[str]] = None,
                 image: Optional[pulumi.Input[str]] = None,
                 insecure_registry: Optional[pulumi.Input[str]] = None,
                 keypair_id: Optional[pulumi.Input[str]] = None,
                 labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                 master_flavor: Optional[pulumi.Input[str]] = None,
                 master_lb_enabled: Optional[pulumi.Input[bool]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 network_driver: Optional[pulumi.Input[str]] = None,
                 no_proxy: Optional[pulumi.Input[str]] = None,
                 public: Optional[pulumi.Input[bool]] = None,
                 region: Optional[pulumi.Input[str]] = None,
                 registry_enabled: Optional[pulumi.Input[bool]] = None,
                 server_type: Optional[pulumi.Input[str]] = None,
                 tls_disabled: Optional[pulumi.Input[bool]] = None,
                 volume_driver: Optional[pulumi.Input[str]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        Manages a V1 Magnum cluster template resource within OpenStack.

        ## Example Usage
        ### Create a Cluster template

        ```python
        import pulumi
        import pulumi_openstack as openstack

        clustertemplate1 = openstack.containerinfra.ClusterTemplate("clustertemplate1",
            coe="kubernetes",
            dns_nameserver="1.1.1.1",
            docker_storage_driver="devicemapper",
            docker_volume_size=10,
            flavor="m1.small",
            floating_ip_enabled=False,
            image="Fedora-Atomic-27",
            labels={
                "influx_grafana_dashboard_enabled": "true",
                "kube_dashboard_enabled": "true",
                "kube_tag": "1.11.1",
                "prometheus_monitoring": "true",
            },
            master_flavor="m1.medium",
            master_lb_enabled=True,
            network_driver="flannel",
            server_type="vm",
            volume_driver="cinder")
        ```
        ## Argument reference

        The following arguments are supported:

        * `region` - (Optional) The region in which to obtain the V1 Container Infra
          client. A Container Infra client is needed to create a cluster template. If
          omitted,the `region` argument of the provider is used. Changing this
          creates a new cluster template.

        * `name` - (Required) The name of the cluster template. Changing this updates
          the name of the existing cluster template.

        * `project_id` - (Optional) The project of the cluster template. Required if
          admin wants to create a cluster template in another project. Changing this
          creates a new cluster template.

        * `user_id` - (Optional) The user of the cluster template. Required if admin
          wants to create a cluster template for another user. Changing this creates
          a new cluster template.

        * `apiserver_port` - (Optional) The API server port for the Container
          Orchestration Engine for this cluster template. Changing this updates the
          API server port of the existing cluster template.

        * `coe` - (Required) The Container Orchestration Engine for this cluster
          template. Changing this updates the engine of the existing cluster
          template.

        * `cluster_distro` - (Optional) The distro for the cluster (fedora-atomic,
          coreos, etc.). Changing this updates the cluster distro of the existing
          cluster template.

        * `dns_nameserver` - (Optional) Address of the DNS nameserver that is used in
          nodes of the cluster. Changing this updates the DNS nameserver of the
          existing cluster template.

        * `docker_storage_driver` - (Optional) Docker storage driver. Changing this
          updates the Docker storage driver of the existing cluster template.

        * `docker_volume_size` - (Optional) The size (in GB) of the Docker volume.
          Changing this updates the Docker volume size of the existing cluster
          template.

        * `external_network_id` - (Optional) The ID of the external network that will
          be used for the cluster. Changing this updates the external network ID of
          the existing cluster template.

        * `fixed_network` - (Optional) The fixed network that will be attached to the
          cluster. Changing this updates the fixed network of the existing cluster
          template.

        * `fixed_subnet` - (Optional) The fixed subnet that will be attached to the
          cluster. Changing this updates the fixed subnet of the existing cluster
          template.

        * `flavor` - (Optional) The flavor for the nodes of the cluster. Can be set via
          the `OS_MAGNUM_FLAVOR` environment variable. Changing this updates the
          flavor of the existing cluster template.

        * `master_flavor` - (Optional) The flavor for the master nodes. Can be set via
          the `OS_MAGNUM_MASTER_FLAVOR` environment variable. Changing this updates
          the master flavor of the existing cluster template.

        * `floating_ip_enabled` - (Optional) Indicates whether created cluster should
          create floating IP for every node or not. Changing this updates the
          floating IP enabled attribute of the existing cluster template.

        * `http_proxy` - (Optional) The address of a proxy for receiving all HTTP
          requests and relay them. Changing this updates the HTTP proxy address of
          the existing cluster template.

        * `https_proxy` - (Optional) The address of a proxy for receiving all HTTPS
          requests and relay them. Changing this updates the HTTPS proxy address of
          the existing cluster template.

        * `image` - (Required) The reference to an image that is used for nodes of the
          cluster. Can be set via the `OS_MAGNUM_IMAGE` environment variable.
          Changing this updates the image attribute of the existing cluster template.

        * `insecure_registry` - (Optional) The insecure registry URL for the cluster
          template. Changing this updates the insecure registry attribute of the
          existing cluster template.

        * `keypair_id` - (Optional) The name of the Compute service SSH keypair.
          Changing this updates the keypair of the existing cluster template.

        * `labels` - (Optional) The list of key value pairs representing additional
          properties of the cluster template. Changing this updates the labels of the
          existing cluster template.

        * `master_lb_enabled` - (Optional) Indicates whether created cluster should
          has a loadbalancer for master nodes or not. Changing this updates the
          attribute of the existing cluster template.

        * `network_driver` - (Optional) The name of the driver for the container
          network. Changing this updates the network driver of the existing cluster
          template.

        * `no_proxy` - (Optional) A comma-separated list of IP addresses that shouldn't
          be used in the cluster. Changing this updates the no proxy list of the
          existing cluster template.

        * `public` - (Optional) Indicates whether cluster template should be public.
          Changing this updates the public attribute of the existing cluster
          template.

        * `registry_enabled` - (Optional) Indicates whether Docker registry is enabled
          in the cluster. Changing this updates the registry enabled attribute of the
          existing cluster template.

        * `server_type` - (Optional) The server type for the cluster template. Changing
          this updates the server type of the existing cluster template.

        * `tls_disabled` - (Optional) Indicates whether the TLS should be disabled in
          the cluster. Changing this updates the attribute of the existing cluster.

        * `volume_driver` - (Optional) The name of the driver that is used for the
          volumes of the cluster nodes. Changing this updates the volume driver of
          the existing cluster template.

        ## Attributes reference

        The following attributes are exported:

        * `region` - See Argument Reference above.
        * `name` - See Argument Reference above.
        * `project_id` - See Argument Reference above.
        * `created_at` - The time at which cluster template was created.
        * `updated_at` - The time at which cluster template was created.
        * `apiserver_port` - See Argument Reference above.
        * `coe` - See Argument Reference above.
        * `cluster_distro` - See Argument Reference above.
        * `dns_nameserver` - See Argument Reference above.
        * `docker_storage_driver` - See Argument Reference above.
        * `docker_volume_size` - See Argument Reference above.
        * `external_network_id` - See Argument Reference above.
        * `fixed_network` - See Argument Reference above.
        * `fixed_subnet` - See Argument Reference above.
        * `flavor` - See Argument Reference above.
        * `master_flavor` - See Argument Reference above.
        * `floating_ip_enabled` - See Argument Reference above.
        * `http_proxy` - See Argument Reference above.
        * `https_proxy` - See Argument Reference above.
        * `image` - See Argument Reference above.
        * `insecure_registry` - See Argument Reference above.
        * `keypair_id` - See Argument Reference above.
        * `labels` - See Argument Reference above.
        * `links` - A list containing associated cluster template links.
        * `master_lb_enabled` - See Argument Reference above.
        * `network_driver` - See Argument Reference above.
        * `no_proxy` - See Argument Reference above.
        * `public` - See Argument Reference above.
        * `registry_enabled` - See Argument Reference above.
        * `server_type` - See Argument Reference above.
        * `tls_disabled` - See Argument Reference above.
        * `volume_driver` - See Argument Reference above.

        ## Import

        Cluster templates can be imported using the `id`, e.g.

        ```sh
         $ pulumi import openstack:containerinfra/clusterTemplate:ClusterTemplate clustertemplate_1 b9a45c5c-cd03-4958-82aa-b80bf93cb922
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for 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__['apiserver_port'] = apiserver_port
            __props__['cluster_distro'] = cluster_distro
            if coe is None and not opts.urn:
                raise TypeError("Missing required property 'coe'")
            __props__['coe'] = coe
            __props__['dns_nameserver'] = dns_nameserver
            __props__['docker_storage_driver'] = docker_storage_driver
            __props__['docker_volume_size'] = docker_volume_size
            __props__['external_network_id'] = external_network_id
            __props__['fixed_network'] = fixed_network
            __props__['fixed_subnet'] = fixed_subnet
            __props__['flavor'] = flavor
            __props__['floating_ip_enabled'] = floating_ip_enabled
            __props__['http_proxy'] = http_proxy
            __props__['https_proxy'] = https_proxy
            if image is None and not opts.urn:
                raise TypeError("Missing required property 'image'")
            __props__['image'] = image
            __props__['insecure_registry'] = insecure_registry
            __props__['keypair_id'] = keypair_id
            __props__['labels'] = labels
            __props__['master_flavor'] = master_flavor
            __props__['master_lb_enabled'] = master_lb_enabled
            __props__['name'] = name
            __props__['network_driver'] = network_driver
            __props__['no_proxy'] = no_proxy
            __props__['public'] = public
            __props__['region'] = region
            __props__['registry_enabled'] = registry_enabled
            __props__['server_type'] = server_type
            __props__['tls_disabled'] = tls_disabled
            __props__['volume_driver'] = volume_driver
            __props__['created_at'] = None
            __props__['project_id'] = None
            __props__['updated_at'] = None
            __props__['user_id'] = None
        super(ClusterTemplate, __self__).__init__(
            'openstack:containerinfra/clusterTemplate:ClusterTemplate',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            apiserver_port: Optional[pulumi.Input[int]] = None,
            cluster_distro: Optional[pulumi.Input[str]] = None,
            coe: Optional[pulumi.Input[str]] = None,
            created_at: Optional[pulumi.Input[str]] = None,
            dns_nameserver: Optional[pulumi.Input[str]] = None,
            docker_storage_driver: Optional[pulumi.Input[str]] = None,
            docker_volume_size: Optional[pulumi.Input[int]] = None,
            external_network_id: Optional[pulumi.Input[str]] = None,
            fixed_network: Optional[pulumi.Input[str]] = None,
            fixed_subnet: Optional[pulumi.Input[str]] = None,
            flavor: Optional[pulumi.Input[str]] = None,
            floating_ip_enabled: Optional[pulumi.Input[bool]] = None,
            http_proxy: Optional[pulumi.Input[str]] = None,
            https_proxy: Optional[pulumi.Input[str]] = None,
            image: Optional[pulumi.Input[str]] = None,
            insecure_registry: Optional[pulumi.Input[str]] = None,
            keypair_id: Optional[pulumi.Input[str]] = None,
            labels: Optional[pulumi.Input[Mapping[str, Any]]] = None,
            master_flavor: Optional[pulumi.Input[str]] = None,
            master_lb_enabled: Optional[pulumi.Input[bool]] = None,
            name: Optional[pulumi.Input[str]] = None,
            network_driver: Optional[pulumi.Input[str]] = None,
            no_proxy: Optional[pulumi.Input[str]] = None,
            project_id: Optional[pulumi.Input[str]] = None,
            public: Optional[pulumi.Input[bool]] = None,
            region: Optional[pulumi.Input[str]] = None,
            registry_enabled: Optional[pulumi.Input[bool]] = None,
            server_type: Optional[pulumi.Input[str]] = None,
            tls_disabled: Optional[pulumi.Input[bool]] = None,
            updated_at: Optional[pulumi.Input[str]] = None,
            user_id: Optional[pulumi.Input[str]] = None,
            volume_driver: Optional[pulumi.Input[str]] = None) -> 'ClusterTemplate':
        """
        Get an existing ClusterTemplate 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.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["apiserver_port"] = apiserver_port
        __props__["cluster_distro"] = cluster_distro
        __props__["coe"] = coe
        __props__["created_at"] = created_at
        __props__["dns_nameserver"] = dns_nameserver
        __props__["docker_storage_driver"] = docker_storage_driver
        __props__["docker_volume_size"] = docker_volume_size
        __props__["external_network_id"] = external_network_id
        __props__["fixed_network"] = fixed_network
        __props__["fixed_subnet"] = fixed_subnet
        __props__["flavor"] = flavor
        __props__["floating_ip_enabled"] = floating_ip_enabled
        __props__["http_proxy"] = http_proxy
        __props__["https_proxy"] = https_proxy
        __props__["image"] = image
        __props__["insecure_registry"] = insecure_registry
        __props__["keypair_id"] = keypair_id
        __props__["labels"] = labels
        __props__["master_flavor"] = master_flavor
        __props__["master_lb_enabled"] = master_lb_enabled
        __props__["name"] = name
        __props__["network_driver"] = network_driver
        __props__["no_proxy"] = no_proxy
        __props__["project_id"] = project_id
        __props__["public"] = public
        __props__["region"] = region
        __props__["registry_enabled"] = registry_enabled
        __props__["server_type"] = server_type
        __props__["tls_disabled"] = tls_disabled
        __props__["updated_at"] = updated_at
        __props__["user_id"] = user_id
        __props__["volume_driver"] = volume_driver
        return ClusterTemplate(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="apiserverPort")
    def apiserver_port(self) -> pulumi.Output[Optional[int]]:
        return pulumi.get(self, "apiserver_port")

    @property
    @pulumi.getter(name="clusterDistro")
    def cluster_distro(self) -> pulumi.Output[str]:
        return pulumi.get(self, "cluster_distro")

    @property
    @pulumi.getter
    def coe(self) -> pulumi.Output[str]:
        return pulumi.get(self, "coe")

    @property
    @pulumi.getter(name="createdAt")
    def created_at(self) -> pulumi.Output[str]:
        return pulumi.get(self, "created_at")

    @property
    @pulumi.getter(name="dnsNameserver")
    def dns_nameserver(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "dns_nameserver")

    @property
    @pulumi.getter(name="dockerStorageDriver")
    def docker_storage_driver(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "docker_storage_driver")

    @property
    @pulumi.getter(name="dockerVolumeSize")
    def docker_volume_size(self) -> pulumi.Output[Optional[int]]:
        return pulumi.get(self, "docker_volume_size")

    @property
    @pulumi.getter(name="externalNetworkId")
    def external_network_id(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "external_network_id")

    @property
    @pulumi.getter(name="fixedNetwork")
    def fixed_network(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "fixed_network")

    @property
    @pulumi.getter(name="fixedSubnet")
    def fixed_subnet(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "fixed_subnet")

    @property
    @pulumi.getter
    def flavor(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "flavor")

    @property
    @pulumi.getter(name="floatingIpEnabled")
    def floating_ip_enabled(self) -> pulumi.Output[Optional[bool]]:
        return pulumi.get(self, "floating_ip_enabled")

    @property
    @pulumi.getter(name="httpProxy")
    def http_proxy(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "http_proxy")

    @property
    @pulumi.getter(name="httpsProxy")
    def https_proxy(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "https_proxy")

    @property
    @pulumi.getter
    def image(self) -> pulumi.Output[str]:
        return pulumi.get(self, "image")

    @property
    @pulumi.getter(name="insecureRegistry")
    def insecure_registry(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "insecure_registry")

    @property
    @pulumi.getter(name="keypairId")
    def keypair_id(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "keypair_id")

    @property
    @pulumi.getter
    def labels(self) -> pulumi.Output[Optional[Mapping[str, Any]]]:
        return pulumi.get(self, "labels")

    @property
    @pulumi.getter(name="masterFlavor")
    def master_flavor(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "master_flavor")

    @property
    @pulumi.getter(name="masterLbEnabled")
    def master_lb_enabled(self) -> pulumi.Output[Optional[bool]]:
        return pulumi.get(self, "master_lb_enabled")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="networkDriver")
    def network_driver(self) -> pulumi.Output[str]:
        return pulumi.get(self, "network_driver")

    @property
    @pulumi.getter(name="noProxy")
    def no_proxy(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "no_proxy")

    @property
    @pulumi.getter(name="projectId")
    def project_id(self) -> pulumi.Output[str]:
        return pulumi.get(self, "project_id")

    @property
    @pulumi.getter
    def public(self) -> pulumi.Output[Optional[bool]]:
        return pulumi.get(self, "public")

    @property
    @pulumi.getter
    def region(self) -> pulumi.Output[str]:
        return pulumi.get(self, "region")

    @property
    @pulumi.getter(name="registryEnabled")
    def registry_enabled(self) -> pulumi.Output[Optional[bool]]:
        return pulumi.get(self, "registry_enabled")

    @property
    @pulumi.getter(name="serverType")
    def server_type(self) -> pulumi.Output[str]:
        return pulumi.get(self, "server_type")

    @property
    @pulumi.getter(name="tlsDisabled")
    def tls_disabled(self) -> pulumi.Output[Optional[bool]]:
        return pulumi.get(self, "tls_disabled")

    @property
    @pulumi.getter(name="updatedAt")
    def updated_at(self) -> pulumi.Output[str]:
        return pulumi.get(self, "updated_at")

    @property
    @pulumi.getter(name="userId")
    def user_id(self) -> pulumi.Output[str]:
        return pulumi.get(self, "user_id")

    @property
    @pulumi.getter(name="volumeDriver")
    def volume_driver(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "volume_driver")

    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

