Skip to content

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

import "github.com/alibabacloud-go/ros-cdk/alicloudroscdkossassets"
alicloudroscdkossassets.NewAsset(scope Construct, id *string, props AssetProps) Asset
Name Type Description
scope github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.Construct No description.
id *string No description.
props AssetProps No description.

scopeRequired

  • Type: github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.Construct

idRequired

  • Type: *string

propsRequired


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

func ToString() *string

Returns a string representation of this construct.

Synthesize

func Synthesize(session ISynthesisSession)

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: github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.ISynthesisSession

The synthesis session.


AddCondition

func AddCondition(condition RosCondition)

conditionRequired

  • Type: github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.RosCondition

AddCount

func AddCount(count interface{})

countRequired

  • Type: interface{}

AddDependency

func AddDependency(resource Resource)

resourceRequired

  • Type: github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.Resource

AddResourceDesc

func AddResourceDesc(desc *string)

descRequired

  • Type: *string

ApplyRemovalPolicy

func ApplyRemovalPolicy(policy RemovalPolicy)

policyRequired

  • Type: github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.RemovalPolicy

GetAtt

func GetAtt(name *string) IResolvable

nameRequired

  • Type: *string

SetMetadata

func SetMetadata(key *string, value interface{})

keyRequired

  • Type: *string

valueRequired

  • Type: interface{}

AddResourceMetadata

func AddResourceMetadata(resource RosResource, resourceProperty *string)

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.

resourceRequired

  • Type: github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.RosResource

The ROS resource which is using this asset.


resourcePropertyRequired

  • Type: *string

The property name where this asset is referenced.


Static Functions

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

IsConstruct

import "github.com/alibabacloud-go/ros-cdk/alicloudroscdkossassets"
alicloudroscdkossassets.Asset_IsConstruct(x interface{}) *bool

Return whether the given object is a Construct.

xRequired

  • Type: interface{}

Properties

Name Type Description
Node github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.ConstructNode The construct tree node associated with this construct.
Ref *string No description.
Stack github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.Stack The stack in which this resource is defined.
Resource github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.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.

NodeRequired

func Node() ConstructNode
  • Type: github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.ConstructNode

The construct tree node associated with this construct.


RefRequired

func Ref() *string
  • Type: *string

StackRequired

func Stack() Stack
  • Type: github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.Stack

The stack in which this resource is defined.


ResourceOptional

func Resource() RosResource
  • Type: github.com/alibabacloud-go/ros-cdk/alicloudroscdkcore.RosResource

AssetHashRequired

func AssetHash() *string
  • Type: *string

A cryptographic hash of the asset.


AssetPathRequired

func AssetPath() *string
  • 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.


BucketNameRequired

func BucketName() *string
  • Type: *string

Attribute that represents the name of the OSS bucket this asset exists in.


HttpUrlRequired

func HttpUrl() *string
  • Type: *string

Attribute which represents the OSS HTTP URL of this asset.

For example, https://${bucketName}.oss-${region}.aliyuncs.com/${objectKey}


IsFileRequired

func IsFile() *bool
  • Type: *bool

Indicates if this asset is a single file.

Allows constructs to ensure that the correct file type was used.


IsZipArchiveRequired

func IsZipArchive() *bool
  • Type: *bool

Indicates if this asset is a zip archive.

Allows constructs to ensure that the correct file type was used.


ObjectKeyRequired

func ObjectKey() *string
  • Type: *string

Attribute which represents the OSS object key of this asset.


Structs