本文主要来源于:
在为S3中object创建了Publicly Accessible权限后,
在CloudFront中创建一个web distribution,在Web section下点Get Started。
在Origin Domain Name中选择S3名称,滑倒底部选择Create Distribution。
将以下代码写到text file中,保存为html文件。
替换其中DOMAIN为CloudFront distribution的Domain Name。
OBJECT为上传到S3 bucket中的file name。
<html>
<head>My CloudFront Test</head>
<body>
<p>My text content goes here.</p>
<p><img src="http://DOMAIN/OBJECT" alt="my test image" /></p>
</body>
</html>
打开这个html文件,即可访问你的图片。