Skip to content

One Observability Workshop v3.0.0


One Observability Workshop / constructs/assets / WorkshopAssets

Class: WorkshopAssets

Defined in: constructs/assets.ts:65

AWS CDK Construct that creates S3 bucket for pet adoption assets with optional seed data deployment Assets

Extends

  • Construct

Constructors

Constructor

new WorkshopAssets(scope, id, properties?): WorkshopAssets

Defined in: constructs/assets.ts:85

Creates a new Assets construct with S3 bucket and optional seed data deployment If seedPaths are provided, deploys local assets to the bucket under 'petimages' prefix

Parameters

scope

Construct

The parent construct

id

string

The construct ID

properties?

AssetsProperties

Configuration properties for the construct

Returns

WorkshopAssets

Overrides

Construct.constructor

Properties

bucket

bucket: Bucket

Defined in: constructs/assets.ts:70

The S3 bucket for storing pet adoption assets


distribution

distribution: Distribution

Defined in: constructs/assets.ts:76

The CloudFront distribution for serving pet adoption assets

Methods

importBucketFromExports()

static importBucketFromExports(scope, id): IBucket

Defined in: constructs/assets.ts:303

Imports an S3 bucket from CloudFormation exports created by WorkshopAssets

This static method reconstructs a bucket instance from CloudFormation exports, allowing other stacks to reference and use the bucket created by the core infrastructure.

Parameters

scope

Construct

The construct scope where the bucket will be imported

id

string

The construct identifier for the imported bucket

Returns

IBucket

The imported bucket instance

Example

const bucket = WorkshopAssets.importBucketFromExports(this, 'ImportedBucket');
// Use bucket.bucketName, bucket.bucketArn, etc.