mirror of
https://github.com/Sea-Haven-Industries/forgejo.git
synced 2026-10-07 09:48:52 +00:00
- Add size guard before downloading dump in restore test (3.5 GB cap)
- Use paginator for list_objects_v2 in S3 checks and restore test
- Remove unnecessary overrideLogicalId on GcsTransferCredentials secret
- Pass explicit { mode: "daily" } to daily EventBridge rule target
- Add fallback for SSM parameter fetch in backup script
- Export replica bucket ARN/name from replica stack, consume via props
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
import * as cdk from "aws-cdk-lib";
|
|
import * as s3 from "aws-cdk-lib/aws-s3";
|
|
import { Construct } from "constructs";
|
|
|
|
export class ForgejoReplicaStack extends cdk.Stack {
|
|
public readonly replicaBucketArn: string;
|
|
public readonly replicaBucketName: string;
|
|
|
|
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
|
|
super(scope, id, props);
|
|
|
|
const replicaBucket = new s3.Bucket(this, "ReplicaBucket", {
|
|
bucketName: "forgejo-backups-replica-328440206208",
|
|
encryption: s3.BucketEncryption.S3_MANAGED,
|
|
blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL,
|
|
versioned: true,
|
|
objectLockEnabled: true,
|
|
objectLockDefaultRetention: s3.ObjectLockRetention.governance(
|
|
cdk.Duration.days(90)
|
|
),
|
|
lifecycleRules: [
|
|
{
|
|
id: "archive-to-glacier",
|
|
prefix: "archive/",
|
|
transitions: [
|
|
{
|
|
storageClass: s3.StorageClass.GLACIER,
|
|
transitionAfter: cdk.Duration.days(30),
|
|
},
|
|
],
|
|
},
|
|
{
|
|
id: "cleanup-noncurrent-versions",
|
|
noncurrentVersionExpiration: cdk.Duration.days(90),
|
|
},
|
|
],
|
|
removalPolicy: cdk.RemovalPolicy.RETAIN,
|
|
});
|
|
|
|
this.replicaBucketArn = replicaBucket.bucketArn;
|
|
this.replicaBucketName = replicaBucket.bucketName;
|
|
}
|
|
}
|