Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Asset_IsConstruct ¶
func Asset_IsConstruct(x interface{}) *bool
Checks if `x` is a construct.
Returns: true if `x` is an object created from a class which extends `Construct`. Deprecated: use `x instanceof Construct` instead
func NewAsset_Override ¶
func NewAsset_Override(a Asset, scope constructs.Construct, id *string, props *AssetProps)
Types ¶
type Asset ¶
type Asset interface { constructs.Construct awscdk.IAsset AssetHash() *string AssetPath() *string Bucket() awss3.IBucket HttpUrl() *string IsFile() *bool IsZipArchive() *bool Node() constructs.Node S3BucketName() *string S3ObjectKey() *string S3ObjectUrl() *string AddResourceMetadata(resource awscdk.CfnResource, resourceProperty *string) GrantRead(grantee awsiam.IGrantable) ToString() *string }
An asset represents a local file or directory, which is automatically uploaded to S3 and then can be referenced within a CDK application.
TODO: EXAMPLE
func NewAsset ¶
func NewAsset(scope constructs.Construct, id *string, props *AssetProps) Asset
type AssetOptions ¶
type AssetOptions struct { // Specify a custom hash for this asset. // // If `assetHashType` is set it must // be set to `AssetHashType.CUSTOM`. For consistency, this custom hash will // be SHA256 hashed and encoded as hex. The resulting hash will be the asset // hash. // // NOTE: the hash is used in order to identify a specific revision of the asset, and // used for optimizing and caching deployment activities related to this asset such as // packaging, uploading to Amazon S3, etc. If you chose to customize the hash, you will // need to make sure it is updated every time the asset changes, or otherwise it is // possible that some deployments will not be invalidated. AssetHash *string `json:"assetHash" yaml:"assetHash"` // Specifies the type of hash to calculate for this asset. // // If `assetHash` is configured, this option must be `undefined` or // `AssetHashType.CUSTOM`. AssetHashType awscdk.AssetHashType `json:"assetHashType" yaml:"assetHashType"` // Bundle the asset by executing a command in a Docker container or a custom bundling provider. // // The asset path will be mounted at `/asset-input`. The Docker // container is responsible for putting content at `/asset-output`. // The content at `/asset-output` will be zipped and used as the // final asset. Bundling *awscdk.BundlingOptions `json:"bundling" yaml:"bundling"` // Glob patterns to exclude from the copy. Exclude *[]*string `json:"exclude" yaml:"exclude"` // A strategy for how to handle symlinks. FollowSymlinks awscdk.SymlinkFollowMode `json:"followSymlinks" yaml:"followSymlinks"` // The ignore behavior to use for exclude patterns. IgnoreMode awscdk.IgnoreMode `json:"ignoreMode" yaml:"ignoreMode"` // A list of principals that should be able to read this asset from S3. // // You can use `asset.grantRead(principal)` to grant read permissions later. Readers *[]awsiam.IGrantable `json:"readers" yaml:"readers"` }
TODO: EXAMPLE
type AssetProps ¶
type AssetProps struct { // Specify a custom hash for this asset. // // If `assetHashType` is set it must // be set to `AssetHashType.CUSTOM`. For consistency, this custom hash will // be SHA256 hashed and encoded as hex. The resulting hash will be the asset // hash. // // NOTE: the hash is used in order to identify a specific revision of the asset, and // used for optimizing and caching deployment activities related to this asset such as // packaging, uploading to Amazon S3, etc. If you chose to customize the hash, you will // need to make sure it is updated every time the asset changes, or otherwise it is // possible that some deployments will not be invalidated. AssetHash *string `json:"assetHash" yaml:"assetHash"` // Specifies the type of hash to calculate for this asset. // // If `assetHash` is configured, this option must be `undefined` or // `AssetHashType.CUSTOM`. AssetHashType awscdk.AssetHashType `json:"assetHashType" yaml:"assetHashType"` // Bundle the asset by executing a command in a Docker container or a custom bundling provider. // // The asset path will be mounted at `/asset-input`. The Docker // container is responsible for putting content at `/asset-output`. // The content at `/asset-output` will be zipped and used as the // final asset. Bundling *awscdk.BundlingOptions `json:"bundling" yaml:"bundling"` // Glob patterns to exclude from the copy. Exclude *[]*string `json:"exclude" yaml:"exclude"` // A strategy for how to handle symlinks. FollowSymlinks awscdk.SymlinkFollowMode `json:"followSymlinks" yaml:"followSymlinks"` // The ignore behavior to use for exclude patterns. IgnoreMode awscdk.IgnoreMode `json:"ignoreMode" yaml:"ignoreMode"` // A list of principals that should be able to read this asset from S3. // // You can use `asset.grantRead(principal)` to grant read permissions later. Readers *[]awsiam.IGrantable `json:"readers" yaml:"readers"` // The disk location of the asset. // // The path should refer to one of the following: // - A regular file or a .zip file, in which case the file will be uploaded as-is to S3. // - A directory, in which case it will be archived into a .zip file and uploaded to S3. Path *string `json:"path" yaml:"path"` }
TODO: EXAMPLE
Click to show internal directories.
Click to hide internal directories.