git clone https://github.com/yapawa/albumsManager.git
cd albumsManager
nvm use
npm ci
The projectName is only used to name the Cloudformation stack.
The default project name YapawaManager can be changed by replacing projectName in amplify/.config/project-config.json
.
Reply to the questions.
When asked about configuring a Cognito Lambda Trigger: reply no.
Else, use the default value when one is proposed.
amplify init
We will be using S3 and Cloudfront to host our CMS and not Amplify Console. S3 hosting doesn’t allow to configure CNAME and certificates out of the box. We need to add it manually to our configuration.
Edit amplify/team-provider-info.json
. Under prod.categories
add and entry for hosting, and replacing the values with the correct ones:
{
"prod": {
"awscloudformation": {
...
},
"categories": {
...,
"hosting": {
"S3AndCloudFront": {
"domainName": "admin.gallery.example.com",
"hostedZoneId": "XXXXXXXXXX",
"certificateArn": "arn:aws:acm:us-east-1:abcdef:certificate/yyyyyyy"
}
}
}
}
}
Create a .env
file and define the domain that will be used by imageResize (cacheDomain variable). Decide also if you want to use S3 Transfer Acceleration when uploading images:
cacheDomain=img.gallery.example.com
transferAcceleration=true
.env
before deploying each of them.Tell amplify to publish your site. Amplify will automatically provision the stack.
amplify publish -c --yes
-c
tells Cloudfront to invalidate existing cache. But you still need to invalidate the cache in your Browser manually.--yes
tells Amplify to answer automatically yes to any question.Be patient, this will take some time, mainly because of the Cloudfront distribution.
Open src/aws-exports.js
and store somewhere the value for aws_user_files_s3_bucket, you will need it when configuring Image Resize.
Open src/aws-exports.js
and store somewhere the value for aws_user_pools_web_client_id, you will need it when configuring Public Site.
Open your browser and go to the Cognito Console.
Open the created User Pool and create a new user. This user will be the one used to administer the albums and images.