Skip to content

Commit

Permalink
services/cdn: add how-tos for managing assets (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
tronghn authored Aug 20, 2024
1 parent 24aa410 commit 6b20b76
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/services/cdn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,6 @@ Among many others:

:dart: Learn how to [upload assets to the CDN](how-to/upload-assets.md)

:dart: Learn how to [manage CDN assets](how-to/manage-assets.md)

:books: [CDN reference documentation](reference/README.md)
4 changes: 4 additions & 0 deletions docs/services/cdn/how-to/.pages
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nav:
- upload-assets.md
- manage-assets.md
- ...
36 changes: 36 additions & 0 deletions docs/services/cdn/how-to/manage-assets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
tags: [cdn, how-to]
---

# Manage CDN assets

This how-to guide shows you how to list and manage assets on the [CDN](../README.md).

In most cases you only need to upload new assets through the GitHub Action.
In the rare case you need to manage the assets directly, you can do so through the Google Cloud Console.

## Prerequisites

- You have previously uploaded assets to the CDN. If not, see [Upload assets to the CDN](upload-assets.md).

## Find reference to bucket

Assets are stored in a Google Cloud Bucket.
To find the bucket name:

1. Open the [NAIS console](https://console.<<tenant()>>.cloud.nais.io) in your browser.
2. Select your team.
3. Select the **Settings** tab.
4. Under the **Managed resources** section, look for the heading named **Team CDN bucket**.
5. Click the link (`nais-cdn-<<tenant()>>-<team>-<hash>`) to view the bucket in Google Cloud Console.

## List and manage assets through Google Cloud Console

The bucket view in Google Cloud Console lists your team's uploaded assets.
This might be useful to verify that your uploaded assets are present, or to delete assets are no longer needed or were erroneously uploaded.

Some other common tasks you can perform in the Google Cloud Console:

- [View and edit object metadata](https://cloud.google.com/storage/docs/viewing-editing-metadata)
- [Set Cache-Control headers](https://cloud.google.com/storage/docs/caching) (though this will be overwritten by the GitHub Action on the next upload)
- [Delete objects](https://cloud.google.com/storage/docs/deleting-objects)
4 changes: 4 additions & 0 deletions docs/services/cdn/how-to/upload-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,7 @@ https://cdn.<<tenant()>>.cloud.nais.io/<team>/<destination>

CORS is automatically configured to accept `GET` from any
origin (*).

## Related pages

:dart: Learn how to [manage CDN assets](manage-assets.md)

0 comments on commit 6b20b76

Please sign in to comment.