setup
- download the AWS CLI
- create new IAM user
- gave permission
AmazonS3FullAccess
- get access key and secret key
- gave permission
in the project
- create new project with react + vite & npm install
- install aws sdk for javascript
- https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/welcome.html
- installing the sdk for javascript
npm init -y
,npm i aws-sdk
- configure aws cli
- download the msi
aws configure
AWS Access Key ID [None]
: (enter)AWS Secret Access Key [None]
: (enter)Default region name [None]: us-east-1
Default output format [None]: json
Adding this policy to the bucket
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadForAllObjects",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::cloud-deploy-test-bucket-01/*"
}
]
}
- under bucket settings, uncheck the block all public access (checked by default)
- static website
- bucket → properties → enable static website hosting
secret access key 1IKDkEA5NktvpXyzqZHKIRvnvPxnjYJIDMVWxFUU
access key AKIA5FCD6A4FLRWJ6S6K