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 com.aliyun.ros.cdk.fc.Service;
Service.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
    .serviceName(java.lang.String)
    .serviceName(IResolvable)
//  .deletionForce(java.lang.Boolean)
//  .deletionForce(IResolvable)
//  .description(java.lang.String)
//  .description(IResolvable)
//  .internetAccess(java.lang.Boolean)
//  .internetAccess(IResolvable)
//  .logConfig(IResolvable)
//  .logConfig(LogConfigProperty)
//  .nasConfig(IResolvable)
//  .nasConfig(NasConfigProperty)
//  .ossMountConfig(IResolvable)
//  .ossMountConfig(OssMountConfigProperty)
//  .role(java.lang.String)
//  .role(IResolvable)
//  .tags(java.util.List<TagsProperty>)
//  .tracingConfig(IResolvable)
//  .tracingConfig(TracingConfigProperty)
//  .vpcBindings(IResolvable)
//  .vpcBindings(java.util.List<java.lang.String)
//  .vpcBindings(IResolvable>)
//  .vpcConfig(IResolvable)
//  .vpcConfig(VpcConfigProperty)
    .build();
Name Type Description
scope com.aliyun.ros.cdk.core.Construct No description.
id java.lang.String No description.
enableResourcePropertyConstraint java.lang.Boolean No description.
serviceName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property serviceName: Service name.
deletionForce java.lang.Boolean OR com.aliyun.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 java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property description: Service description.
internetAccess java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property internetAccess: Set it to true to enable Internet access.
logConfig com.aliyun.ros.cdk.core.IResolvable OR LogConfigProperty Property logConfig: Log configuration.
nasConfig com.aliyun.ros.cdk.core.IResolvable OR NasConfigProperty Property nasConfig: NAS configuration.
ossMountConfig com.aliyun.ros.cdk.core.IResolvable OR OssMountConfigProperty Property ossMountConfig: The OSS mount configurations.
role java.lang.String OR com.aliyun.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 java.util.List<TagsProperty> Property tags: Tags to attach to service.
tracingConfig com.aliyun.ros.cdk.core.IResolvable OR TracingConfigProperty Property tracingConfig: The Tracing Analysis configuration.
vpcBindings com.aliyun.ros.cdk.core.IResolvable OR java.util.List Property vpcBindings: Function Invocation only by Specified VPCs.
vpcConfig com.aliyun.ros.cdk.core.IResolvable OR VpcConfigProperty Property vpcConfig: VPC configuration.

scopeRequired

  • Type: com.aliyun.ros.cdk.core.Construct

idRequired

  • Type: java.lang.String

enableResourcePropertyConstraintOptional

  • Type: java.lang.Boolean

serviceNameRequired

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property serviceName: Service name.


deletionForceOptional

  • Type: java.lang.Boolean OR com.aliyun.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: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property description: Service description.


internetAccessOptional

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

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


logConfigOptional

Property logConfig: Log configuration.

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


nasConfigOptional

Property nasConfig: NAS configuration.

Function Compute uses a specified NAS configured on the service.


ossMountConfigOptional

Property ossMountConfig: The OSS mount configurations.


roleOptional

  • Type: java.lang.String OR com.aliyun.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.


tracingConfigOptional

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.


vpcBindingsOptional

  • Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.List

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.


vpcConfigOptional

Property vpcConfig: VPC configuration.

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


Methods

Name Description
toString Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
addCondition No description.
addCount No description.
addDependency No description.
addResourceDesc No description.
applyRemovalPolicy No description.
getAtt No description.
setMetadata No description.

toString

public java.lang.String toString()

Returns a string representation of this construct.

synthesize

public void synthesize(ISynthesisSession session)

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: com.aliyun.ros.cdk.core.ISynthesisSession

The synthesis session.


addCondition

public void addCondition(RosCondition condition)

conditionRequired

  • Type: com.aliyun.ros.cdk.core.RosCondition

addCount

public void addCount(java.lang.Number OR IResolvable count)

countRequired

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

addDependency

public void addDependency(Resource resource)

resourceRequired

  • Type: com.aliyun.ros.cdk.core.Resource

addResourceDesc

public void addResourceDesc(java.lang.String desc)

descRequired

  • Type: java.lang.String

applyRemovalPolicy

public void applyRemovalPolicy(RemovalPolicy policy)

policyRequired

  • Type: com.aliyun.ros.cdk.core.RemovalPolicy

getAtt

public IResolvable getAtt(java.lang.String name)

nameRequired

  • Type: java.lang.String

setMetadata

public void setMetadata(java.lang.String key, java.lang.Object value)

keyRequired

  • Type: java.lang.String

valueRequired

  • Type: java.lang.Object

Static Functions

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

isConstruct

import com.aliyun.ros.cdk.fc.Service;
Service.isConstruct(java.lang.Object x)

Return whether the given object is a Construct.

xRequired

  • Type: java.lang.Object

Properties

Name Type Description
node com.aliyun.ros.cdk.core.ConstructNode The construct tree node associated with this construct.
ref java.lang.String No description.
stack com.aliyun.ros.cdk.core.Stack The stack in which this resource is defined.
resource com.aliyun.ros.cdk.core.RosResource No description.
attrInternetAccess com.aliyun.ros.cdk.core.IResolvable Attribute InternetAccess: Whether enable Internet access.
attrLogProject com.aliyun.ros.cdk.core.IResolvable Attribute LogProject: Log project of service.
attrLogstore com.aliyun.ros.cdk.core.IResolvable Attribute Logstore: Log store of service.
attrRole com.aliyun.ros.cdk.core.IResolvable Attribute Role: Role of service.
attrServiceId com.aliyun.ros.cdk.core.IResolvable Attribute ServiceId: The service ID.
attrServiceName com.aliyun.ros.cdk.core.IResolvable Attribute ServiceName: The service name.
attrTags com.aliyun.ros.cdk.core.IResolvable Attribute Tags: Tags of service.
attrVpcId com.aliyun.ros.cdk.core.IResolvable Attribute VpcId: VPC ID.

nodeRequired

public ConstructNode getNode();
  • Type: com.aliyun.ros.cdk.core.ConstructNode

The construct tree node associated with this construct.


refRequired

public java.lang.String getRef();
  • Type: java.lang.String

stackRequired

public Stack getStack();
  • Type: com.aliyun.ros.cdk.core.Stack

The stack in which this resource is defined.


resourceOptional

public RosResource getResource();
  • Type: com.aliyun.ros.cdk.core.RosResource

attrInternetAccessRequired

public IResolvable getAttrInternetAccess();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute InternetAccess: Whether enable Internet access.


attrLogProjectRequired

public IResolvable getAttrLogProject();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute LogProject: Log project of service.


attrLogstoreRequired

public IResolvable getAttrLogstore();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute Logstore: Log store of service.


attrRoleRequired

public IResolvable getAttrRole();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute Role: Role of service.


attrServiceIdRequired

public IResolvable getAttrServiceId();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute ServiceId: The service ID.


attrServiceNameRequired

public IResolvable getAttrServiceName();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute ServiceName: The service name.


attrTagsRequired

public IResolvable getAttrTags();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute Tags: Tags of service.


attrVpcIdRequired

public IResolvable getAttrVpcId();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute VpcId: VPC ID.