Skip to content
Open
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
5 changes: 5 additions & 0 deletions infra/billing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import { allSecrets, assumable } from "./secret";
const queue = new sst.aws.Queue("BillingQueue", {
fifo: true,
visibilityTimeout: "180 seconds",
transform: {
queue: {
sqsManagedSseEnabled: true,
},
},
});

queue.subscribe(
Expand Down
32 changes: 31 additions & 1 deletion infra/issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,25 @@ import { multiregion, regions } from "./regions";
export const issueDetectionQueue = new sst.aws.Queue("IssueDetectionQueue", {
fifo: true,
visibilityTimeout: "5 minutes",
transform: {
queue: {
sqsManagedSseEnabled: true,
},
},
});
issueDetectionQueue.subscribe({
handler: "packages/backend/src/function/issues/detected.handler",
link: [database, email],
});

const stream = new sst.aws.KinesisStream("IssueStream");
const stream = new sst.aws.KinesisStream("IssueStream", {
transform: {
stream: {
encryptionType: "KMS",
kmsKeyId: "alias/aws/kinesis",
},
},
});
stream.subscribe(
"IssueStreamSubscriber",
{
Expand Down Expand Up @@ -123,6 +135,17 @@ const cfnTemplate = $jsonStringify({
Type: "String",
Description: "The template URL",
},
logGroupKmsKeyArn: {
Type: "String",
Default: "",
Description:
"Optional KMS key ARN for encrypting CloudWatch logs at rest. Leave empty to disable encryption.",
},
},
Conditions: {
HasLogGroupKmsKey: {
"Fn::Not": [{ "Fn::Equals": [{ Ref: "logGroupKmsKeyArn" }, ""] }],
},
},
Resources: {
SubscriberRole: {
Expand Down Expand Up @@ -213,6 +236,13 @@ const cfnTemplate = $jsonStringify({
"Fn::Sub": "/aws/lambda/sst-console-issue-${workspaceID}",
},
RetentionInDays: 1,
KmsKeyId: {
"Fn::If": [
"HasLogGroupKmsKey",
{ Ref: "logGroupKmsKeyArn" },
{ Ref: "AWS::NoValue" },
],
},
},
},
SubscriberPermission: {
Expand Down
16 changes: 16 additions & 0 deletions infra/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@ export const storage = new sst.aws.Bucket("Storage", {
ignorePublicAcls: false,
restrictPublicBuckets: false,
},
bucket: {
serverSideEncryptionConfiguration: {
rule: {
applyServerSideEncryptionByDefault: {
sseAlgorithm: "AES256",
},
},
},
},
},
});

Expand Down Expand Up @@ -73,6 +82,13 @@ export const publicStorage = multiregion((region, provider) => {
transform: {
bucket(args, opts) {
args.bucket = `sst-public-${$app.stage}-${region}`;
args.serverSideEncryptionConfiguration = {
rule: {
applyServerSideEncryptionByDefault: {
sseAlgorithm: "AES256",
},
},
};
// opts.import = args.bucket;
// opts.ignoreChanges = ["*"];
},
Expand Down