File tree Expand file tree Collapse file tree 6 files changed +53
-5
lines changed
Expand file tree Collapse file tree 6 files changed +53
-5
lines changed Original file line number Diff line number Diff line change 1414 - ' docs/**'
1515 - ' mkdocs.yaml'
1616 - ' .github/workflows/docs.yaml'
17+ - ' *.md'
1718 branches :
1819 - main
1920
@@ -22,8 +23,8 @@ permissions:
2223
2324jobs :
2425 deploy :
25- name : Deploy Documentation to ${{ inputs.environment }}
26- environment : ${{ inputs.environment }}
26+ name : Deploy Documentation to ${{ inputs.environment || 'development' }}
27+ environment : ${{ inputs.environment || 'development' }}
2728 runs-on : ubuntu-latest
2829 steps :
2930 - uses : actions/checkout@v4
4344 path : .cache
4445 restore-keys : |
4546 mkdocs-material-
46- - run : pip install mkdocs-material markdown-callouts mdx_truly_sane_lists mkdocs-nav-weight pymdown-extensions
47+ - name : Install python dependencies
48+ run : |
49+ pip install \
50+ mkdocs-material \
51+ markdown-callouts \
52+ mdx_truly_sane_lists \
53+ mkdocs-nav-weight \
54+ pymdown-extensions
4755 - run : mkdocs build
4856 - run : aws s3 sync ./site "s3://${{ env.DOCS_BUCKET || 'docs.dev.services.cfa.codes' }}/${{ env.PREFIX || 'shared-services' }}"
Original file line number Diff line number Diff line change @@ -16,6 +16,15 @@ module "docs" {
1616 domain = " dev.services.cfa.codes"
1717 subdomain = " docs"
1818
19+ # TODO: Get these from app specs.
20+ prefixes = [
21+ " cmr-entity-resolution" ,
22+ " document-transfer-service" ,
23+ " shared-services" ,
24+ " tax-benefits-backend" ,
25+ " tofu-modules"
26+ ]
27+
1928 # Use the same VPC we use for shared hosting.
2029 # TODO: Use data resources to look this up.
2130 logging_bucket = " shared-services-development-logs"
Original file line number Diff line number Diff line change 11function handler ( event ) {
2- var request = event . request ;
3- var uri = request . uri ;
2+ const request = event . request ;
3+ const uri = request . uri ;
44
55 // If the request is being made to a directory (e.g. / or /docs), we want to
66 // append "index.html" so that S3 serves the proper object. If the path
Original file line number Diff line number Diff line change 1+ resource "aws_iam_policy" "prefix" {
2+ for_each = var. prefixes
3+
4+ name = " ${ local . prefix } -deploy-${ each . value } "
5+ path = " /"
6+ description = " Allow deploy access to ${ each . value } in the documentation bucket"
7+
8+ policy = jsonencode (yamldecode (templatefile (" ${ path . module } /templates/prefix-policy.yaml.tftpl" , {
9+ bucket_arn : module.bucket.arn,
10+ prefix : each.value
11+ })))
12+ }
Original file line number Diff line number Diff line change 1+ Version: " 2012-10-17"
2+ Statement:
3+ - Sid: DocumentationPrefixPolicy
4+ Effect: Allow
5+ Action:
6+ - s3: PutObject
7+ - s3: GetObject
8+ - s3: ListBucket
9+ - s3: DeleteObject
10+ - s3: GetBucketLocation
11+ Resource:
12+ - ${bucket_arn}
13+ - ${bucket_arn}/ ${prefix}/*
Original file line number Diff line number Diff line change @@ -26,6 +26,12 @@ variable "logging_bucket" {
2626 type = string
2727}
2828
29+ variable "prefixes" {
30+ description = " A list of prefixes to create access policies for."
31+ type = set (string )
32+ default = []
33+ }
34+
2935variable "subdomain" {
3036 description = " The subdomain for the documentation hosting."
3137 type = string
You can’t perform that action at this time.
0 commit comments