| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572 |
- {
- "AWSTemplateFormatVersion": "2010-09-09",
- "Metadata": {
- "AWS::CloudFormation::Designer": {
- "ee78c12d-0d1e-4ca0-8fa9-ba02f49d071c": {
- "size": {
- "width": 60,
- "height": 60
- },
- "position": {
- "x": 30,
- "y": 60
- },
- "z": 0,
- "embeds": []
- },
- "a52902b8-f027-45a8-9151-3e56ced5fb42": {
- "size": {
- "width": 60,
- "height": 60
- },
- "position": {
- "x": 30,
- "y": 140
- },
- "z": 0,
- "embeds": []
- },
- "674a64fc-3703-4222-91b9-4878490489e2": {
- "size": {
- "width": 60,
- "height": 60
- },
- "position": {
- "x": 250,
- "y": 100
- },
- "z": 0,
- "embeds": [],
- "isassociatedwith": [
- "5c314e8e-535b-4b09-8bb7-c089794a3829"
- ]
- },
- "5c314e8e-535b-4b09-8bb7-c089794a3829": {
- "size": {
- "width": 60,
- "height": 60
- },
- "position": {
- "x": 250,
- "y": 210
- },
- "z": 0,
- "embeds": []
- },
- "3da9a376-afc1-4b37-add1-9cf0df20b0a0": {
- "size": {
- "width": 60,
- "height": 60
- },
- "position": {
- "x": 360,
- "y": 100
- },
- "z": 0,
- "embeds": []
- },
- "7fd11cc7-5574-44f3-99df-877b6f0f2a74": {
- "size": {
- "width": 60,
- "height": 60
- },
- "position": {
- "x": 130,
- "y": 60
- },
- "z": 0,
- "embeds": [],
- "isassociatedwith": [
- "ee78c12d-0d1e-4ca0-8fa9-ba02f49d071c"
- ]
- },
- "1d8a8e19-2661-44d4-99c0-4a2c88c8557d": {
- "size": {
- "width": 60,
- "height": 60
- },
- "position": {
- "x": 130,
- "y": 140
- },
- "z": 0,
- "embeds": [],
- "isassociatedwith": [
- "a52902b8-f027-45a8-9151-3e56ced5fb42"
- ]
- },
- "e29c9a81-85ad-4511-ab1e-018fe50f1573": {
- "size": {
- "width": 60,
- "height": 60
- },
- "position": {
- "x": 30,
- "y": 220
- },
- "z": 0,
- "embeds": []
- },
- "1388662c-85e1-4f6e-9b80-0f1888a6e07d": {
- "size": {
- "width": 60,
- "height": 60
- },
- "position": {
- "x": 130,
- "y": 220
- },
- "z": 0,
- "embeds": [],
- "isassociatedwith": [
- "e29c9a81-85ad-4511-ab1e-018fe50f1573"
- ]
- },
- "236600ec-46ca-4770-8d7c-61532a6d8c27": {
- "size": {
- "width": 60,
- "height": 60
- },
- "position": {
- "x": 30,
- "y": 300
- },
- "z": 0,
- "embeds": []
- },
- "454a6298-2f35-48d7-8cd5-3152d78a585b": {
- "size": {
- "width": 60,
- "height": 60
- },
- "position": {
- "x": 130,
- "y": 300
- },
- "z": 0,
- "embeds": []
- }
- }
- },
- "Resources": {
- "Blobs": {
- "Type": "AWS::S3::Bucket",
- "Properties": {
- "BucketName": {
- "Fn::Join": [
- "-",
- [
- {
- "Ref": "OverleafEditorBucketPrefix"
- },
- "blobs"
- ]
- ]
- },
- "VersioningConfiguration": {
- "Status": "Enabled"
- },
- "LifecycleConfiguration": {
- "Rules": [
- {
- "NoncurrentVersionExpirationInDays": 90,
- "Status": "Enabled"
- }
- ]
- },
- "BucketEncryption": {
- "ServerSideEncryptionConfiguration": [
- {
- "ServerSideEncryptionByDefault": {
- "SSEAlgorithm": "AES256"
- }
- }
- ]
- }
- },
- "Metadata": {
- "AWS::CloudFormation::Designer": {
- "id": "ee78c12d-0d1e-4ca0-8fa9-ba02f49d071c"
- }
- }
- },
- "Chunks": {
- "Type": "AWS::S3::Bucket",
- "Properties": {
- "BucketName": {
- "Fn::Join": [
- "-",
- [
- {
- "Ref": "OverleafEditorBucketPrefix"
- },
- "chunks"
- ]
- ]
- },
- "VersioningConfiguration": {
- "Status": "Enabled"
- },
- "LifecycleConfiguration": {
- "Rules": [
- {
- "NoncurrentVersionExpirationInDays": 80,
- "Status": "Enabled"
- }
- ]
- },
- "BucketEncryption": {
- "ServerSideEncryptionConfiguration": [
- {
- "ServerSideEncryptionByDefault": {
- "SSEAlgorithm": "AES256"
- }
- }
- ]
- }
- },
- "Metadata": {
- "AWS::CloudFormation::Designer": {
- "id": "a52902b8-f027-45a8-9151-3e56ced5fb42"
- }
- }
- },
- "APIUser": {
- "Type": "AWS::IAM::User",
- "Properties": {
- "Groups": [
- {
- "Ref": "APIGroup"
- }
- ]
- },
- "Metadata": {
- "AWS::CloudFormation::Designer": {
- "id": "674a64fc-3703-4222-91b9-4878490489e2"
- }
- }
- },
- "APIGroup": {
- "Type": "AWS::IAM::Group",
- "Properties": {},
- "Metadata": {
- "AWS::CloudFormation::Designer": {
- "id": "5c314e8e-535b-4b09-8bb7-c089794a3829"
- }
- }
- },
- "APIUserAccessKey": {
- "Type": "AWS::IAM::AccessKey",
- "Properties": {
- "UserName": {
- "Ref": "APIUser"
- }
- },
- "Metadata": {
- "AWS::CloudFormation::Designer": {
- "id": "3da9a376-afc1-4b37-add1-9cf0df20b0a0"
- }
- }
- },
- "BlobsPolicy": {
- "Type": "AWS::S3::BucketPolicy",
- "Properties": {
- "Bucket": {
- "Ref": "Blobs"
- },
- "PolicyDocument": {
- "Id": "BlobsPolicy",
- "Version": "2012-10-17",
- "Statement": [
- {
- "Sid": "BlobsPolicyAPIUser",
- "Action": [
- "s3:GetObject",
- "s3:PutObject"
- ],
- "Effect": "Allow",
- "Resource": {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "Blobs"
- },
- "/*"
- ]
- ]
- },
- "Principal": {
- "AWS": {
- "Fn::GetAtt": [
- "APIUser",
- "Arn"
- ]
- }
- }
- }
- ]
- }
- },
- "Metadata": {
- "AWS::CloudFormation::Designer": {
- "id": "7fd11cc7-5574-44f3-99df-877b6f0f2a74"
- }
- }
- },
- "ChunksPolicy": {
- "Type": "AWS::S3::BucketPolicy",
- "Properties": {
- "Bucket": {
- "Ref": "Chunks"
- },
- "PolicyDocument": {
- "Id": "ChunksPolicy",
- "Version": "2012-10-17",
- "Statement": [
- {
- "Sid": "ChunksPolicyAPIUser",
- "Action": [
- "s3:GetObject",
- "s3:PutObject",
- "s3:DeleteObject"
- ],
- "Effect": "Allow",
- "Resource": {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "Chunks"
- },
- "/*"
- ]
- ]
- },
- "Principal": {
- "AWS": {
- "Fn::GetAtt": [
- "APIUser",
- "Arn"
- ]
- }
- }
- }
- ]
- }
- },
- "Metadata": {
- "AWS::CloudFormation::Designer": {
- "id": "1d8a8e19-2661-44d4-99c0-4a2c88c8557d"
- }
- }
- },
- "Zips": {
- "Type": "AWS::S3::Bucket",
- "Properties": {
- "BucketName": {
- "Fn::Join": [
- "-",
- [
- {
- "Ref": "OverleafEditorBucketPrefix"
- },
- "zips"
- ]
- ]
- },
- "BucketEncryption": {
- "ServerSideEncryptionConfiguration": [
- {
- "ServerSideEncryptionByDefault": {
- "SSEAlgorithm": "AES256"
- }
- }
- ]
- },
- "LifecycleConfiguration": {
- "Rules": [
- {
- "ExpirationInDays": 1,
- "Status": "Enabled"
- }
- ]
- },
- "PublicAccessBlockConfiguration": {
- "BlockPublicAcls": true,
- "BlockPublicPolicy": true,
- "IgnorePublicAcls": true,
- "RestrictPublicBuckets": true
- }
- },
- "Metadata": {
- "AWS::CloudFormation::Designer": {
- "id": "e29c9a81-85ad-4511-ab1e-018fe50f1573"
- }
- }
- },
- "ZipsPolicy": {
- "Type": "AWS::S3::BucketPolicy",
- "Properties": {
- "Bucket": {
- "Ref": "Zips"
- },
- "PolicyDocument": {
- "Id": "ZipsPolicy",
- "Version": "2012-10-17",
- "Statement": [
- {
- "Sid": "ZipsPolicyAPIUser",
- "Action": [
- "s3:GetObject",
- "s3:PutObject"
- ],
- "Effect": "Allow",
- "Resource": {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "Zips"
- },
- "/*"
- ]
- ]
- },
- "Principal": {
- "AWS": {
- "Fn::GetAtt": [
- "APIUser",
- "Arn"
- ]
- }
- }
- }
- ]
- }
- },
- "Metadata": {
- "AWS::CloudFormation::Designer": {
- "id": "1388662c-85e1-4f6e-9b80-0f1888a6e07d"
- }
- }
- },
- "Analytics": {
- "Type": "AWS::S3::Bucket",
- "Properties": {
- "BucketName": {
- "Fn::Join": [
- "-",
- [
- {
- "Ref": "OverleafEditorBucketPrefix"
- },
- "analytics"
- ]
- ]
- }
- },
- "Metadata": {
- "AWS::CloudFormation::Designer": {
- "id": "236600ec-46ca-4770-8d7c-61532a6d8c27"
- }
- }
- },
- "AnalyticsPolicy": {
- "Type": "AWS::S3::BucketPolicy",
- "Properties": {
- "Bucket": {
- "Ref": "Analytics"
- },
- "PolicyDocument": {
- "Id": "AnalyticsPolicy",
- "Version": "2012-10-17",
- "Statement": [
- {
- "Sid": "AnalyticsPolicyAPIUser",
- "Action": [
- "s3:GetObject",
- "s3:PutObject",
- "s3:DeleteObject"
- ],
- "Effect": "Allow",
- "Resource": {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "Analytics"
- },
- "/*"
- ]
- ]
- },
- "Principal": {
- "AWS": {
- "Fn::GetAtt": [
- "APIUser",
- "Arn"
- ]
- }
- }
- },
- {
- "Sid": "AnalyticsPolicyAPIUserBucketPerms",
- "Action": "s3:ListBucket",
- "Effect": "Allow",
- "Resource": {
- "Fn::Join": [
- "",
- [
- "arn:aws:s3:::",
- {
- "Ref": "Analytics"
- }
- ]
- ]
- },
- "Principal": {
- "AWS": {
- "Fn::GetAtt": [
- "APIUser",
- "Arn"
- ]
- }
- }
- }
- ]
- }
- },
- "Metadata": {
- "AWS::CloudFormation::Designer": {
- "id": "454a6298-2f35-48d7-8cd5-3152d78a585b"
- }
- }
- }
- },
- "Parameters": {
- "OverleafEditorBucketPrefix": {
- "Description": "Prefix for the S3 bucket names (e.g. production-overleaf-editor or staging-overleaf-editor)",
- "Type": "String"
- }
- },
- "Outputs": {
- "APIUserAccessKey": {
- "Value": {
- "Ref": "APIUserAccessKey"
- }
- },
- "APIUserSecretKey": {
- "Value": {
- "Fn::GetAtt": [
- "APIUserAccessKey",
- "SecretAccessKey"
- ]
- }
- }
- }
- }
|