DEV Community

Cover image for Trying Various Settings for AWS Amplify Gen2 Hosting
Yasunori Kirimoto for AWS Heroes

Posted on

Trying Various Settings for AWS Amplify Gen2 Hosting

In 2024, AWS Amplify has evolved into Gen2.

Gen2 has evolved in many ways compared to Gen1, including TypeScript-first development, development in a separate per-developer sandbox environment, Git branch-based automated deployment, and AWS CDK-based integration of non-native Amplify features. Code-driven, full-stack development allows for seamless front-end and back-end integration and increased productivity.

I wrote an article on Hosting configuration for AWS Amplify Gen1 two years ago. This time, I will introduce Hosting settings for Amplify now in Gen2. I plan to try other features in the future.

Advance Preparation

Create a repository on GitHub and reflect your code.
img

Hosting Using GitHub with Amplify Console (Gen2)

This is how to publish using GitHub with the Amplify Console (Gen2).

Click AWS Management Console → AWS Amplify.
img

Click "Create new app."
img

Click "GitHub" → Click "Next."
img

Click "Authorize" when the GitHub authorization screen appears.
img

Select the repository and branch you have prepared in advance. → Click "Next."
img

Click "Next."
img

Click "Save and deploy."
img

After deployment is complete, click "Visit deployed URL."
img

The deployed website will be displayed.
img

Publish Basic Authentication in Amplify Console (Gen2)

This is how to publish Basic Authentication in Amplify Console (Gen2).

Click Access control → Click "Manage access."
img

Set the access setting to Restricted. Set the username and password → Click "Save."
img

Confirm the settings.
img

When you access the URL, you will be prompted to enter the username and password.
img

Enter the user and password you set, and then the website will appear.
img

Amplify Console (Gen2) adds preview functionality

This is how to add a preview function in Amplify Console (Gen2).

Click Previews → Select a branch → Click "Edit settings."
img

Enable pull request preview → Click "Confirm."
img

Create a pull request with some changes to the file.
img

After creation, a preview link will be displayed.
img

You can also check the deployment environment for the preview in the Amplify Console.
img

Redeploy

The environment will be redeployed when the pull request is merged.

Click "Visit deployed URL" after deployment is complete.
img

The updated website will be displayed.
img

Related Articles



References
AWS Amplify

Top comments (0)