interface FileAssetLocation
Language | Type name |
---|---|
.NET | Amazon.CDK.FileAssetLocation |
Go | github.com/aws/aws-cdk-go/awscdk/v2#FileAssetLocation |
Java | software.amazon.awscdk.FileAssetLocation |
Python | aws_cdk.FileAssetLocation |
TypeScript (source) | aws-cdk-lib » FileAssetLocation |
Obtainable from
App
.addFileAsset()
, Bootstrapless
.addFileAsset()
, Cli
.addFileAsset()
, Default
.addFileAsset()
, Legacy
.addFileAsset()
, Nested
.addFileAsset()
, Stack
.addFileAsset()
, Stack
.cloudFormationLocationFromFileAsset()
The location of the published file asset.
This is where the asset can be consumed at runtime.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
const fileAssetLocation: cdk.FileAssetLocation = {
bucketName: 'bucketName',
httpUrl: 'httpUrl',
objectKey: 'objectKey',
s3ObjectUrl: 's3ObjectUrl',
// the properties below are optional
kmsKeyArn: 'kmsKeyArn',
s3ObjectUrlWithPlaceholders: 's3ObjectUrlWithPlaceholders',
};
Properties
Name | Type | Description |
---|---|---|
bucket | string | The name of the Amazon S3 bucket. |
http | string | The HTTP URL of this asset on Amazon S3. |
object | string | The Amazon S3 object key. |
s3 | string | The S3 URL of this asset on Amazon S3. |
kms | string | The ARN of the KMS key used to encrypt the file asset bucket, if any. |
s3 | string | Like s3ObjectUrl , but not suitable for CloudFormation consumption. |
bucketName
Type:
string
The name of the Amazon S3 bucket.
httpUrl
Type:
string
The HTTP URL of this asset on Amazon S3.
This value suitable for inclusion in a CloudFormation template, and may be an encoded token.
Example value: https://s3-us-east-1.amazonaws.com/mybucket/myobject
objectKey
Type:
string
The Amazon S3 object key.
s3ObjectUrl
Type:
string
The S3 URL of this asset on Amazon S3.
This value suitable for inclusion in a CloudFormation template, and may be an encoded token.
Example value: s3://mybucket/myobject
kmsKeyArn?
Type:
string
(optional, default: Asset bucket is not encrypted, or decryption permissions are
defined by a Key Policy.)
The ARN of the KMS key used to encrypt the file asset bucket, if any.
The CDK bootstrap stack comes with a key policy that does not require setting this property, so you only need to set this property if you have customized the bootstrap stack to require it.
s3ObjectUrlWithPlaceholders?
Type:
string
(optional, default: This feature cannot be used)
Like s3ObjectUrl
, but not suitable for CloudFormation consumption.
If there are placeholders in the S3 URL, they will be returned un-replaced and un-evaluated.