Asset
An asset represents a local file or directory, which is automatically uploaded to OSS bucket and then can be referenced within a CDK application.
Initializers
using AlibabaCloud.SDK.ROS.CDK.Ossassets;
new Asset(Construct Scope, string Id, AssetProps Props);
Name | Type | Description |
---|---|---|
Scope |
AlibabaCloud.SDK.ROS.CDK.Core.Construct |
No description. |
Id |
string |
No description. |
Props |
AssetProps |
No description. |
Scope
Required
- Type: AlibabaCloud.SDK.ROS.CDK.Core.Construct
Id
Required
- Type: string
Props
Required
- Type: AssetProps
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. |
AddResourceMetadata |
Adds ROS template metadata to the specified resource with information that indicates which resource property is mapped to this local asset. |
ToString
private string ToString()
Returns a string representation of this construct.
Synthesize
private 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: AlibabaCloud.SDK.ROS.CDK.Core.ISynthesisSession
The synthesis session.
AddCondition
private void AddCondition(RosCondition Condition)
- Type: AlibabaCloud.SDK.ROS.CDK.Core.RosCondition
AddCount
private void AddCount(object Count)
- Type: object
AddDependency
private void AddDependency(Resource Resource)
- Type: AlibabaCloud.SDK.ROS.CDK.Core.Resource
AddResourceDesc
private void AddResourceDesc(string Desc)
- Type: string
ApplyRemovalPolicy
private void ApplyRemovalPolicy(RemovalPolicy Policy)
- Type: AlibabaCloud.SDK.ROS.CDK.Core.RemovalPolicy
GetAtt
private IResolvable GetAtt(string Name)
- Type: string
SetMetadata
private void SetMetadata(string Key, object Value)
- Type: string
- Type: object
AddResourceMetadata
private void AddResourceMetadata(RosResource Resource, string ResourceProperty)
Adds ROS template metadata to the specified resource with information that indicates which resource property is mapped to this local asset.
Asset metadata will only be included if the stack is synthesized with the "ros:cdk:enable-asset-metadata" context key defined, which is the default behavior when synthesizing via the CDK Toolkit.
- Type: AlibabaCloud.SDK.ROS.CDK.Core.RosResource
The ROS resource which is using this asset.
- Type: string
The property name where this asset is referenced.
Static Functions
Name | Description |
---|---|
IsConstruct |
Return whether the given object is a Construct. |
IsConstruct
using AlibabaCloud.SDK.ROS.CDK.Ossassets;
Asset.IsConstruct(object X);
Return whether the given object is a Construct.
- Type: object
Properties
Name | Type | Description |
---|---|---|
Node |
AlibabaCloud.SDK.ROS.CDK.Core.ConstructNode |
The construct tree node associated with this construct. |
Ref |
string |
No description. |
Stack |
AlibabaCloud.SDK.ROS.CDK.Core.Stack |
The stack in which this resource is defined. |
Resource |
AlibabaCloud.SDK.ROS.CDK.Core.RosResource |
No description. |
AssetHash |
string |
A cryptographic hash of the asset. |
AssetPath |
string |
The path to the asset, relative to the current Cloud Assembly. |
BucketName |
string |
Attribute that represents the name of the OSS bucket this asset exists in. |
HttpUrl |
string |
Attribute which represents the OSS HTTP URL of this asset. |
IsFile |
bool |
Indicates if this asset is a single file. |
IsZipArchive |
bool |
Indicates if this asset is a zip archive. |
ObjectKey |
string |
Attribute which represents the OSS object key of this asset. |
Node
Required
public ConstructNode Node { get; }
- Type: AlibabaCloud.SDK.ROS.CDK.Core.ConstructNode
The construct tree node associated with this construct.
Ref
Required
public string Ref { get; }
- Type: string
Stack
Required
public Stack Stack { get; }
- Type: AlibabaCloud.SDK.ROS.CDK.Core.Stack
The stack in which this resource is defined.
Resource
Optional
public RosResource Resource { get; }
- Type: AlibabaCloud.SDK.ROS.CDK.Core.RosResource
AssetHash
Required
public string AssetHash { get; }
- Type: string
A cryptographic hash of the asset.
AssetPath
Required
public string AssetPath { get; }
- Type: string
The path to the asset, relative to the current Cloud Assembly.
If asset staging is disabled, this will just be the original path. If asset staging is enabled it will be the staged path.
BucketName
Required
public string BucketName { get; }
- Type: string
Attribute that represents the name of the OSS bucket this asset exists in.
HttpUrl
Required
public string HttpUrl { get; }
- Type: string
Attribute which represents the OSS HTTP URL of this asset.
For example, https://${bucketName}.oss-${region}.aliyuncs.com/${objectKey}
IsFile
Required
public bool IsFile { get; }
- Type: bool
Indicates if this asset is a single file.
Allows constructs to ensure that the correct file type was used.
IsZipArchive
Required
public bool IsZipArchive { get; }
- Type: bool
Indicates if this asset is a zip archive.
Allows constructs to ensure that the correct file type was used.
ObjectKey
Required
public string ObjectKey { get; }
- Type: string
Attribute which represents the OSS object key of this asset.