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. |
scope
Required
- Type: com.aliyun.ros.cdk.core.Construct
id
Required
- Type: java.lang.String
enableResourcePropertyConstraint
Optional
- Type: java.lang.Boolean
serviceName
Required
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property serviceName: Service name.
deletionForce
Optional
- 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.
description
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
Property description: Service description.
internetAccess
Optional
- Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable
Property internetAccess: Set it to true to enable Internet access.
logConfig
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR LogConfigProperty
Property logConfig: Log configuration.
Function Compute pushes function execution logs to the configured log store.
nasConfig
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR NasConfigProperty
Property nasConfig: NAS configuration.
Function Compute uses a specified NAS configured on the service.
ossMountConfig
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR OssMountConfigProperty
Property ossMountConfig: The OSS mount configurations.
role
Optional
- 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.
tags
Optional
- Type: java.util.List<TagsProperty>
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.
tracingConfig
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR TracingConfigProperty
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.
vpcBindings
Optional
- 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.
vpcConfig
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR VpcConfigProperty
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.
- Type: com.aliyun.ros.cdk.core.ISynthesisSession
The synthesis session.
addCondition
public void addCondition(RosCondition condition)
- Type: com.aliyun.ros.cdk.core.RosCondition
addCount
public void addCount(java.lang.Number OR IResolvable count)
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
addDependency
public void addDependency(Resource resource)
- Type: com.aliyun.ros.cdk.core.Resource
addResourceDesc
public void addResourceDesc(java.lang.String desc)
- Type: java.lang.String
applyRemovalPolicy
public void applyRemovalPolicy(RemovalPolicy policy)
- Type: com.aliyun.ros.cdk.core.RemovalPolicy
getAtt
public IResolvable getAtt(java.lang.String name)
- Type: java.lang.String
setMetadata
public void setMetadata(java.lang.String key, java.lang.Object value)
- Type: java.lang.String
- 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.
- 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. |
node
Required
public ConstructNode getNode();
- Type: com.aliyun.ros.cdk.core.ConstructNode
The construct tree node associated with this construct.
ref
Required
public java.lang.String getRef();
- Type: java.lang.String
stack
Required
public Stack getStack();
- Type: com.aliyun.ros.cdk.core.Stack
The stack in which this resource is defined.
resource
Optional
public RosResource getResource();
- Type: com.aliyun.ros.cdk.core.RosResource
attrInternetAccess
Required
public IResolvable getAttrInternetAccess();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute InternetAccess: Whether enable Internet access.
attrLogProject
Required
public IResolvable getAttrLogProject();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute LogProject: Log project of service.
attrLogstore
Required
public IResolvable getAttrLogstore();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute Logstore: Log store of service.
attrRole
Required
public IResolvable getAttrRole();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute Role: Role of service.
attrServiceId
Required
public IResolvable getAttrServiceId();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute ServiceId: The service ID.
attrServiceName
Required
public IResolvable getAttrServiceName();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute ServiceName: The service name.
attrTags
Required
public IResolvable getAttrTags();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute Tags: Tags of service.
attrVpcId
Required
public IResolvable getAttrVpcId();
- Type: com.aliyun.ros.cdk.core.IResolvable
Attribute VpcId: VPC ID.