Assumes you already have a sphinx project installed and a project created
make html
By default this command will build documentation to
_build/html
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
.
-
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"
-
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" ] } } } ] }
-
Set the bucket policy:
aws s3api put-bucket-policy --bucket MY_BUCKET_NAME --policy file://ip-restriced-bucket-policy.json
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/
The following will configure the s3 bucket to operate as a website at:
aws s3 website s3://MY_BUCKET_NAME/ --index-document index.html