## Build your sphinx document > Assumes you already have a [sphinx](http://www.sphinx-doc.org/en/master/) project installed and a project created ``` make html ``` > By default this command will build documentation to `_build/html` ## Setup IP restricted S3 Bucket (for use as internal website) This describes the procedure to setup an S3 bucket. > NOTE: This assumes you have the awscli installed In order to apply an IP restriction you need to set the `bucket policy`. 1. Confirm the current bucket policy: ``` aws s3api get-bucket-policy --bucket store-manager-spec ``` > If you don't have a bucket policy defined you will get an error: "... The bucket policy does not exist" 2. Define your policy document, create a file named `ip-restriced-bucket-policy.json` and update with the following: ``` { "Id": "IPLimitedAccessPolicy", "Version": "2012-10-17", "Statement": [ { "Sid": "AllowTrustedIPs", "Effect": "Allow", "Principal": "*", "Action": "s3:GetObject", "Resource": "arn:aws:s3:::MY_BUCKET_NAME/*", "Condition": { "IpAddress": { "aws:SourceIp": [ "IP_TO_ALLOW/32" ] } } } ] } ``` 3. Set the bucket policy: ``` aws s3api put-bucket-policy --bucket MY_BUCKET_NAME --policy file://ip-restriced-bucket-policy.json ``` ## Send built documentation to s3 bucket From the `_build/html` directory run the following command to sync the content of the folder with the remote bucket: ``` aws s3 sync . s3://MY_BUCKET_NAME/ ``` ## Configure bucket as static website The following will configure the s3 bucket to operate as a website at: ``` aws s3 website s3://MY_BUCKET_NAME/ --index-document index.html ```