Using S3/Azure Blob Storage to host websites
AWS S3
- As blob storage exposes urls to access hosting static websites is possible
- Static websites refer to websites with html, css and javascript
- Lets host a website from Refer Here
- Download the zip file, extract contents and upload to s3 bucket
- Navigate to properties and Scroll down to static website hosting and get the url and you should be able to access the website Refer Here for website
Azure Storage account
- Refer Here for steps
Learning AWS CLI
- AWS CLI Requires a programmatic login which has access key and secret access key
- Lets create a user and get a programmatice access key and secret access key
- Ensure AWS CLI is installed.
- Now lets configure aws cli to use access key and secret key, lets set us-west-2 as default region
aws configure
- to verify connectivity
aws s3 ls - AWS CLI Command pattern
aws <service> <operation> [parameters] [--options]
- Where
- service is AWS Service name (ec2, s3, iam …)
- operation are actions
- parameters (inputs)
- options such as –region, –profie, –query, –output
- listing resources
- Pattern
aws <service> list-<resources>oraws <service> describe-<resources> -
Examples
aws s3 lslist s3 bucketsaws ec2 describe-instanceslist ec2 instancesaws iam list-userslist iam users
- Creating resources
- Pattern
aws <service> create-<resources> [parameters] [--options] - Examples
aws s3api create-bucket --bucket test-bucket --region us-west-2aws iam create-user --user-name cloud-user
- Deleting resources
- Pattern
aws <service> delete-<resources> --resource-idoraws <service> terminate-<resources> --resource-id - Examples
aws s3api delete-bucket --bucket test-bucketaws ec2 terminate-instances --instance-id i-123456
- For S3 we have uploading & downloading
# copy
aws s3 cp
aws s3 sync
-
Finding the right cli command:
- Navigating the docs
- Google
aws <service> cli activityaws s3 cli delete bucket - prompt:
As an experienced AWS User, Guide me in using aws cli to <activity - example: create s3 buckets>. Also give me necessary examples and reference link to aws cli documentation page
-
Exercise:
- Find a command to create
region- aws code commit with name myprojects
- list all the security groups
- list all the ebs snapshots
- Find a command to create
AWS S3 specifics
- AWS S3 bucket has an uri which is referred as s3 uri
s3://<bucket-name>
