Category

Prototyping

Integrating S3 and Cloudfront.

Prototyping

Introduction

The images generated by the tool needed a way to be publicly available so that the final web pages could be used in production environments. During an expert interview with the chapter lead, he mentioned that iO uses AWS for such purposes. Therefore, it was recommended that my tool should also integrate with AWS to host and deliver these images effectively. This would make sure that the images are accessible and can be loaded quickly and reliably on the final web pages.

Abstract

To achieve public availability and high performance for the images, I had to use two services within AWS: S3 and CloudFront. An S3 bucket is like a storage container where the generated image files are saved. CloudFront, on the other hand, is a Content Delivery Network (CDN) that allows the images to be delivered to visitors with low latency and high transfer speeds.

Firstly, I created an IAM user to get an access token, which enabled me to interact with both the S3 bucket and CloudFront. For integrating these services into the backend of my tool, I used Boto3, which is a package provided by AWS. Boto3 makes the interactions with the AWS services much simpler through its API.

Prompts

Here’s how the integration works: once an image is generated by DALL-E 3, the tool assigns it a random ID and uploads it to the S3 bucket. After uploading, it gets the image's URL through CloudFront. This URL is then embedded into the HTML content generated by the tool, which makes sure that the image is publicly accessible and can be loaded quickly.

For example, the code would generate a unique URL for the image like:

https:// d2dijoe7tpyv56.cloudfront.net/2ac8f55b-46a5-498f-b546-424d8be52f2a

By doing this, the images are not only stored securely but are also delivered quickly to visitors, which improves the overall performance and user experience of the generated web pages.

Conclusion

This update was a good improvement as it made the images publicly accessible and makes sure they can be loaded faster and more reliably. By integrating the AWS services S3 and CloudFront, the tool now supports production ready image hosting and delivery. This makes the generated web pages more suitable for real world use, giving users a better experience. Moving forward, this setup will allow for further improvements and scalability of the tool.

Luuk Briels - 467020 - Media Design

Luuk Briels - 467020 - Media Design

Luuk Briels - 467020 - Media Design