Skip to content

Commit

Permalink
Merge branch 'main' into DOP-4401
Browse files Browse the repository at this point in the history
  • Loading branch information
anabellabuckvar authored Mar 25, 2024
2 parents d6365fd + 0480b71 commit 614e88e
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ RUN cd ./modules/oas-page-builder \
# where repo work will happen
FROM ubuntu:20.04
ARG WORK_DIRECTORY=/home/docsworker-xlarge
ARG SNOOTY_PARSER_VERSION=0.16.1
ARG SNOOTY_FRONTEND_VERSION=0.16.5
ARG SNOOTY_PARSER_VERSION=0.16.3
ARG SNOOTY_FRONTEND_VERSION=0.16.6
ARG MUT_VERSION=0.11.1
ARG REDOC_CLI_VERSION=1.2.3
ARG NPM_BASE_64_AUTH
Expand Down
1 change: 1 addition & 0 deletions cdk-infra/utils/buckets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const docsBucketNames = [
'docs-go',
'docs-java',
'docs-node',
'docs-languages',
] as const;

interface CustomBucketProps {
Expand Down
43 changes: 43 additions & 0 deletions infrastructure/ecs-main/buckets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,19 @@ Resources:
IndexDocument: index.html
ErrorDocument: ${self:custom.site.errorDoc.${self:provider.stage}, null}

LanguagesBucket:
Type: "AWS::S3::Bucket"
Properties:
PublicAccessBlockConfiguration:
BlockPublicAcls: false
BlockPublicPolicy: false
IgnorePublicAcls: false
RestrictPublicBuckets: false
BucketName: ${self:custom.languagesBucketName}
WebsiteConfiguration:
IndexDocument: index.html
ErrorDocument: ${self:custom.site.errorDoc.${self:provider.stage}, null}

DocsBucketPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Expand Down Expand Up @@ -415,3 +428,33 @@ Resources:
Action: 's3:PutObject'
Resource:
- Fn::Join: ['', [{ "Fn::GetAtt": ["CSharpBucket", "Arn" ] }, '/*']]

LanguagesBucketPolicy:
Type: AWS::S3::BucketPolicy
Properties:
Bucket:
Ref: LanguagesBucket
PolicyDocument:
Statement:
- Sid: PublicReadGetObject
Effect: Allow
Principal: "*"
Action:
- s3:GetObject
Resource:
- Fn::Join: ['', [{ "Fn::GetAtt": ["LanguagesBucket", "Arn" ] }, '/*']]
- Effect: Allow
Principal:
AWS: arn:aws:iam::${aws:accountId}:role/docs-archive-job-${self:provider.stage}-batch
Action:
- 's3:GetObject'
- 's3:ListBucket'
Resource:
- Fn::Join: ['', [{ "Fn::GetAtt": ["LanguagesBucket", "Arn" ] }, '/*']]
- Fn::Join: ['', [{ "Fn::GetAtt": ["LanguagesBucket", "Arn" ] }]]
- Effect: Allow
Principal:
AWS: arn:aws:iam::${aws:accountId}:role/docs-deploy-job-${self:provider.stage}-batch
Action: 's3:PutObject'
Resource:
- Fn::Join: ['', [{ "Fn::GetAtt": ["LanguagesBucket", "Arn" ] }, '/*']]
4 changes: 1 addition & 3 deletions infrastructure/ecs-main/serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,9 @@ custom:
cSharpBucketName: docs-csharp-${self:provider.stage}
cSharpIntgrBucketName: docs-csharp-dev
goBucketName: docs-go-${self:provider.stage}
goIntgrBucketName: docs-go-intgr
javaBucketName: docs-java-${self:provider.stage}
javaIntgrBucketName: docs-java-intgr
nodeBucketName: docs-node-${self:provider.stage}
nodeIntgrBucketName: docs-node-intgr
languagesBucketName: docs-languages-${self:provider.stage}
jobCollection: ${ssm:/env/${self:provider.stage}/docs/worker_pool/atlas/collections/job/queue}
repoBranchesCollection: ${ssm:/env/${self:provider.stage}/docs/worker_pool/atlas/collections/repo}
docsetsCollection: ${ssm:/env/${self:provider.stage}/docs/worker_pool/atlas/collections/docsets}
Expand Down

0 comments on commit 614e88e

Please sign in to comment.