RosFunction
This class is a base encapsulation around the ROS resource type ALIYUN::FC::Function
, which is used to create a function.
Functions must be associated with services. All functions of a service share the same attributes as the service, such as service authorization and log configurations.
Initializers
import com.aliyun.ros.cdk.fc.RosFunction;
RosFunction.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
.functionName(java.lang.String)
.functionName(IResolvable)
.handler(java.lang.String)
.handler(IResolvable)
.runtime(java.lang.String)
.runtime(IResolvable)
.serviceName(java.lang.String)
.serviceName(IResolvable)
// .asyncConfiguration(IResolvable)
// .asyncConfiguration(AsyncConfigurationProperty)
// .caPort(java.lang.Number)
// .caPort(IResolvable)
// .code(IResolvable)
// .code(CodeProperty)
// .cpu(java.lang.Number)
// .cpu(IResolvable)
// .customContainerConfig(IResolvable)
// .customContainerConfig(CustomContainerConfigProperty)
// .customDns(IResolvable)
// .customDns(CustomDNSProperty)
// .customHealthCheckConfig(IResolvable)
// .customHealthCheckConfig(CustomHealthCheckConfigProperty)
// .customRuntimeConfig(IResolvable)
// .customRuntimeConfig(CustomRuntimeConfigProperty)
// .description(java.lang.String)
// .description(IResolvable)
// .diskSize(java.lang.Number)
// .diskSize(IResolvable)
// .environmentVariables(IResolvable)
// .environmentVariables(java.util.Map<java.lang.String, java.lang.Object>)
// .gpuMemorySize(java.lang.Number)
// .gpuMemorySize(IResolvable)
// .initializationTimeout(java.lang.Number)
// .initializationTimeout(IResolvable)
// .initializer(java.lang.String)
// .initializer(IResolvable)
// .instanceConcurrency(java.lang.Number)
// .instanceConcurrency(IResolvable)
// .instanceLifecycleConfig(IResolvable)
// .instanceLifecycleConfig(InstanceLifecycleConfigProperty)
// .instanceSoftConcurrency(java.lang.Number)
// .instanceSoftConcurrency(IResolvable)
// .instanceType(java.lang.String)
// .instanceType(IResolvable)
// .memorySize(java.lang.Number)
// .memorySize(IResolvable)
// .timeout(java.lang.Number)
// .timeout(IResolvable)
.build();
Name | Type | Description |
---|---|---|
scope |
com.aliyun.ros.cdk.core.Construct |
- scope in which this resource is defined. |
id |
java.lang.String |
- scoped id of the resource. |
enableResourcePropertyConstraint |
java.lang.Boolean |
No description. |
functionName |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
handler |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
runtime |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
serviceName |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
asyncConfiguration |
com.aliyun.ros.cdk.core.IResolvable OR AsyncConfigurationProperty |
No description. |
caPort |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
code |
com.aliyun.ros.cdk.core.IResolvable OR CodeProperty |
No description. |
cpu |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
customContainerConfig |
com.aliyun.ros.cdk.core.IResolvable OR CustomContainerConfigProperty |
No description. |
customDns |
com.aliyun.ros.cdk.core.IResolvable OR CustomDNSProperty |
No description. |
customHealthCheckConfig |
com.aliyun.ros.cdk.core.IResolvable OR CustomHealthCheckConfigProperty |
No description. |
customRuntimeConfig |
com.aliyun.ros.cdk.core.IResolvable OR CustomRuntimeConfigProperty |
No description. |
description |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
diskSize |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
environmentVariables |
com.aliyun.ros.cdk.core.IResolvable OR java.util.Map |
No description. |
gpuMemorySize |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
initializationTimeout |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
initializer |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
instanceConcurrency |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
instanceLifecycleConfig |
com.aliyun.ros.cdk.core.IResolvable OR InstanceLifecycleConfigProperty |
No description. |
instanceSoftConcurrency |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
instanceType |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
memorySize |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
timeout |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
scope
Required
- Type: com.aliyun.ros.cdk.core.Construct
scope in which this resource is defined.
id
Required
- Type: java.lang.String
scoped id of the resource.
enableResourcePropertyConstraint
Required
- Type: java.lang.Boolean
functionName
Required
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
handler
Required
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
runtime
Required
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
serviceName
Required
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
asyncConfiguration
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR AsyncConfigurationProperty
caPort
Optional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
code
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR CodeProperty
cpu
Optional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
customContainerConfig
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR CustomContainerConfigProperty
customDns
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR CustomDNSProperty
customHealthCheckConfig
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR CustomHealthCheckConfigProperty
customRuntimeConfig
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR CustomRuntimeConfigProperty
description
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
diskSize
Optional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
environmentVariables
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.Map
gpuMemorySize
Optional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
initializationTimeout
Optional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
initializer
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
instanceConcurrency
Optional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
instanceLifecycleConfig
Optional
- Type: com.aliyun.ros.cdk.core.IResolvable OR InstanceLifecycleConfigProperty
instanceSoftConcurrency
Optional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
instanceType
Optional
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
memorySize
Optional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
timeout
Optional
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Methods
Name | Description |
---|---|
toString |
Returns a string representation of this construct. |
synthesize |
Allows this construct to emit artifacts into the cloud assembly during synthesis. |
overrideLogicalId |
Overrides the auto-generated logical ID with a specific ID. |
addCondition |
No description. |
addCount |
No description. |
addDeletionOverride |
Syntactic sugar for addOverride(path, undefined) . |
addDependsOn |
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
addDesc |
No description. |
addMetaData |
No description. |
addOverride |
Adds an override to the synthesized ROS resource. |
addPropertyDeletionOverride |
Adds an override that deletes the value of a property from the resource definition. |
addPropertyOverride |
Adds an override to a resource property. |
addRosDependency |
No description. |
applyRemovalPolicy |
Sets the deletion policy of the resource based on the removal policy specified. |
getAtt |
Returns a token for an runtime attribute of this resource. |
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.
overrideLogicalId
public void overrideLogicalId(java.lang.String newLogicalId)
Overrides the auto-generated logical ID with a specific ID.
- Type: java.lang.String
The new logical ID to use for this stack element.
addCondition
public void addCondition(RosCondition con)
- 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
addDeletionOverride
public void addDeletionOverride(java.lang.String path)
Syntactic sugar for addOverride(path, undefined)
.
- Type: java.lang.String
The path of the value to delete.
addDependsOn
public void addDependsOn(RosResource target)
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
- Type: com.aliyun.ros.cdk.core.RosResource
addDesc
public void addDesc(java.lang.String desc)
- Type: java.lang.String
addMetaData
public void addMetaData(java.lang.String key, java.lang.Object value)
- Type: java.lang.String
- Type: java.lang.Object
addOverride
public void addOverride(java.lang.String path, java.lang.Object value)
Adds an override to the synthesized ROS resource.
To add a
property override, either use addPropertyOverride
or prefix path
with
"Properties." (i.e. Properties.TopicName
).
If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
For example,
addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute'])
addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE')
would add the overrides
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
- Type: java.lang.String
The path of the property, you can use dot notation to override values in complex types.
Any intermdediate keys will be created as needed.
- Type: java.lang.Object
The value.
Could be primitive or complex.
addPropertyDeletionOverride
public void addPropertyDeletionOverride(java.lang.String propertyPath)
Adds an override that deletes the value of a property from the resource definition.
- Type: java.lang.String
The path to the property.
addPropertyOverride
public void addPropertyOverride(java.lang.String propertyPath, java.lang.Object value)
Adds an override to a resource property.
Syntactic sugar for addOverride("Properties.<...>", value)
.
- Type: java.lang.String
The path of the property.
- Type: java.lang.Object
The value.
addRosDependency
public void addRosDependency(java.lang.String target)
- Type: java.lang.String
applyRemovalPolicy
public void applyRemovalPolicy()
public void applyRemovalPolicy(RemovalPolicy policy)
public void applyRemovalPolicy(RemovalPolicy policy, RemovalPolicyOptions options)
Sets the deletion policy of the resource based on the removal policy specified.
- Type: com.aliyun.ros.cdk.core.RemovalPolicy
- Type: com.aliyun.ros.cdk.core.RemovalPolicyOptions
getAtt
public Reference getAtt(java.lang.String attributeName)
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. resource.arn
), but this can be used for future compatibility
in case there is no generated attribute.
- Type: java.lang.String
The name of the attribute.
Static Functions
Name | Description |
---|---|
isConstruct |
Return whether the given object is a Construct. |
isRosElement |
Returns true if a construct is a stack element (i.e. part of the synthesized template). |
isRosResource |
Check whether the given construct is a RosResource. |
isConstruct
import com.aliyun.ros.cdk.fc.RosFunction;
RosFunction.isConstruct(java.lang.Object x)
Return whether the given object is a Construct.
- Type: java.lang.Object
isRosElement
import com.aliyun.ros.cdk.fc.RosFunction;
RosFunction.isRosElement(java.lang.Object x)
Returns true
if a construct is a stack element (i.e. part of the synthesized template).
Uses duck-typing instead of instanceof
to allow stack elements from different
versions of this library to be included in the same stack.
- Type: java.lang.Object
isRosResource
import com.aliyun.ros.cdk.fc.RosFunction;
RosFunction.isRosResource(IConstruct construct)
Check whether the given construct is a RosResource.
- Type: com.aliyun.ros.cdk.core.IConstruct
Properties
Name | Type | Description |
---|---|---|
node |
com.aliyun.ros.cdk.core.ConstructNode |
The construct tree node associated with this construct. |
creationStack |
java.util.List |
No description. |
logicalId |
java.lang.String |
The logical ID for this stack element. |
stack |
com.aliyun.ros.cdk.core.Stack |
The stack in which this element is defined. |
ref |
java.lang.String |
Return a string that will be resolved to a RosTemplate { Ref } for this element. |
rosOptions |
com.aliyun.ros.cdk.core.IRosResourceOptions |
Options for this resource, such as condition, update policy etc. |
rosResourceType |
java.lang.String |
ROS resource type. |
attrArn |
com.aliyun.ros.cdk.core.IResolvable |
No description. |
attrFunctionId |
com.aliyun.ros.cdk.core.IResolvable |
No description. |
attrFunctionName |
com.aliyun.ros.cdk.core.IResolvable |
No description. |
attrServiceId |
com.aliyun.ros.cdk.core.IResolvable |
No description. |
attrServiceName |
com.aliyun.ros.cdk.core.IResolvable |
No description. |
enableResourcePropertyConstraint |
java.lang.Boolean |
No description. |
functionName |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
handler |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
runtime |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
serviceName |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
asyncConfiguration |
com.aliyun.ros.cdk.core.IResolvable OR AsyncConfigurationProperty |
No description. |
caPort |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
code |
com.aliyun.ros.cdk.core.IResolvable OR CodeProperty |
No description. |
cpu |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
customContainerConfig |
com.aliyun.ros.cdk.core.IResolvable OR CustomContainerConfigProperty |
No description. |
customDns |
com.aliyun.ros.cdk.core.IResolvable OR CustomDNSProperty |
No description. |
customHealthCheckConfig |
com.aliyun.ros.cdk.core.IResolvable OR CustomHealthCheckConfigProperty |
No description. |
customRuntimeConfig |
com.aliyun.ros.cdk.core.IResolvable OR CustomRuntimeConfigProperty |
No description. |
description |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
diskSize |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
environmentVariables |
com.aliyun.ros.cdk.core.IResolvable OR java.util.Map |
No description. |
gpuMemorySize |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
initializationTimeout |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
initializer |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
instanceConcurrency |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
instanceLifecycleConfig |
com.aliyun.ros.cdk.core.IResolvable OR InstanceLifecycleConfigProperty |
No description. |
instanceSoftConcurrency |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
instanceType |
java.lang.String OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
memorySize |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
timeout |
java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable |
No description. |
node
Required
public ConstructNode getNode();
- Type: com.aliyun.ros.cdk.core.ConstructNode
The construct tree node associated with this construct.
creationStack
Required
public java.util.List<java.lang.String> getCreationStack();
- Type: java.util.List
logicalId
Required
public java.lang.String getLogicalId();
- Type: java.lang.String
The logical ID for this stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use overrideLogicalId(newLogicalId)
.
stack
Required
public Stack getStack();
- Type: com.aliyun.ros.cdk.core.Stack
The stack in which this element is defined.
RosElements must be defined within a stack scope (directly or indirectly).
ref
Required
public java.lang.String getRef();
- Type: java.lang.String
Return a string that will be resolved to a RosTemplate { Ref }
for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through Lazy.any({ produce: resource.ref })
.
rosOptions
Required
public IRosResourceOptions getRosOptions();
- Type: com.aliyun.ros.cdk.core.IRosResourceOptions
Options for this resource, such as condition, update policy etc.
rosResourceType
Required
public java.lang.String getRosResourceType();
- Type: java.lang.String
ROS resource type.
attrArn
Required
public IResolvable getAttrArn();
- Type: com.aliyun.ros.cdk.core.IResolvable
attrFunctionId
Required
public IResolvable getAttrFunctionId();
- Type: com.aliyun.ros.cdk.core.IResolvable
attrFunctionName
Required
public IResolvable getAttrFunctionName();
- Type: com.aliyun.ros.cdk.core.IResolvable
attrServiceId
Required
public IResolvable getAttrServiceId();
- Type: com.aliyun.ros.cdk.core.IResolvable
attrServiceName
Required
public IResolvable getAttrServiceName();
- Type: com.aliyun.ros.cdk.core.IResolvable
enableResourcePropertyConstraint
Required
public java.lang.Boolean getEnableResourcePropertyConstraint();
- Type: java.lang.Boolean
functionName
Required
public java.lang.Object getFunctionName();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
handler
Required
public java.lang.Object getHandler();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
runtime
Required
public java.lang.Object getRuntime();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
serviceName
Required
public java.lang.Object getServiceName();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
asyncConfiguration
Optional
public java.lang.Object getAsyncConfiguration();
- Type: com.aliyun.ros.cdk.core.IResolvable OR AsyncConfigurationProperty
caPort
Optional
public java.lang.Object getCaPort();
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
code
Optional
public java.lang.Object getCode();
- Type: com.aliyun.ros.cdk.core.IResolvable OR CodeProperty
cpu
Optional
public java.lang.Object getCpu();
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
customContainerConfig
Optional
public java.lang.Object getCustomContainerConfig();
- Type: com.aliyun.ros.cdk.core.IResolvable OR CustomContainerConfigProperty
customDns
Optional
public java.lang.Object getCustomDns();
- Type: com.aliyun.ros.cdk.core.IResolvable OR CustomDNSProperty
customHealthCheckConfig
Optional
public java.lang.Object getCustomHealthCheckConfig();
- Type: com.aliyun.ros.cdk.core.IResolvable OR CustomHealthCheckConfigProperty
customRuntimeConfig
Optional
public java.lang.Object getCustomRuntimeConfig();
- Type: com.aliyun.ros.cdk.core.IResolvable OR CustomRuntimeConfigProperty
description
Optional
public java.lang.Object getDescription();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
diskSize
Optional
public java.lang.Object getDiskSize();
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
environmentVariables
Optional
public java.lang.Object getEnvironmentVariables();
- Type: com.aliyun.ros.cdk.core.IResolvable OR java.util.Map
gpuMemorySize
Optional
public java.lang.Object getGpuMemorySize();
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
initializationTimeout
Optional
public java.lang.Object getInitializationTimeout();
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
initializer
Optional
public java.lang.Object getInitializer();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
instanceConcurrency
Optional
public java.lang.Object getInstanceConcurrency();
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
instanceLifecycleConfig
Optional
public java.lang.Object getInstanceLifecycleConfig();
- Type: com.aliyun.ros.cdk.core.IResolvable OR InstanceLifecycleConfigProperty
instanceSoftConcurrency
Optional
public java.lang.Object getInstanceSoftConcurrency();
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
instanceType
Optional
public java.lang.Object getInstanceType();
- Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable
memorySize
Optional
public java.lang.Object getMemorySize();
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
timeout
Optional
public java.lang.Object getTimeout();
- Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable
Constants
Name | Type | Description |
---|---|---|
ROS_RESOURCE_TYPE_NAME |
java.lang.String |
The resource type name for this resource class. |
ROS_RESOURCE_TYPE_NAME
Required
public java.lang.String getRosResourceTypeName();
- Type: java.lang.String
The resource type name for this resource class.