# FileAssetLocation

The location of the published file asset.

This is where the asset
can be consumed at runtime.

- Source: [`core/lib/assets.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/core/lib/assets.ts#L352)
- Type last changed: v2.21.0 · 22 Apr 2022

## Example

TypeScript:

```ts
// 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',
};
```

Python:

```python
# 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"
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.*;

FileAssetLocation fileAssetLocation = FileAssetLocation.builder()
        .bucketName("bucketName")
        .httpUrl("httpUrl")
        .objectKey("objectKey")
        .s3ObjectUrl("s3ObjectUrl")

        // the properties below are optional
        .kmsKeyArn("kmsKeyArn")
        .s3ObjectUrlWithPlaceholders("s3ObjectUrlWithPlaceholders")
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK;

var fileAssetLocation = new FileAssetLocation {
    BucketName = "bucketName",
    HttpUrl = "httpUrl",
    ObjectKey = "objectKey",
    S3ObjectUrl = "s3ObjectUrl",

    // the properties below are optional
    KmsKeyArn = "kmsKeyArn",
    S3ObjectUrlWithPlaceholders = "s3ObjectUrlWithPlaceholders"
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import cdk "github.com/aws/aws-cdk-go/awscdk"

fileAssetLocation := &FileAssetLocation{
	BucketName: jsii.String("bucketName"),
	HttpUrl: jsii.String("httpUrl"),
	ObjectKey: jsii.String("objectKey"),
	S3ObjectUrl: jsii.String("s3ObjectUrl"),

	// the properties below are optional
	KmsKeyArn: jsii.String("kmsKeyArn"),
	S3ObjectUrlWithPlaceholders: jsii.String("s3ObjectUrlWithPlaceholders"),
}
```

## Properties

- `bucketName`: string (required) — The name of the Amazon S3 bucket.

- `httpUrl`: string (required) — 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`

- `kmsKeyArn`: string — The ARN of the KMS key used to encrypt the file asset bucket, if any.

  **Default:** Asset bucket is not encrypted, or decryption permissions are defined by a Key Policy.

  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.

- `objectKey`: string (required) — The Amazon S3 object key.

- `s3ObjectUrl`: string (required) — 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`

- `s3ObjectUrlWithPlaceholders`: string — Like `s3ObjectUrl`, but not suitable for CloudFormation consumption.

  **Default:** This feature cannot be used

  If there are placeholders in the S3 URL, they will be returned un-replaced
  and un-evaluated.
