Skip to content

Service

This class encapsulates and extends the ROS resource type ALIYUN::FC::Service, which is used to create a service in Function Compute.

All functions of a service share the same settings, such as permission settings and log configurations. A service can have multiple functions, all of which share service resources, such as Logstores and RAM roles.

Initializers

import ros_cdk_fc
ros_cdk_fc.Service(
  scope: Construct,
  id: str,
  service_name: typing.Union[str, IResolvable],
  deletion_force: typing.Union[bool, IResolvable] = None,
  description: typing.Union[str, IResolvable] = None,
  internet_access: typing.Union[bool, IResolvable] = None,
  log_config: typing.Union[IResolvable, LogConfigProperty] = None,
  nas_config: typing.Union[IResolvable, NasConfigProperty] = None,
  oss_mount_config: typing.Union[IResolvable, OssMountConfigProperty] = None,
  role: typing.Union[str, IResolvable] = None,
  tags: typing.List[TagsProperty] = None,
  tracing_config: typing.Union[IResolvable, TracingConfigProperty] = None,
  vpc_bindings: typing.Union[IResolvable, typing.List[typing.Union[str, IResolvable]]] = None,
  vpc_config: typing.Union[IResolvable, VpcConfigProperty] = None,
  enable_resource_property_constraint: bool = None
)
Name Type Description
scope ros_cdk_core.Construct No description.
id str No description.
service_name typing.Union[str, ros_cdk_core.IResolvable] Property serviceName: Service name.
deletion_force typing.Union[bool, ros_cdk_core.IResolvable] Property deletionForce: Whether force delete the service without waiting for network interfaces to be cleaned up if VpcConfig is specified.
description typing.Union[str, ros_cdk_core.IResolvable] Property description: Service description.
internet_access typing.Union[bool, ros_cdk_core.IResolvable] Property internetAccess: Set it to true to enable Internet access.
log_config typing.Union[ros_cdk_core.IResolvable, LogConfigProperty] Property logConfig: Log configuration.
nas_config typing.Union[ros_cdk_core.IResolvable, NasConfigProperty] Property nasConfig: NAS configuration.
oss_mount_config typing.Union[ros_cdk_core.IResolvable, OssMountConfigProperty] Property ossMountConfig: The OSS mount configurations.
role typing.Union[str, ros_cdk_core.IResolvable] Property role: The role grants Function Compute the permission to access user’s cloud resources, such as pushing logs to user’s log store.
tags typing.List[TagsProperty] Property tags: Tags to attach to service.
tracing_config typing.Union[ros_cdk_core.IResolvable, TracingConfigProperty] Property tracingConfig: The Tracing Analysis configuration.
vpc_bindings typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]] Property vpcBindings: Function Invocation only by Specified VPCs.
vpc_config typing.Union[ros_cdk_core.IResolvable, VpcConfigProperty] Property vpcConfig: VPC configuration.
enable_resource_property_constraint bool No description.

scopeRequired

  • Type: ros_cdk_core.Construct

idRequired

  • Type: str

service_nameRequired

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property serviceName: Service name.


deletion_forceOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

Property deletionForce: Whether force delete the service without waiting for network interfaces to be cleaned up if VpcConfig is specified.

Default value is false.


descriptionOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property description: Service description.


internet_accessOptional

  • Type: typing.Union[bool, ros_cdk_core.IResolvable]

Property internetAccess: Set it to true to enable Internet access.


log_configOptional

Property logConfig: Log configuration.

Function Compute pushes function execution logs to the configured log store.


nas_configOptional

Property nasConfig: NAS configuration.

Function Compute uses a specified NAS configured on the service.


oss_mount_configOptional

Property ossMountConfig: The OSS mount configurations.


roleOptional

  • Type: typing.Union[str, ros_cdk_core.IResolvable]

Property role: The role grants Function Compute the permission to access user’s cloud resources, such as pushing logs to user’s log store.

The temporary STS token generated from this role can be retrieved from function context and used to access cloud resources.


tagsOptional

Property tags: Tags to attach to service.

Max support 20 tags to add during create service. Each tag with two properties Key and Value, and Key is required.


tracing_configOptional

Property tracingConfig: The Tracing Analysis configuration.

After Function Compute integrates with Tracing Analysis, you can record the stay time of a request in Function Compute, view the cold start time for a function, and record the execution time of a function.


vpc_bindingsOptional

  • Type: typing.Union[ros_cdk_core.IResolvable, typing.List[typing.Union[str, ros_cdk_core.IResolvable]]]

Property vpcBindings: Function Invocation only by Specified VPCs.

By default, you can invoke the function by using the Internet endpoint and internal endpoint after a function is created. If you want the function to be invoked only by using specified VPCs, but not the Internet endpoint or internal endpoint, you must bind the specified VPCs to the service.


vpc_configOptional

Property vpcConfig: VPC configuration.

Function Compute uses the config to setup ENI in the specific VPC.


enable_resource_property_constraintOptional

  • Type: bool

Methods

Name Description
to_string Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
add_condition No description.
add_count No description.
add_dependency No description.
add_resource_desc No description.
apply_removal_policy No description.
get_att No description.
set_metadata No description.

to_string

def to_string() -> str

Returns a string representation of this construct.

synthesize

def synthesize(
  session: ISynthesisSession
) -> None

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

sessionRequired

  • Type: ros_cdk_core.ISynthesisSession

The synthesis session.


add_condition

def add_condition(
  condition: RosCondition
) -> None

conditionRequired

  • Type: ros_cdk_core.RosCondition

add_count

def add_count(
  count: typing.Union[typing.Union[int, float], IResolvable]
) -> None

countRequired

  • Type: typing.Union[typing.Union[int, float], ros_cdk_core.IResolvable]

add_dependency

def add_dependency(
  resource: Resource
) -> None

resourceRequired

  • Type: ros_cdk_core.Resource

add_resource_desc

def add_resource_desc(
  desc: str
) -> None

descRequired

  • Type: str

apply_removal_policy

def apply_removal_policy(
  policy: RemovalPolicy
) -> None

policyRequired

  • Type: ros_cdk_core.RemovalPolicy

get_att

def get_att(
  name: str
) -> IResolvable

nameRequired

  • Type: str

set_metadata

def set_metadata(
  key: str,
  value: typing.Any
) -> None

keyRequired

  • Type: str

valueRequired

  • Type: typing.Any

Static Functions

Name Description
is_construct Return whether the given object is a Construct.

is_construct

import ros_cdk_fc
ros_cdk_fc.Service.is_construct(
  x: typing.Any
)

Return whether the given object is a Construct.

xRequired

  • Type: typing.Any

Properties

Name Type Description
node ros_cdk_core.ConstructNode The construct tree node associated with this construct.
ref str No description.
stack ros_cdk_core.Stack The stack in which this resource is defined.
resource ros_cdk_core.RosResource No description.
attr_internet_access ros_cdk_core.IResolvable Attribute InternetAccess: Whether enable Internet access.
attr_log_project ros_cdk_core.IResolvable Attribute LogProject: Log project of service.
attr_logstore ros_cdk_core.IResolvable Attribute Logstore: Log store of service.
attr_role ros_cdk_core.IResolvable Attribute Role: Role of service.
attr_service_id ros_cdk_core.IResolvable Attribute ServiceId: The service ID.
attr_service_name ros_cdk_core.IResolvable Attribute ServiceName: The service name.
attr_tags ros_cdk_core.IResolvable Attribute Tags: Tags of service.
attr_vpc_id ros_cdk_core.IResolvable Attribute VpcId: VPC ID.

nodeRequired

node: ConstructNode
  • Type: ros_cdk_core.ConstructNode

The construct tree node associated with this construct.


refRequired

ref: str
  • Type: str

stackRequired

stack: Stack
  • Type: ros_cdk_core.Stack

The stack in which this resource is defined.


resourceOptional

resource: RosResource
  • Type: ros_cdk_core.RosResource

attr_internet_accessRequired

attr_internet_access: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute InternetAccess: Whether enable Internet access.


attr_log_projectRequired

attr_log_project: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute LogProject: Log project of service.


attr_logstoreRequired

attr_logstore: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute Logstore: Log store of service.


attr_roleRequired

attr_role: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute Role: Role of service.


attr_service_idRequired

attr_service_id: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute ServiceId: The service ID.


attr_service_nameRequired

attr_service_name: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute ServiceName: The service name.


attr_tagsRequired

attr_tags: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute Tags: Tags of service.


attr_vpc_idRequired

attr_vpc_id: IResolvable
  • Type: ros_cdk_core.IResolvable

Attribute VpcId: VPC ID.