CDLUC3 / mrt-doc

Documentation and Information regarding the Merritt repository
8 stars 4 forks source link

UC3 AWS: Create Cloud Front Distribution for Merritt DEV resources #1850

Open terrywbrady opened 3 months ago

terrywbrady commented 3 months ago

Resources to include

Public resources

Repo Path Comment
mrt-zk api/mrt-zk/java
mrt-zk api/mrt-zk/ruby
mrt-core2 api/mrt-core2/java
mrt-cloud api/mrt-cloud/java
mrt-dashboard api/mrt-dashboard/swagger
uc3-ssm api/uc3-ssm/ruby
mrt-admin-lambda doc/mrt-admin-lambda Generated documentation about reports/actions
mrt-doc app/manifest Manifest valdiation tool
mrt-cron presentation/mrt-cron/schema Schema validation presentation

Private resources (Not immediately in scope)

Workflow

Bucket/Paths

propsed mrt-dev-public bucket

terrywbrady commented 3 months ago

@briri , fyi

briri commented 3 months ago

Ok, this looks like a lot but it's actually not too bad and I am happy to meet with you to walk you through everything (probably good to have @ashleygould join us too!)

Ashley will need to help you out with setting up a HostedZone. If she's busy feel free to just use ours in the dev account. You'll need to make your subdomain something like mrt-docs.dmphub.uc3dev.cdlib.net though.

If Ashley does create a HostedZone for you, you will need to create the following resources:

You'll then want to create your S3 bucket and the CloudFront Distro:

Extra credit ;) You may not need it, but here is the template for my WAF. If you don't use it, you'll want to comment out the references to it in the CloudFront Distro template

Then, I build my Swagger via a script that I run on my local that syncs the contents of the S3 bucket and then invalidates the CloudFront cache so that the changes are available immediately.

I'd recommend starting out with just a simple Hello World index.html file in your S3 bucket just to make sure that all the infrastructure is working

Note that the parameters in the templates can be passed the values via the AWS CLI if you go that route, or if you want to use Sceptre (recommended) you can find the corresponding sceptre config files for these in my config directory. Within that folder, I have a global dir which means that those resources are created in the AWS global region 'us-east-1' because 🤷🏻 they require it, the regional dir is all resources built in the 'us-west-2' region which is where we want all of our stuff