# 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 json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables

class Service(pulumi.CustomResource):
    description: pulumi.Output[str]
    """
    The function compute service description.
    """
    internet_access: pulumi.Output[bool]
    """
    Whether to allow the service to access Internet. Default to "true".
    """
    last_modified: pulumi.Output[str]
    """
    The date this resource was last modified.
    """
    log_config: pulumi.Output[dict]
    """
    Provide this to store your FC service logs. Fields documented below. See [Create a Service](https://www.alibabacloud.com/help/doc-detail/51924.htm).
    
      * `logstore` (`str`) - The log store name of Logs service.
      * `project` (`str`) - The project name of Logs service.
    """
    name: pulumi.Output[str]
    """
    The Function Compute service name. It is the only in one Alicloud account and is conflict with "name_prefix".
    """
    name_prefix: pulumi.Output[str]
    """
    Setting a prefix to get a only name. It is conflict with "name".
    """
    role: pulumi.Output[str]
    """
    RAM role arn attached to the Function Compute service. This governs both who / what can invoke your Function, as well as what resources our Function has access to. See [User Permissions](https://www.alibabacloud.com/help/doc-detail/52885.htm) for more details.
    """
    service_id: pulumi.Output[str]
    """
    The Function Compute service ID.
    """
    vpc_config: pulumi.Output[dict]
    """
    Provide this to allow your FC service to access your VPC. Fields documented below. See [Function Compute Service in VPC](https://www.alibabacloud.com/help/faq-detail/72959.htm).
    
      * `security_group_id` (`str`) - A security group ID associated with the FC service.
      * `vpc_id` (`str`)
      * `vswitch_ids` (`list`) - A list of vswitch IDs associated with the FC service.
    """
    def __init__(__self__, resource_name, opts=None, description=None, internet_access=None, log_config=None, name=None, name_prefix=None, role=None, vpc_config=None, __props__=None, __name__=None, __opts__=None):
        """
        Create a Service 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[str] description: The function compute service description.
        :param pulumi.Input[bool] internet_access: Whether to allow the service to access Internet. Default to "true".
        :param pulumi.Input[dict] log_config: Provide this to store your FC service logs. Fields documented below. See [Create a Service](https://www.alibabacloud.com/help/doc-detail/51924.htm).
        :param pulumi.Input[str] name: The Function Compute service name. It is the only in one Alicloud account and is conflict with "name_prefix".
        :param pulumi.Input[str] name_prefix: Setting a prefix to get a only name. It is conflict with "name".
        :param pulumi.Input[str] role: RAM role arn attached to the Function Compute service. This governs both who / what can invoke your Function, as well as what resources our Function has access to. See [User Permissions](https://www.alibabacloud.com/help/doc-detail/52885.htm) for more details.
        :param pulumi.Input[dict] vpc_config: Provide this to allow your FC service to access your VPC. Fields documented below. See [Function Compute Service in VPC](https://www.alibabacloud.com/help/faq-detail/72959.htm).
        
        The **log_config** object supports the following:
        
          * `logstore` (`pulumi.Input[str]`) - The log store name of Logs service.
          * `project` (`pulumi.Input[str]`) - The project name of Logs service.
        
        The **vpc_config** object supports the following:
        
          * `security_group_id` (`pulumi.Input[str]`) - A security group ID associated with the FC service.
          * `vpc_id` (`pulumi.Input[str]`)
          * `vswitch_ids` (`pulumi.Input[list]`) - A list of vswitch IDs associated with the FC service.

        > This content is derived from https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/website/docs/r/fc_service.html.markdown.
        """
        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__['description'] = description
            __props__['internet_access'] = internet_access
            __props__['log_config'] = log_config
            __props__['name'] = name
            __props__['name_prefix'] = name_prefix
            __props__['role'] = role
            __props__['vpc_config'] = vpc_config
            __props__['last_modified'] = None
            __props__['service_id'] = None
        super(Service, __self__).__init__(
            'alicloud:fc/service:Service',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, description=None, internet_access=None, last_modified=None, log_config=None, name=None, name_prefix=None, role=None, service_id=None, vpc_config=None):
        """
        Get an existing Service 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 str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] description: The function compute service description.
        :param pulumi.Input[bool] internet_access: Whether to allow the service to access Internet. Default to "true".
        :param pulumi.Input[str] last_modified: The date this resource was last modified.
        :param pulumi.Input[dict] log_config: Provide this to store your FC service logs. Fields documented below. See [Create a Service](https://www.alibabacloud.com/help/doc-detail/51924.htm).
        :param pulumi.Input[str] name: The Function Compute service name. It is the only in one Alicloud account and is conflict with "name_prefix".
        :param pulumi.Input[str] name_prefix: Setting a prefix to get a only name. It is conflict with "name".
        :param pulumi.Input[str] role: RAM role arn attached to the Function Compute service. This governs both who / what can invoke your Function, as well as what resources our Function has access to. See [User Permissions](https://www.alibabacloud.com/help/doc-detail/52885.htm) for more details.
        :param pulumi.Input[str] service_id: The Function Compute service ID.
        :param pulumi.Input[dict] vpc_config: Provide this to allow your FC service to access your VPC. Fields documented below. See [Function Compute Service in VPC](https://www.alibabacloud.com/help/faq-detail/72959.htm).
        
        The **log_config** object supports the following:
        
          * `logstore` (`pulumi.Input[str]`) - The log store name of Logs service.
          * `project` (`pulumi.Input[str]`) - The project name of Logs service.
        
        The **vpc_config** object supports the following:
        
          * `security_group_id` (`pulumi.Input[str]`) - A security group ID associated with the FC service.
          * `vpc_id` (`pulumi.Input[str]`)
          * `vswitch_ids` (`pulumi.Input[list]`) - A list of vswitch IDs associated with the FC service.

        > This content is derived from https://github.com/terraform-providers/terraform-provider-alicloud/blob/master/website/docs/r/fc_service.html.markdown.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()
        __props__["description"] = description
        __props__["internet_access"] = internet_access
        __props__["last_modified"] = last_modified
        __props__["log_config"] = log_config
        __props__["name"] = name
        __props__["name_prefix"] = name_prefix
        __props__["role"] = role
        __props__["service_id"] = service_id
        __props__["vpc_config"] = vpc_config
        return Service(resource_name, opts=opts, __props__=__props__)
    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

