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

__all__ = ['VaultConfigurationArgs', 'VaultConfiguration']

@pulumi.input_type
class VaultConfigurationArgs:
    def __init__(__self__, *,
                 config: pulumi.Input['VaultConfigurationConfigArgs'],
                 name: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a VaultConfiguration resource.
        :param pulumi.Input[str] name: Name of the Vault configuration
        """
        pulumi.set(__self__, "config", config)
        if name is not None:
            pulumi.set(__self__, "name", name)

    @property
    @pulumi.getter
    def config(self) -> pulumi.Input['VaultConfigurationConfigArgs']:
        return pulumi.get(self, "config")

    @config.setter
    def config(self, value: pulumi.Input['VaultConfigurationConfigArgs']):
        pulumi.set(self, "config", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        Name of the Vault configuration
        """
        return pulumi.get(self, "name")

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


@pulumi.input_type
class _VaultConfigurationState:
    def __init__(__self__, *,
                 config: Optional[pulumi.Input['VaultConfigurationConfigArgs']] = None,
                 name: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering VaultConfiguration resources.
        :param pulumi.Input[str] name: Name of the Vault configuration
        """
        if config is not None:
            pulumi.set(__self__, "config", config)
        if name is not None:
            pulumi.set(__self__, "name", name)

    @property
    @pulumi.getter
    def config(self) -> Optional[pulumi.Input['VaultConfigurationConfigArgs']]:
        return pulumi.get(self, "config")

    @config.setter
    def config(self, value: Optional[pulumi.Input['VaultConfigurationConfigArgs']]):
        pulumi.set(self, "config", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        Name of the Vault configuration
        """
        return pulumi.get(self, "name")

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


class VaultConfiguration(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 config: Optional[pulumi.Input[pulumi.InputType['VaultConfigurationConfigArgs']]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        This resource enables you to configure an external vault connector to use as a centralized secret management tool for the keys used to sign packages. For more information, see [JFrog documentation](https://jfrog.com/help/r/jfrog-platform-administration-documentation/vault).
        This feature is supported with Enterprise X and Enterprise+ licenses.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_artifactory as artifactory
        import pulumi_std as std

        my_vault_config_app_role = artifactory.VaultConfiguration("my-vault-config-app-role",
            name="my-vault-config-app-role",
            config=artifactory.VaultConfigurationConfigArgs(
                url="http://127.0.0.1:8200",
                auth=artifactory.VaultConfigurationConfigAuthArgs(
                    type="AppRole",
                    role_id="1b62ff05...",
                    secret_id="acbd6657...",
                ),
                mounts=[artifactory.VaultConfigurationConfigMountArgs(
                    path="secret",
                    type="KV2",
                )],
            ))
        my_vault_config_cert = artifactory.VaultConfiguration("my-vault-config-cert",
            name="my-vault-config-cert",
            config=artifactory.VaultConfigurationConfigArgs(
                url="http://127.0.0.1:8200",
                auth=artifactory.VaultConfigurationConfigAuthArgs(
                    type="Certificate",
                    certificate=std.file(input="samples/public.pem").result,
                    certificate_key=std.file(input="samples/private.pem").result,
                ),
                mounts=[artifactory.VaultConfigurationConfigMountArgs(
                    path="secret",
                    type="KV2",
                )],
            ))
        ```

        ## Import

        ```sh
        $ pulumi import artifactory:index/vaultConfiguration:VaultConfiguration my-vault-config my-vault-config
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] name: Name of the Vault configuration
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: VaultConfigurationArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        This resource enables you to configure an external vault connector to use as a centralized secret management tool for the keys used to sign packages. For more information, see [JFrog documentation](https://jfrog.com/help/r/jfrog-platform-administration-documentation/vault).
        This feature is supported with Enterprise X and Enterprise+ licenses.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_artifactory as artifactory
        import pulumi_std as std

        my_vault_config_app_role = artifactory.VaultConfiguration("my-vault-config-app-role",
            name="my-vault-config-app-role",
            config=artifactory.VaultConfigurationConfigArgs(
                url="http://127.0.0.1:8200",
                auth=artifactory.VaultConfigurationConfigAuthArgs(
                    type="AppRole",
                    role_id="1b62ff05...",
                    secret_id="acbd6657...",
                ),
                mounts=[artifactory.VaultConfigurationConfigMountArgs(
                    path="secret",
                    type="KV2",
                )],
            ))
        my_vault_config_cert = artifactory.VaultConfiguration("my-vault-config-cert",
            name="my-vault-config-cert",
            config=artifactory.VaultConfigurationConfigArgs(
                url="http://127.0.0.1:8200",
                auth=artifactory.VaultConfigurationConfigAuthArgs(
                    type="Certificate",
                    certificate=std.file(input="samples/public.pem").result,
                    certificate_key=std.file(input="samples/private.pem").result,
                ),
                mounts=[artifactory.VaultConfigurationConfigMountArgs(
                    path="secret",
                    type="KV2",
                )],
            ))
        ```

        ## Import

        ```sh
        $ pulumi import artifactory:index/vaultConfiguration:VaultConfiguration my-vault-config my-vault-config
        ```

        :param str resource_name: The name of the resource.
        :param VaultConfigurationArgs 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(VaultConfigurationArgs, 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,
                 config: Optional[pulumi.Input[pulumi.InputType['VaultConfigurationConfigArgs']]] = None,
                 name: Optional[pulumi.Input[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 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__ = VaultConfigurationArgs.__new__(VaultConfigurationArgs)

            if config is None and not opts.urn:
                raise TypeError("Missing required property 'config'")
            __props__.__dict__["config"] = config
            __props__.__dict__["name"] = name
        super(VaultConfiguration, __self__).__init__(
            'artifactory:index/vaultConfiguration:VaultConfiguration',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            config: Optional[pulumi.Input[pulumi.InputType['VaultConfigurationConfigArgs']]] = None,
            name: Optional[pulumi.Input[str]] = None) -> 'VaultConfiguration':
        """
        Get an existing VaultConfiguration 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] name: Name of the Vault configuration
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _VaultConfigurationState.__new__(_VaultConfigurationState)

        __props__.__dict__["config"] = config
        __props__.__dict__["name"] = name
        return VaultConfiguration(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def config(self) -> pulumi.Output['outputs.VaultConfigurationConfig']:
        return pulumi.get(self, "config")

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

