# 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

__all__ = ['GcpPrivatelinkConnectionApprovalArgs', 'GcpPrivatelinkConnectionApproval']

@pulumi.input_type
class GcpPrivatelinkConnectionApprovalArgs:
    def __init__(__self__, *,
                 project: pulumi.Input[str],
                 service_name: pulumi.Input[str],
                 user_ip_address: pulumi.Input[str]):
        """
        The set of arguments for constructing a GcpPrivatelinkConnectionApproval resource.
        :param pulumi.Input[str] project: The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        :param pulumi.Input[str] service_name: The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        :param pulumi.Input[str] user_ip_address: The Private Service Connect connection user IP address.
        """
        pulumi.set(__self__, "project", project)
        pulumi.set(__self__, "service_name", service_name)
        pulumi.set(__self__, "user_ip_address", user_ip_address)

    @property
    @pulumi.getter
    def project(self) -> pulumi.Input[str]:
        """
        The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "project")

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

    @property
    @pulumi.getter(name="serviceName")
    def service_name(self) -> pulumi.Input[str]:
        """
        The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "service_name")

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

    @property
    @pulumi.getter(name="userIpAddress")
    def user_ip_address(self) -> pulumi.Input[str]:
        """
        The Private Service Connect connection user IP address.
        """
        return pulumi.get(self, "user_ip_address")

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


@pulumi.input_type
class _GcpPrivatelinkConnectionApprovalState:
    def __init__(__self__, *,
                 privatelink_connection_id: Optional[pulumi.Input[str]] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 psc_connection_id: Optional[pulumi.Input[str]] = None,
                 service_name: Optional[pulumi.Input[str]] = None,
                 state: Optional[pulumi.Input[str]] = None,
                 user_ip_address: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering GcpPrivatelinkConnectionApproval resources.
        :param pulumi.Input[str] privatelink_connection_id: Aiven internal ID for the private link connection.
        :param pulumi.Input[str] project: The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        :param pulumi.Input[str] psc_connection_id: The Google Private Service Connect connection ID.
        :param pulumi.Input[str] service_name: The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        :param pulumi.Input[str] state: The state of the connection.
        :param pulumi.Input[str] user_ip_address: The Private Service Connect connection user IP address.
        """
        if privatelink_connection_id is not None:
            pulumi.set(__self__, "privatelink_connection_id", privatelink_connection_id)
        if project is not None:
            pulumi.set(__self__, "project", project)
        if psc_connection_id is not None:
            pulumi.set(__self__, "psc_connection_id", psc_connection_id)
        if service_name is not None:
            pulumi.set(__self__, "service_name", service_name)
        if state is not None:
            pulumi.set(__self__, "state", state)
        if user_ip_address is not None:
            pulumi.set(__self__, "user_ip_address", user_ip_address)

    @property
    @pulumi.getter(name="privatelinkConnectionId")
    def privatelink_connection_id(self) -> Optional[pulumi.Input[str]]:
        """
        Aiven internal ID for the private link connection.
        """
        return pulumi.get(self, "privatelink_connection_id")

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

    @property
    @pulumi.getter
    def project(self) -> Optional[pulumi.Input[str]]:
        """
        The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "project")

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

    @property
    @pulumi.getter(name="pscConnectionId")
    def psc_connection_id(self) -> Optional[pulumi.Input[str]]:
        """
        The Google Private Service Connect connection ID.
        """
        return pulumi.get(self, "psc_connection_id")

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

    @property
    @pulumi.getter(name="serviceName")
    def service_name(self) -> Optional[pulumi.Input[str]]:
        """
        The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "service_name")

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

    @property
    @pulumi.getter
    def state(self) -> Optional[pulumi.Input[str]]:
        """
        The state of the connection.
        """
        return pulumi.get(self, "state")

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

    @property
    @pulumi.getter(name="userIpAddress")
    def user_ip_address(self) -> Optional[pulumi.Input[str]]:
        """
        The Private Service Connect connection user IP address.
        """
        return pulumi.get(self, "user_ip_address")

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


class GcpPrivatelinkConnectionApproval(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 project: Optional[pulumi.Input[str]] = None,
                 service_name: Optional[pulumi.Input[str]] = None,
                 user_ip_address: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Approves a Google Private Service Connect connection to an Aiven service with an associated endpoint IP.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_aiven as aiven

        approve = aiven.GcpPrivatelinkConnectionApproval("approve",
            project=example_project["project"],
            service_name=example_kafka["serviceName"],
            user_ip_address="10.0.0.100")
        ```

        ## Import

        ```sh
        $ pulumi import aiven:index/gcpPrivatelinkConnectionApproval:GcpPrivatelinkConnectionApproval main PROJECT/SERVICE_NAME
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] project: The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        :param pulumi.Input[str] service_name: The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        :param pulumi.Input[str] user_ip_address: The Private Service Connect connection user IP address.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: GcpPrivatelinkConnectionApprovalArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Approves a Google Private Service Connect connection to an Aiven service with an associated endpoint IP.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_aiven as aiven

        approve = aiven.GcpPrivatelinkConnectionApproval("approve",
            project=example_project["project"],
            service_name=example_kafka["serviceName"],
            user_ip_address="10.0.0.100")
        ```

        ## Import

        ```sh
        $ pulumi import aiven:index/gcpPrivatelinkConnectionApproval:GcpPrivatelinkConnectionApproval main PROJECT/SERVICE_NAME
        ```

        :param str resource_name: The name of the resource.
        :param GcpPrivatelinkConnectionApprovalArgs 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(GcpPrivatelinkConnectionApprovalArgs, 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,
                 project: Optional[pulumi.Input[str]] = None,
                 service_name: Optional[pulumi.Input[str]] = None,
                 user_ip_address: 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__ = GcpPrivatelinkConnectionApprovalArgs.__new__(GcpPrivatelinkConnectionApprovalArgs)

            if project is None and not opts.urn:
                raise TypeError("Missing required property 'project'")
            __props__.__dict__["project"] = project
            if service_name is None and not opts.urn:
                raise TypeError("Missing required property 'service_name'")
            __props__.__dict__["service_name"] = service_name
            if user_ip_address is None and not opts.urn:
                raise TypeError("Missing required property 'user_ip_address'")
            __props__.__dict__["user_ip_address"] = user_ip_address
            __props__.__dict__["privatelink_connection_id"] = None
            __props__.__dict__["psc_connection_id"] = None
            __props__.__dict__["state"] = None
        super(GcpPrivatelinkConnectionApproval, __self__).__init__(
            'aiven:index/gcpPrivatelinkConnectionApproval:GcpPrivatelinkConnectionApproval',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            privatelink_connection_id: Optional[pulumi.Input[str]] = None,
            project: Optional[pulumi.Input[str]] = None,
            psc_connection_id: Optional[pulumi.Input[str]] = None,
            service_name: Optional[pulumi.Input[str]] = None,
            state: Optional[pulumi.Input[str]] = None,
            user_ip_address: Optional[pulumi.Input[str]] = None) -> 'GcpPrivatelinkConnectionApproval':
        """
        Get an existing GcpPrivatelinkConnectionApproval 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] privatelink_connection_id: Aiven internal ID for the private link connection.
        :param pulumi.Input[str] project: The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        :param pulumi.Input[str] psc_connection_id: The Google Private Service Connect connection ID.
        :param pulumi.Input[str] service_name: The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        :param pulumi.Input[str] state: The state of the connection.
        :param pulumi.Input[str] user_ip_address: The Private Service Connect connection user IP address.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _GcpPrivatelinkConnectionApprovalState.__new__(_GcpPrivatelinkConnectionApprovalState)

        __props__.__dict__["privatelink_connection_id"] = privatelink_connection_id
        __props__.__dict__["project"] = project
        __props__.__dict__["psc_connection_id"] = psc_connection_id
        __props__.__dict__["service_name"] = service_name
        __props__.__dict__["state"] = state
        __props__.__dict__["user_ip_address"] = user_ip_address
        return GcpPrivatelinkConnectionApproval(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="privatelinkConnectionId")
    def privatelink_connection_id(self) -> pulumi.Output[str]:
        """
        Aiven internal ID for the private link connection.
        """
        return pulumi.get(self, "privatelink_connection_id")

    @property
    @pulumi.getter
    def project(self) -> pulumi.Output[str]:
        """
        The name of the project this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "project")

    @property
    @pulumi.getter(name="pscConnectionId")
    def psc_connection_id(self) -> pulumi.Output[str]:
        """
        The Google Private Service Connect connection ID.
        """
        return pulumi.get(self, "psc_connection_id")

    @property
    @pulumi.getter(name="serviceName")
    def service_name(self) -> pulumi.Output[str]:
        """
        The name of the service that this resource belongs to. To set up proper dependencies please refer to this variable as a reference. Changing this property forces recreation of the resource.
        """
        return pulumi.get(self, "service_name")

    @property
    @pulumi.getter
    def state(self) -> pulumi.Output[str]:
        """
        The state of the connection.
        """
        return pulumi.get(self, "state")

    @property
    @pulumi.getter(name="userIpAddress")
    def user_ip_address(self) -> pulumi.Output[str]:
        """
        The Private Service Connect connection user IP address.
        """
        return pulumi.get(self, "user_ip_address")

