# coding=utf-8
# *** WARNING: this file was generated by Pulumi SDK Generator. ***
# *** 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

__all__ = ['BastionArgs', 'Bastion']

@pulumi.input_type
class BastionArgs:
    def __init__(__self__, *,
                 high_availability: Optional[pulumi.Input[_builtins.bool]] = None,
                 location: pulumi.Input[_builtins.str],
                 resource_group_name: pulumi.Input[_builtins.str],
                 routes: pulumi.Input[Sequence[pulumi.Input[_builtins.str]]],
                 subnet_id: pulumi.Input[_builtins.str],
                 tailscale_tags: pulumi.Input[Sequence[pulumi.Input[_builtins.str]]],
                 enable_ssh: Optional[pulumi.Input[_builtins.bool]] = None,
                 instance_sku: Optional[pulumi.Input[_builtins.str]] = None,
                 public: Optional[pulumi.Input[_builtins.bool]] = None):
        """
        The set of arguments for constructing a Bastion resource.
        :param pulumi.Input[_builtins.bool] high_availability: Whether the bastion should be highly available.
        :param pulumi.Input[_builtins.str] location: The Azure region you're using.
        :param pulumi.Input[_builtins.str] resource_group_name: The Azure resource group to create the bastion in.
        :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] routes: The routes you'd like to advertise via tailscale.
        :param pulumi.Input[_builtins.str] subnet_id: The subnet Ids to launch instances in.
        :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] tailscale_tags: The tags to apply to the tailnet device andauth key. This tag should be added to your oauth key and ACL.
        :param pulumi.Input[_builtins.bool] enable_ssh: Whether to enable SSH access to the bastion.
        :param pulumi.Input[_builtins.str] instance_sku: The Azure instance SKU to use for the bastion.
        :param pulumi.Input[_builtins.bool] public: Whether the bastion should have a public IP.
        """
        if high_availability is None:
            high_availability = False
        pulumi.set(__self__, "high_availability", high_availability)
        pulumi.set(__self__, "location", location)
        pulumi.set(__self__, "resource_group_name", resource_group_name)
        pulumi.set(__self__, "routes", routes)
        pulumi.set(__self__, "subnet_id", subnet_id)
        pulumi.set(__self__, "tailscale_tags", tailscale_tags)
        if enable_ssh is None:
            enable_ssh = True
        if enable_ssh is not None:
            pulumi.set(__self__, "enable_ssh", enable_ssh)
        if instance_sku is not None:
            pulumi.set(__self__, "instance_sku", instance_sku)
        if public is None:
            public = False
        if public is not None:
            pulumi.set(__self__, "public", public)

    @_builtins.property
    @pulumi.getter(name="highAvailability")
    def high_availability(self) -> pulumi.Input[_builtins.bool]:
        """
        Whether the bastion should be highly available.
        """
        return pulumi.get(self, "high_availability")

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

    @_builtins.property
    @pulumi.getter
    def location(self) -> pulumi.Input[_builtins.str]:
        """
        The Azure region you're using.
        """
        return pulumi.get(self, "location")

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

    @_builtins.property
    @pulumi.getter(name="resourceGroupName")
    def resource_group_name(self) -> pulumi.Input[_builtins.str]:
        """
        The Azure resource group to create the bastion in.
        """
        return pulumi.get(self, "resource_group_name")

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

    @_builtins.property
    @pulumi.getter
    def routes(self) -> pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]:
        """
        The routes you'd like to advertise via tailscale.
        """
        return pulumi.get(self, "routes")

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

    @_builtins.property
    @pulumi.getter(name="subnetId")
    def subnet_id(self) -> pulumi.Input[_builtins.str]:
        """
        The subnet Ids to launch instances in.
        """
        return pulumi.get(self, "subnet_id")

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

    @_builtins.property
    @pulumi.getter(name="tailscaleTags")
    def tailscale_tags(self) -> pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]:
        """
        The tags to apply to the tailnet device andauth key. This tag should be added to your oauth key and ACL.
        """
        return pulumi.get(self, "tailscale_tags")

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

    @_builtins.property
    @pulumi.getter(name="enableSSH")
    def enable_ssh(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Whether to enable SSH access to the bastion.
        """
        return pulumi.get(self, "enable_ssh")

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

    @_builtins.property
    @pulumi.getter(name="instanceSku")
    def instance_sku(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The Azure instance SKU to use for the bastion.
        """
        return pulumi.get(self, "instance_sku")

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

    @_builtins.property
    @pulumi.getter
    def public(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Whether the bastion should have a public IP.
        """
        return pulumi.get(self, "public")

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


@pulumi.type_token("tailscale-bastion:azure:Bastion")
class Bastion(pulumi.ComponentResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 enable_ssh: Optional[pulumi.Input[_builtins.bool]] = None,
                 high_availability: Optional[pulumi.Input[_builtins.bool]] = None,
                 instance_sku: Optional[pulumi.Input[_builtins.str]] = None,
                 location: Optional[pulumi.Input[_builtins.str]] = None,
                 public: Optional[pulumi.Input[_builtins.bool]] = None,
                 resource_group_name: Optional[pulumi.Input[_builtins.str]] = None,
                 routes: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
                 subnet_id: Optional[pulumi.Input[_builtins.str]] = None,
                 tailscale_tags: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
                 __props__=None):
        """
        Create a Bastion 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[_builtins.bool] enable_ssh: Whether to enable SSH access to the bastion.
        :param pulumi.Input[_builtins.bool] high_availability: Whether the bastion should be highly available.
        :param pulumi.Input[_builtins.str] instance_sku: The Azure instance SKU to use for the bastion.
        :param pulumi.Input[_builtins.str] location: The Azure region you're using.
        :param pulumi.Input[_builtins.bool] public: Whether the bastion should have a public IP.
        :param pulumi.Input[_builtins.str] resource_group_name: The Azure resource group to create the bastion in.
        :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] routes: The routes you'd like to advertise via tailscale.
        :param pulumi.Input[_builtins.str] subnet_id: The subnet Ids to launch instances in.
        :param pulumi.Input[Sequence[pulumi.Input[_builtins.str]]] tailscale_tags: The tags to apply to the tailnet device andauth key. This tag should be added to your oauth key and ACL.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: BastionArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Create a Bastion resource with the given unique name, props, and options.
        :param str resource_name: The name of the resource.
        :param BastionArgs 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(BastionArgs, 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,
                 enable_ssh: Optional[pulumi.Input[_builtins.bool]] = None,
                 high_availability: Optional[pulumi.Input[_builtins.bool]] = None,
                 instance_sku: Optional[pulumi.Input[_builtins.str]] = None,
                 location: Optional[pulumi.Input[_builtins.str]] = None,
                 public: Optional[pulumi.Input[_builtins.bool]] = None,
                 resource_group_name: Optional[pulumi.Input[_builtins.str]] = None,
                 routes: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = None,
                 subnet_id: Optional[pulumi.Input[_builtins.str]] = None,
                 tailscale_tags: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.str]]]] = 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 not None:
            raise ValueError('ComponentResource classes do not support opts.id')
        else:
            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__ = BastionArgs.__new__(BastionArgs)

            if enable_ssh is None:
                enable_ssh = True
            __props__.__dict__["enable_ssh"] = enable_ssh
            if high_availability is None:
                high_availability = False
            if high_availability is None and not opts.urn:
                raise TypeError("Missing required property 'high_availability'")
            __props__.__dict__["high_availability"] = high_availability
            __props__.__dict__["instance_sku"] = instance_sku
            if location is None and not opts.urn:
                raise TypeError("Missing required property 'location'")
            __props__.__dict__["location"] = location
            if public is None:
                public = False
            __props__.__dict__["public"] = public
            if resource_group_name is None and not opts.urn:
                raise TypeError("Missing required property 'resource_group_name'")
            __props__.__dict__["resource_group_name"] = resource_group_name
            if routes is None and not opts.urn:
                raise TypeError("Missing required property 'routes'")
            __props__.__dict__["routes"] = routes
            if subnet_id is None and not opts.urn:
                raise TypeError("Missing required property 'subnet_id'")
            __props__.__dict__["subnet_id"] = subnet_id
            if tailscale_tags is None and not opts.urn:
                raise TypeError("Missing required property 'tailscale_tags'")
            __props__.__dict__["tailscale_tags"] = tailscale_tags
            __props__.__dict__["private_key"] = None
            __props__.__dict__["scale_set_name"] = None
        super(Bastion, __self__).__init__(
            'tailscale-bastion:azure:Bastion',
            resource_name,
            __props__,
            opts,
            remote=True)

    @_builtins.property
    @pulumi.getter(name="privateKey")
    def private_key(self) -> pulumi.Output[_builtins.str]:
        """
        The SSH private key to access your bastion
        """
        return pulumi.get(self, "private_key")

    @_builtins.property
    @pulumi.getter(name="scaleSetName")
    def scale_set_name(self) -> pulumi.Output[_builtins.str]:
        """
        The name of the Scaleset that managed the bastion instances
        """
        return pulumi.get(self, "scale_set_name")

