Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: S3 Stack for e2e test reports WIP #5

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/stacks/api/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ export const networkConfigSchema = z.object({

export interface NetworkConfig extends z.infer<typeof networkConfigSchema> {}

export const storageConfigSchema = z.object({})

export interface StorageConfig extends z.infer<typeof storageConfigSchema> {}

export const apiStackConfigSchema = z.object({
eks: eksConfigSchema.default({}).describe('EKS configuration.'),
database: databaseConfigSchema.default({ snapshotIdentifier: '' }),
Expand Down
25 changes: 25 additions & 0 deletions packages/stacks/api/src/stacks/storage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import * as cdk from 'aws-cdk-lib'
import * as s3 from 'aws-cdk-lib/aws-s3'
import { type Construct } from 'constructs'
import { type StorageConfig } from '../schema'

export class StorageStack extends cdk.Stack {
constructor(
scope: Construct,
id: string,
readonly props: StorageConfig,
stackProps?: cdk.StackProps,
) {
super(scope, id, stackProps)

const e2eTestReportsBucketName = 'ccu-e2e-test-reports'
const e2eTestReportsS3 = new s3.Bucket(scope, id, {
bucketName: e2eTestReportsBucketName,
versioned: false,
encryption: s3.BucketEncryption.S3_MANAGED,
accessControl: s3.BucketAccessControl.PUBLIC_READ,
publicReadAccess: true,
objectOwnership: s3.ObjectOwnership.OBJECT_WRITER,
})
}
}