`Case 5:18-md-02834-BLF Document 338-5 Filed 01/09/19 Page 1 of 16
`
`EXHIBIT E
`EXHIBIT E
`
`
`
`Case 5:18-md-02834-BLF Document 338-5 Filed 01/09/19 Page 2 of 16
`
`Ama zon Si m ple Storage Service
`Developer Guide
`API Version 2006-03-01
`
`re¡-trftmazon
`ll webservlceg'
`
`AMZ PWT 00000278
`
`
`
`Case 5:18-md-02834-BLF Document 338-5 Filed 01/09/19 Page 3 of 16
`
`Amazon Simple Storage Service Developer Guide
`
`Amazon Web Services, LLC
`
`AMZ PWT 00000279
`
`
`
`Case 5:18-md-02834-BLF Document 338-5 Filed 01/09/19 Page 4 of 16
`
`Amazon Simple Storage Service Developer Guide
`
`Amazon Simple Storage Service: Developer Guide
`Amazon Web Services, LLC
`Copyright A 2OQ Amazon Web Services LLC or its affiliates. All rights reserved.
`
`The following are trademarks or registered trademarks of Amazon: Amazon, Amazon.com, Amazon.com
`Design, Amazon DevPay, Amazon EC2, Amazon Web Services Design, AWS, CloudFront, EC2, Elastic
`Compute Cloud, Kindle, and Mechanical Turk. ln addition, Amazon.com graphics, logos, page headers,
`bulton icons, scripts, and service names are trademarks, or trade dress of Amazon in the U.S. and/or other
`countries. Amazon's trademarks and trade dress may not be used in connection with any product or service
`that is not Amazon's, in any manner thal is likely to cause confusion among customers, or in any manner
`that disparages or discredits Amazon.
`
`All other trademarks not owned by Amazon are the property of their respective owners, who may or may
`not be affiliated wilh, connected to, or sponsored by Amazon.
`
`AMZ_PWT_o0000280
`
`
`
`Case 5:18-md-02834-BLF Document 338-5 Filed 01/09/19 Page 5 of 16
`
`Amazon Simple Storage Service Developer Guide
`Managing Bucket Website Confiquration
`
`2
`
`Optionally, when creating a bucket in the Northern California Region, you can also use a
`Region-specif c endpoint in the request to creãte the bucket. For example, to match the Region
`specified in step "1, you would use the endpoint, htips:,/./s3-us-west-1. amazcnaws. com (or
`http : ,/ /s 3-us-west-1 . amaz onaws . com),
`Using the Region-specific endpoint avoids the latency caused by the redireciion of requests from
`US Standard to the Northern Çalifornia Region. For more information, see Redirection (p.87). (The
`EU (lreland) Region does not have a Region-specific endpoint.)
`
`l
`
`lmportant
`
`Even if you use a Region-specific endpoint ¡n a request to create a Northern California
`Region bucket, you must set lhe value of ,Locatio¡co¡sËrairÈ lo the same Region.
`
`Bucket Access
`To access Amazon 53 buckets and objects that were created using createBuckêtcônfj guråti cn,
`you can use the virtual hosted-style request in all Regions. For example:
`
`http :,/ / youïbucket . s3 . amazonaws . com,/youroh j ect
`
`To use the path-style request, the bucket must be in the US Classic Region, or the bucket must be in the
`same Region as the endpoint in the request. For example:
`
`http : l/s3, amazonaws . ccm,/yourbucket/you¡obj ect
`Redirection
`Amazon supports two types of redirects: lemporary and permanent.
`
`Temporary redirects automat¡cally redirect users that do not have DNS information for the requested
`bucket. This occurs because DNS changes take time to propagate through the lnternet. For example, if
`a user creâtes a bucket with a location constraint and immediately stores an object in lhe buckel,
`information about the bucket might not distribute throughout the lnternet. Because the bucket is a sub
`domain of s3.amazonaws.com, Amazon 33 redirects it to the conect Amazon 53 location.
`
`You can remove this (short lived) redirection latency by using a Region-specific endpoint in the bucket
`creationrequest.The LocationconstLaint bucketparameterspecifiestheRegionwherethebucket
`will reside. Using the Region-specilic endpoint is optional.The only Region you can do this in is US-West.
`For more information, see How to Spec¡fy a Bucket's Region (p. 86).
`Transferring a Bucket's Contents to Another Region
`Use the following process to transfer your bucket from one Region to another.
`
`To transfer a bucket to another Region
`
`Create a new Amazon S3 bucket in the Region you wish to transfer your data to.
`
`Use the copy operation to transfer each ofyour objects from the source Region to the target Region.
`Bandwldth charges apply for this transfer. For more lnformation, go to COPY Oblect.
`
`1 2
`
`Managing Bucket Website Configuration
`
`Topics
`
`API Version 2006-03-01
`87
`
`AMZ-PWT_o0000372
`
`
`
`Case 5:18-md-02834-BLF Document 338-5 Filed 01/09/19 Page 6 of 16
`
`¡Amazon S¡mple Storage Service Developer Guide
`Managing Websites with the AWS Management Gonsole
`
`. Managing Websites with the AWS Management Console (p. 88)
`. Managing Websiles with the AWS SDK for Java (p.88)
`. Managìng Websites with the AWS SDK for .NET (p.91)
`. Managing Websites with the AWS SDK for PHP (p.95)
`. Managing Websites with the REST API (p.96)
`
`You can host static websites in Amazon 53 by adding website configuration to your bucket. You do this
`by adding a websi re subresource describing the configuration information, such as lhe index document
`name and îhe custom enor document name. There are several ways you can manage your bucket's
`website configuration. AWS Management Console enables you to manage confguration without writing
`any code.You can programmatically create, update and delete the website confìgurâtion using the AWS
`SDK. The SDK provides wrapper classes around the Amazon 53 REST API; and if your application
`requires it, you can send the REST API requests directly from your application.
`Managing Websites w¡th the AWS Management
`Console
`The Amazon 53 console enables you to mânage bucket properiies. The bucket properties pane provides
`the following W¿bsite properties tab for you to manage your bucket's website configuration.
`
`Pefm¡sgioftg
`
`websAe
`
`Notiñcations
`
`You ar host your 6t tic wêbsité cntiGly out of Âmrzon s3. onG your buckot has bccn
`ønfigured as a webs¡te, you æn ðffis ã¡l your mntent v¡å th€ Amazon s3 website
`cndpo¡nt for your buckct.
`gn¡bled:El
`
`Iniler(
`Emi
`
`Eodgo¡nt: htto://cx.molcbuckct.s3-web5¡te"us-eàst-1.ðmrzonrws.ærÌ/
`
`8aúr
`
`Cancol
`
`To confìgure your bucket as a website, you must select the Enabled check box and provide an index
`document name in the lndex Document field.You can optionally provide an error document name in the
`Error Document field. This ¡s the custom error document that you can provide with user-friendly
`infornration. lf you don't provide this document, Amazon 53 relurns predefined enor documents when an
`error occurs. For more information, see Custom Error Document Support (p. 341),
`
`Note
`
`To configure your bucket as a website, the name of your bucket must comply with both the
`Amazon 53 requirements for bucket names and the DNS requirements for host names. For more
`information aboul bucket names, see Bucket Restrictions and Limitations (p. 84).
`lf you clear the Enabled check box, the bucket is no longer a website and cannot be accessed via the
`website endpoints (see Website Endpoints (p.338)). However, the bucket is still accessible via the RESÏ
`endpoint, ln the preceding example, after you clear the Enabled check box, you will not be able to view
`in a browser. However, you can still work
`http://examplebuckef.s3-weós¡Te-us-e¿sl-l.arnazonaws.com
`with the URL as an endpoint using the REST API or one of the AWS SDKs.
`
`Managing Websites with the AWS SDK for Java
`The following tâsks guide you through using the Java classes to manage website conf¡guration to your
`bucket. For more information about the Amazon 53 website feature, see Hosting Websites on Amazon
`s3 (p. 335).
`
`¡{Pl Version 2006-{¡3-{¡l
`88
`
`AMZ_PWT_o0000373
`
`
`
`Case 5:18-md-02834-BLF Document 338-5 Filed 01/09/19 Page 7 of 16
`
`Amazon Simple Storage Serv¡ce Developer Guide
`Managing Websites with the AWS SDK for Java
`
`Managing Website Configuration
`
`Create an instance of the Änazonsl class by providing your AWS credentials.
`
`To add website configuration to a bucket, execute the
`.Amazons3. setBucketvüebsiteconfiguration method.You need to provide the bucket
`name and the website configuration information including the index document and the error
`document names.You must provide the index document, however, lhe enor document is
`opüonal. You provide website configuration information by creating a
`Buckelwebsiteconf iguration object'
`To relrieve website configuration, execute lhe
`ÄrnazonS3. getBuckett/iebsiteConfiguration method by providing the bucket name.
`To delete your bucket webs¡te configurat¡on, êxecute the
`A¡razons3. deleteeucketb¡ebsiteconfiguration method by providing the bucket
`name. Afrer you remove the website conf¡guration, the bucket is no longer available via
`the website endpoint. For more information, see see Website Endpoints (p. 338).
`
`1 2
`
`The following Java code sample demonstrates the preceding tasks.
`
`AtfscredenLials myCredentials = new BasicATiSCredentials (
`mluAccessKey]Ð, ¡nysecretxey) i
`AmazÕns3 s3c.li-ent : new .Amazôns3client (mycredentials) ;
`// Add website confiquration.
`s3cl ienL . se LBucketWebsi teConfig uration (bucketltame,
`neu BucketWebs.iteConfiguraLion (indexDoc , errorDoc) ) ;
`// c'et website configuralion.
`Bucket!,lebsiteconiiguration buckell¡lebsileconf iguration =
`s3Client . geLBrrcketVleLrs iteConf J.gurati-on (bucketl{ame ) ;
`
`/ / Ðe7e,t-e website configuration
`'
`s3cl-ient . deleteBucket?{ebsitecoåf i guration (bucketName ) i
`
`API Version 2006{¡3-01
`89
`
`AMZ PWT 00000374
`
`
`
`Case 5:18-md-02834-BLF Document 338-5 Filed 01/09/19 Page 8 of 16
`
`Amazon Simple Storage Service Developer Guide
`Managing Websites with the AWS SDK for Java
`
`Example
`
`The following Java code example adds a website configuration to the specifìed bucket, retrieves it and
`deletes the webs¡te conf¡guration. For instructions on howlo creâte and test a working sample, see Testing
`the Java Code Examples (p.380).
`
`import
`import
`impcrt
`import
`impcrt
`import
`impcrt
`
`I ava . io . IoExceplion i
`com, amazonaws . Àmazoncl ientËxceplion i
`com , ama zon ðws . Ama2onSe r\tj ceExcepti on;
`com, amazona!ús . auth . Basi cÀWscrecienlia ls ;
`com. amazonaws . services . s3 . "Amazons3,'
`com, ama z onaws . services, s 3 . Arnaz<¡:rS3Cl ient,
`com. amazona¡rts , services . s3, model. tsucketwebsileConfiguration;
`
`public class S3Sanple {
`private staLic String bucketName : nhvphpl";
`privaie slatic string indexDoc : "iniex.html";
`private slat.ic Stríng errorDcc = "er¡or.hlm1";
`public statlc void main(Stríngll args) t.hrow-q lOExceplion {
`Amazons3 s3C.l.ient : new Amazons3client (new Propertiescrede¡tials {
`S3Sample . class , gelResourceAssiream ( "ÄwsCredentia ls . properties " ) ) ) ;
`trv {
`/l çet existing website configuration, if any
`gett¡ebsiteconf ig (s3c1ient.) ;
`
`// Set new websile confiquration.
`s3Client. setBucketwebsiteConf j,guraii on (bucj<etName'
`new BuckeÈ?lebsiteConfiguration (indexDoc' errorDoc) ) ;
`(Get website configuration agaj.n)
`/ / verifv
`qetwebsj teconf1q (s3c1ient) ;
`
`// Delete
`s3Client . deleteBucketWebsi leConfiguration (bucketName ) ;
`/ / .Jeri"'¡y (GeL vJebsi te conf igurat.ì.on aga j n)
`getVùebsiteConf ig ( s3Client) ;
`
`catch (^mazonService$xception ase) {
`SysLem.out,println("Caught an AmäzonserviceExceptionr which'ì +
`" means your request nade it " +
`"tÕ Àmazon S3, but was rejecied with an error respcnse" I
`" fo¡ sone reason.");
`System,out.printl¡ ("Error Messagei
`" + ase.getl4essage() );
`Systen.out.p¡intln{"HTTP Status Code: " + ase,gelslaÈusCodeO ) ;
`Systen.out.p¡lnttn(rrÀ!ÌS Etror Code: " -l ase,gelErrorcode{)),¡
`svstem.out.println ("Error Type:
`'t + ase'getErrorType i) );
`" + ase,getRequestld{));
`System.out.prlntfn("RequesL ID:
`catch (¡nazcnclienlExcept.ion ace) {
`System.out.println {"Caught an ÀmazonclienlException' w¡rich means"+
`the client encountereci " +
`"a serious internal problern r,rhile tryingi to 'r +
`
`API Vers¡on 2006-03-01
`90
`
`AMZ PWT 00000375
`
`
`
`Case 5:18-md-02834-BLF Document 338-5 Filed 01/09/19 Page 9 of 16
`
`Amazon Simple Storage Service Developer Guide
`lUanacinq Websites with the AWS SDK for .NET
`
`"comunical-e with Amazo¡r 53, " +
`"s,.¡ch as noÈ belng able lo access t,he network,");
`(r'Error Message: rr "l åce.getMessageO );
`System,out.println
`
`prj va-'e staLj c Buckettr^lebsj.teConfiguration getWebsì teConfi.g (
`Amazons3 s3client) {
`
`system,out.println ("GeÈ Heb€ite config") ;
`// I. Cet website ccnfig.
`Bucketl'üebsiteconf i guraLion bucketWebsi:econfiguration :
`s 3Cl ien L, getBucket-Websi Lecôn f i guration {bucketNar¡e ) i
`{bucketllebsiteConfiguralion :: nuIl)
`if
`{
`syst.em.out.,print'.ln {"No website conf ig. ") ;
`
`le
`
`l se
`
`AMZ_PWT_o0000376
`
`{
`
`]r
`
`)
`
`("Index doc: " -t'
`System.out.println
`buckelllebsítecÕnf igu.ratiÕn. get TndexÐocumentsuf f íx ( ) ) ;
`Sysl-em.ouL,prinLln ("Elror doc: " +
`bucketWebs i teCon f igurati on . getEr rôrDocunent ( ) ) ;
`
`eturn bucketl{ebsiteCon f iguration ;
`
`ì M
`
`anaging Websites w¡th the AWS SDK for .NET
`The following tasks guide you through using the .NET classes to manage website conf¡guration on your
`bucket. For more information about the Amazon 53 website feature, see Hosting Websites on Amazon
`s3 (p.335).
`
`ilanaging Bucket Website Confi guration
`
`Create an instance of the Âm¿zons3 class by provid¡ng your AWS credent¡als.
`
`To add website conf¡guration to a bucket, execule the ÀmazcnS3. PutBucketwebsite
`method. You need to provide the bucket name and the website configuration information
`including the index document and the error document names.You must provide the index
`document, however, the eno¡ document is optional.You provide this information by creating
`a Pu'"Bucke¡hlebs it.eRequest obiect.
`To retrieve website configuration, execute the Ama?ôns3 . GetBucketllelosite method by
`p¡ovid¡ng the bucket name.
`To delete your bucketwebsite configurât¡on, execute the Ärnazons3 . ÐeleleBucketl'iebsite
`method by providing the bucket name. AÍer you remove lhe website configuration, the
`bucket ¡s no longer available v¡a the webslte endpoint. For nìore informat¡on, see see Website
`Endpo¡nts (p. 338).
`
`1 2
`
`The following C# code sample demonstrates thÊ precedlng tasks.
`
`Amazolls3 client;
`c1 ient - tuna zon, ¡\WSClienlFaclcry' Cr eatetuna zonS3Cl ient (
`
`API Vers¡on ZOOõ-{,3-Or
`91
`
`
`
`Case 5:18-md-02834-BLF Document 338-5 Filed 01/09/19 Page 10 of 16
`
`Amazon Simple Storage Service Developer Guide
`lllanasing Websites with the AWS SDK for .NET
`
`accessKeYID, secrelAccessKeYID) ;
`/ / Adð website configuration.
`Pu LBU ckell,tebsi LeRequÊst FulReqìrest :
`new PrtBucketwebsiteRequest ( )
`. lùithBuckeLName (bucketName )
`(new Websiteconfiguration o
`.WithWebsileConf iguration
`. lii thlndexDocumentSuf f ix ( indexDocumentSuf f ix)
`.WilhErrorDÕcument (errorDocument) ) i
`
`client. PutBucketWebsite (PutRequest) ;
`// GeÌL bucket website confiquration.
`GeLBuckelwebsiteRequesL getRequest -
`new GetBucketWebsiteRequest o
`. Wi thBucketName (bucketName ) ;
`
`:
`GelBucketwebsíleResponse getR€sPonse
`c1 íenl-. GetBuckell,iebs ite ( gelRequest ) ;
`l/ Prinr' configuralion data.
`Cônsole.writel,lne(r'Index document: {0}", gêtResPonse.WebsiteConfiguration'lndex
`Documentsuffix) i
`Co¡sole.W¡iteline("Error documen!: {C}", geLResponse.Webs:iteConfiguraLion'Error
`Document);
`
`// Delete website configuration.
`DeleteBucketwebsiteRequest deleteRequest =
`new DeleteBucketv{ebsiteReqrest ( )
`. viithBucketName (bucketName ) i
`client, DeleteBu cketwebs ite ( del"eteRequest ) ;
`
`API Version 2006-03.0r
`92
`
`AMZ_PWT_o0000377
`
`
`
`Case 5:18-md-02834-BLF Document 338-5 Filed 01/09/19 Page 11 of 16
`
`Amazon Simple Storage Service Developer Guide
`ManaEinqWebsites with the AWS SDK for.NËÏ
`
`Example
`
`The following C# code example adds a website configuration to the specified bucket. The confìguration
`specifies both the index document and the error document names. For instructions on how to create and
`test a working sample, see Testing the .NET Code Examples {p. 381)'
`
`uslng System;
`using System. Conf iguratiÕn;
`using System. col lections, Specialized i
`using Àmazon.53;
`using Àmazon. 53.Model;
`
`namespôce s3.amazon, ccm.docsamples. adcwebsiteconf iguralion
`{
`
`class S3Sarnple
`: r'**' Provide existing bucket name
`{
`sratlc string buckêtName
`stãtic stríng i¡dexDocumentsuffix = "**i Provide index documenÈ name
`= r**x P¡ovide error documenl name
`statlc string errorDocument
`static Alïazons3 client;
`public static void Main(strinq[] arçs)
`{
`if
`{
`
`(checkRequiredFields O )
`
`NamevalueCollecticn aPPConf ig =
`Con fiEu rãti.onMa¡ager . Appsettings ;
`
`string accessKeylD = appConfrg["AWSAccessKey"] ;
`string sec¡elAccessKeyIÐ = appconfig l"At'lSSecrelKey"l,'
`using (client : Ämåzon.AwsClientFactory.Createl\mazons3client {
`accessKeyfD, secretAccessKeylD) )
`
`{
`
`Addl{ebsiteCorìf íg (bucket.Name, indexDocumentSuffix' e¡1orÐoc
`
`ument),'
`
`Consol.e,!{ritel,ine("Pr:ess a¡y key to continre
`Console. ReadKey O ,i
`
`"),
`
`static void ÀddÞilebsltecanfig (string bucketNariìe,
`slring indexÐocumenlsuff ix,
`slring errorDocument)
`
`{
`
`cry
`{
`
`PutBuckeÈWebslteRequesL putReque6t :
`new PuLBucketlûebsiLeRequesl ( l
`. WithBucketName (bucketNanê )
`, Withlf ebsiteConf i guråtion (ner¡ l{ebsiteCÕnf iguration { )
`, WithlndexDocumentSuf f ix ( indexDocumentsuf
`f ix )
`.WithErrorDocument (errorDocumerrt) ) i
`
`API Vers¡on 2006{3-0f
`93
`
`AMZ PWT 00000378
`
`
`
`Case 5:18-md-02834-BLF Document 338-5 Filed 01/09/19 Page 12 of 16
`
`Amazon Simple Storage Service Developer Guide
`Managing Websites with the AWS SDK for .NET
`
`c1 ient. ÞutBucketVlebsite (pulRequest),
`
`(AnazonS3Excepliôn amazonS3rxception )
`
`if
`
`(ar.azonS3Bxception,Errorcoie := null &&
`( ãmazons3Exceptì on . BrrorCode . Equa I s ( " 1nva1 idAccessKeyld " )
`("TnvalidSecurity") ) )
`I I amazonS3Exception.ErrorCode.Equals
`
`] {
`
`{"Check the provided AwS credentials.
`Ccnsofe.llritel,ine
`Console , llritel-ine
`(
`"Sign up for service at http: l/aws.amazon.cor¡/s3");
`
`") ;
`
`Ccnsole . Writel,ine {
`t'Er¡or: {0}, oceur:ed vrhen adciing website configuration
`
`amazonS3Exception.BrrorCode, amazonS3trxcePtion.Message)
`
`;
`
`{
`
`) e
`
`{
`
`1 se
`
`Message:'{1i",
`
`static bool checkRequiredFielis o
`{
`NameValueCol lect ion appConf 19 : Con f i gu rationManager . AppSett íngs ;
`
`(string. rsNullOrEmpÈy (appConfig["AWSAccessKey"] ) ]
`
`Consol"e . WriteLine {
`"AWSAccessKey wãs not set in the Àpp'confj.g file.");
`return
`fal6e;
`
`{string. IsNullorEmpty (appConfig ["À?üsSecreLKey"l ) )
`
`Console . Writel,ine {
`"ÀwssecretKey was rot seL in the App.config file.");
`ret,ûrrì falsei
`(string. lsNullorEmply {bucke!Name) )
`Console.Writel,ine("The variabfe bucketNarne is noÈ set'") ;
`return false;
`
`if
`{
`
`)i
`
`f
`{
`
`)i
`
`f
`{
`
`) r
`
`elurn tTuei
`
`API Version 2006{¡3-l}1
`94
`
`AMZ_PWT_oo000379
`
`
`
`Case 5:18-md-02834-BLF Document 338-5 Filed 01/09/19 Page 13 of 16
`
`¡Amazon Simple Storage Service Developer Guide
`Managing Websites with the AWS SDK for PHP
`
`Managing Websites w¡th the AWS SDK for PHP
`The following tasks guide you through using the PHP classes to manage website confìguration of your
`bucket. For more information about the Amazon 53 webslte feature, see Host¡ng Websites on Amazon
`53 (p.335).
`
`Managing Bucket Website Configuration
`
`Create an instance of the Amazons: class by providing your AWS credentials.
`
`To configure a bucket as a website, execute the Àmazons3. create-webeite-config
`method. You need to provide the bucket name and the website configuølion inlormation
`including the index document and the error document names. lf you don't provide these
`document names, this method adds the index. html and er¡or ' htmr default names to
`the website configuration.You must verify that these documents are present in the bucket.
`To relrieve existing bucket website configuralion, execute the
`Amåzôns3. get_website_config melhod by passing the bucket name as a parsmeler.
`To delete website configuration from a bucket, execute the
`AmazonS3. de-l et.e_websile_con f i.g method by passing the bucket name as a parameter.
`lf you remove the website configuration, the bucket is no longer accessible from the website
`endpoints.
`
`1 2
`
`The following PHP code sample demonstrates the preceding tasks.
`
`<?php
`require_once' . . /aws-sdk-for-php/sdk.class.phpr
`;
`header (icontenl-Type: text/plaini charse'-:utf-8' ) ;
`t*** Provide buckeL ¡ame ***';
`$buckel
`Provide index dôcument name ***ttì
`$.indexDocument ='***
`$errorDocument : r*** Provi-de error docu¡nent name ***ti
`// Instantiate the cLass
`$s3 = new AmazonS3 O ;
`
`to bìlcket'.
`I) Atd website confi.g.
`//
`$response = $s3-)creaLe*wek¡siLe_config ($buckeL'
`array (
`| ìndexDocurnenLr :) $indexDocumenL,
`'errorDoc¡lment r => $crrorDocìjmen.l:) ) i
`
`/ / 2\ ne.r.rteve websil-e c{-)nf igllrat j..rn.
`$response : Ss3->gel websiLe_config ($blckeL) ;
`charsei:r:tf
`hearier ( '(:c)nr.ent -Type: r.ext /plaini
`
`-9 ' ) ;
`
`,// .3) Delete r,¡ebsite cônfiguraLiÕn.
`$response : $s3->de1eLe_websiLe-config (SbuckeL) ;
`
`API Vers¡on ZUUö{,E-UI
`95
`
`AMZ PWT 00000380
`
`
`
`Case 5:18-md-02834-BLF Document 338-5 Filed 01/09/19 Page 14 of 16
`
`Amazon Simple Storage Service Developer Guide
`Manaqinq Websites with the REST API
`
`Example
`
`The following PHP code example first adds a website configuration to the specified bucket. The
`create_wet,site_ configmethodexplicitlyprovidestheindexdocumentanderrordocumentnar¡es.
`The sample also retrieves the website configuralion and prints the response. For more information about
`the Amazon 53 website feature, see Hosting Websites on Amazon 53 (p. 335). For instruclions on how
`to create and test a working sample, see Using the AWS SÐK for PHP (p. 382).
`
`<?php
`require ônce' . ./aus-sdk-for-php/sdk.class.phpr ;
`heâcier{'C{rntent-Type: text/plain; charsei=utf-8' ) ;
`'**+ Provide bucket name ***'i
`$bucke: :
`Provide index documenL nâme *t**t'
`$indexDocument ='***
`'*** Provide er:or document ¡¡ame ***'i
`$errorDocument :
`the class
`Ins:antiaLe
`//
`$s3 = new Amazons3 O ;
`// L') Aàd websiLe config. tÕ brcket.
`$response : $s3->create_website-config (Sbucket,
`"tiîli""o...,ment'
`-> sindexDocument,
`ÈrrÕrÐô¿umenLr => SerrôrDôcument) );
`
`// success?
`var dump {$response->isoK O ) ;
`
`// 2l RetxLeve websile configuration.
`$response = $s3->9el_rvebslLe_conlig ($b¡ckel) ;
`text/pJ-ain; charset-utf-8'
`header ( 'content.-Type:
`($response) ;
`prinl_r
`
`) ,
`
`// 3) DeleLe t¡ebsit,e configurat.ion.
`$response = $s3->deJ-ete_website-config (Sbucket) ;
`var_dump ( $response->isoK O ) t
`
`Managing Websites w¡th the REST API
`
`Topics
`
`You can use the AWS Management Console orthe AWS SDK to configure a bucket as a website. However,
`if your application requires it, you can send REST requests directly. For more information, see the following
`sections in the Amazon Simple Storage Service API Reference.
`
`PUT Bucket website
`GET Bucket website
`DELETE Bucket website
`
`Requester Pays Buckets
`
`ln general, bucket owners pay for all Amazon 53 storage and data transler costs associãted with their
`bucket. A bucket owner, however, can configure a bucket to be a Requester Pays bucket. With Requester
`Pays buckets, the requestêr insteed of the bucket owner pays the cost of the request and the dätâ
`download from the bucket. The bucket owner always pays the cost of storing data.
`
`API Vers¡on Z00li{¡¡t-0r
`96
`
`AMZ_PWT_00000381
`
`
`
`Case 5:18-md-02834-BLF Document 338-5 Filed 01/09/19 Page 15 of 16
`
`Amazon Simple Storage Serv¡ce Developer Guide
`l/Vebsite Endpoints
`
`Website Endpoints
`
`Toplcs
`. Key Differences Between the Amazon Website and the REST API Endpoint (p. 339)
`
`When you configure a bucket as a website, the website is availaUe via the region-specific website endpoint.
`The website endpoint you use must be in the same region that your bucket resides. These website
`endpoints are different than the RESI API endpoints (see Request Endpoints (p. 13)). Amazon 53
`supports the following website endpoint.
`
`s3-websi!e-reEi on. amazonaws . com
`
`The following table lists Amazon 53 regions and corresponding website endpoints.
`
`Reglon
`
`Webslte endpolnt
`
`US Standard
`
`s3-urebsite.us-east-l .amazonaws.com
`
`US West
`(Oregon) Region
`
`US Wesl
`(Northern
`California) Region
`
`EU (lreland)
`Region
`
`Asia Pacific
`(Singapore)
`Region
`
`Asia PaciTìc
`(Iokyo) Region
`
`South Amer¡ca
`(Sao Paulo)
`Region
`
`s3-website-us-west-2.am azonaws.com
`
`s3-webslte-us-west.1 .amazonaws,com
`
`s3-webs¡te.eu-west-'l .amazonaws.com
`
`s3-website-ap-southeast-1 .amazonaws,cÕm
`
`s3-website-ap-northêâst-l.amazonaws.com
`
`s3-website-sa-east-l.amazonaws.com
`
`ln order for your custome¡s to access content on the website endpoints, you must make all your content
`publicly readable. To make your content publicly readable, you can use a bucket policy or an objects ACL
`to grant these permissions.
`
`Note
`
`Requester Pays (see Requester Pays Buckets (p. 96) ) or DevPay buckets do not allow access
`via the website endpoint, Any request to a bucket set up for Requester Pays or DevPay via the
`website endpointwill ¡eceive a 403 Access Denied response.
`
`lf your bucket, (i.e., example-bucker) resides in the US Standard region, the website is available at the
`following Amazon S3 website endpoint.
`
`htlp: ,//example-bucket. s3-wel¡site- us-eásÈ-"1 . amazonaws ' com/
`
`APlVersion 2006-03-01
`338
`
`AMZ_PWT_00000623
`
`
`
`Case 5:18-md-02834-BLF Document 338-5 Filed 01/09/19 Page 16 of 16
`
`Amazon Simple Storage Service Developer Guide
`Key Differences Between the Amazon Website and the
`REST API Endpoinl
`
`lf you have a registered domain, you can add a DNS CNAME entry to point to the Amazon 53 websile
`endpoint. For example, if you have registered domain, www. example-bucket. com, you could create a
`bucket wwv¡. example-bucket. com, and add a DNS CNAME entry point¡ng to
`www . example-bucke L . con. s3-webs ite-<reg ion> . atnazcnaws . cr:m. All requests to
`http: / /www. exarnple-bucket. con will be routed to
`www. example-bucket . co¡ri. s3-website-<region>. amazonaws. com. For more ¡nformation, see
`Virtual Hosting of Buckets (p.60).
`Key Differences Between the Amazon Website and
`the REST API Endpoint
`The website endpoint is optimized for access via a web browser. The following table describes the key
`differences between the Amazon REST API endpoint (see Request Endpoints (p. 13)) and the website
`endpoint.
`
`Website Endpoint
`
`REST API Endpoint
`
`I I
`
`
`
`Key Difference
`
`Requests
`supported
`
`Supports all the bucket and obiect
`operations
`
`Supports only GET ând HEAD requ€sts
`on objects.
`
`Returns an XML listing the object keys
`in the bucket.
`
`Retu¡ns the index document specified in
`the website configuration.
`
`Responses to GET
`and HEAD
`requests at the root
`of a bucket
`
`Enor message
`handling
`
`When a request to a REST API
`endpoint results in an error, Amazon
`53 returns an XML error response.
`
`When a request to a website endpoint
`results in an error, an HTML document is
`returned. However, you can optionally
`provide a custom error document when
`configuring a website, providing your
`customers with a more user-friendly
`experience. Amazon 33 will return this
`custom error document for any HTTP 4XX
`class of enors.
`
`Supports only publicly readable content.
`
`Acc€ss control
`
`Supports both public and private
`content.
`
`lndex Document Support
`
`An index document is a webpage that is returned when a request is made to the root of a website or any
`subfolder. For example, if a user entere hltp : / /'vlww . cxamplc . com in the browser, the server returns
`http : / / r¡r¡w . exampl e . corri/ ir¡dex . hLrrrl, where irrdex . htrtrl is the delault webpage of the website.
`Thus, your customers don't have to remember the exact URL to navigate to use for retrieving the default
`web page. When hosting your website on Amazon 53, you provide this i¡dex document name as part of
`confìguring your bucket as a website, and an object with this name must êxist in your bucket. The trailing
`slash at the rooþlevel URL is optional. For example, if you configure your website with index , htmÌ as
`the index document, either of the following two URLS return the index , html index document at the root
`of your website.
`
`htLp: / / exanple-¡ucjlet, s3-r,ùÊbsite-regi on. amazonar'¡s . con/
`htr-p1. / I exanp"le-bucle¿. s3-website*regjo¡. amazonaws. com
`
`AP! Vers¡on 2006-03-01
`339
`
`AMZ PWT 00000624
`
`