FileAssetLocation

class aws_cdk.FileAssetLocation(*, bucket_name, http_url, object_key, s3_object_url, kms_key_arn=None, s3_object_url_with_placeholders=None)

Bases: object

The location of the published file asset.

This is where the asset can be consumed at runtime.

Parameters:
  • bucket_name (str) – The name of the Amazon S3 bucket.

  • http_url (str) – 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

  • object_key (str) – The Amazon S3 object key.

  • s3_object_url (str) – 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

  • kms_key_arn (Optional[str]) – 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. Default: - Asset bucket is not encrypted, or decryption permissions are defined by a Key Policy.

  • s3_object_url_with_placeholders (Optional[str]) – 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. Default: - This feature cannot be used

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk as cdk

file_asset_location = cdk.FileAssetLocation(
    bucket_name="bucketName",
    http_url="httpUrl",
    object_key="objectKey",
    s3_object_url="s3ObjectUrl",

    # the properties below are optional
    kms_key_arn="kmsKeyArn",
    s3_object_url_with_placeholders="s3ObjectUrlWithPlaceholders"
)

Attributes

bucket_name

The name of the Amazon S3 bucket.

http_url

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

kms_key_arn

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.

Default:

  • Asset bucket is not encrypted, or decryption permissions are

defined by a Key Policy.

object_key

The Amazon S3 object key.

s3_object_url

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

s3_object_url_with_placeholders

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.

Default:
  • This feature cannot be used