# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** 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__ = ['EnvVarArgs', 'EnvVar']

@pulumi.input_type
class EnvVarArgs:
    def __init__(__self__, *,
                 env_var_key: Optional[pulumi.Input[_builtins.str]] = None,
                 generate_value: Optional[pulumi.Input[_builtins.bool]] = None,
                 service_id: Optional[pulumi.Input[_builtins.str]] = None,
                 value: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a EnvVar resource.
        :param pulumi.Input[_builtins.str] env_var_key: The name of the environment variable
        :param pulumi.Input[_builtins.str] service_id: The ID of the service
        """
        if env_var_key is not None:
            pulumi.set(__self__, "env_var_key", env_var_key)
        if generate_value is not None:
            pulumi.set(__self__, "generate_value", generate_value)
        if service_id is not None:
            pulumi.set(__self__, "service_id", service_id)
        if value is not None:
            pulumi.set(__self__, "value", value)

    @_builtins.property
    @pulumi.getter(name="envVarKey")
    def env_var_key(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The name of the environment variable
        """
        return pulumi.get(self, "env_var_key")

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

    @_builtins.property
    @pulumi.getter(name="generateValue")
    def generate_value(self) -> Optional[pulumi.Input[_builtins.bool]]:
        return pulumi.get(self, "generate_value")

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

    @_builtins.property
    @pulumi.getter(name="serviceId")
    def service_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID of the service
        """
        return pulumi.get(self, "service_id")

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

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

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


@pulumi.type_token("render:services:EnvVar")
class EnvVar(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 env_var_key: Optional[pulumi.Input[_builtins.str]] = None,
                 generate_value: Optional[pulumi.Input[_builtins.bool]] = None,
                 service_id: Optional[pulumi.Input[_builtins.str]] = None,
                 value: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        Create a EnvVar 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.str] env_var_key: The name of the environment variable
        :param pulumi.Input[_builtins.str] service_id: The ID of the service
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: Optional[EnvVarArgs] = None,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Create a EnvVar resource with the given unique name, props, and options.
        :param str resource_name: The name of the resource.
        :param EnvVarArgs 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(EnvVarArgs, 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,
                 env_var_key: Optional[pulumi.Input[_builtins.str]] = None,
                 generate_value: Optional[pulumi.Input[_builtins.bool]] = None,
                 service_id: Optional[pulumi.Input[_builtins.str]] = None,
                 value: Optional[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 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__ = EnvVarArgs.__new__(EnvVarArgs)

            __props__.__dict__["env_var_key"] = env_var_key
            __props__.__dict__["generate_value"] = generate_value
            __props__.__dict__["service_id"] = service_id
            __props__.__dict__["value"] = value
            __props__.__dict__["key"] = None
        super(EnvVar, __self__).__init__(
            'render:services:EnvVar',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None) -> 'EnvVar':
        """
        Get an existing EnvVar 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__ = EnvVarArgs.__new__(EnvVarArgs)

        __props__.__dict__["generate_value"] = None
        __props__.__dict__["key"] = None
        __props__.__dict__["value"] = None
        return EnvVar(resource_name, opts=opts, __props__=__props__)

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

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

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

