Add S3 to ask-cli
A public S3 bucket is used to host skill icons, audio files, images, and videos for Alexa skills. This feature adds a new deploy target to the ASK CLI.
Configuration for the bucket name and region would be stored in '.ask/config'
$ deploy --target s3
The would sync all files and folders in a known local folder to the bucket at: https://s3.amazonaws.com/my-bucket/
The first time this is done, the bucket will be created and a CORS configuration applied.
Calling 'ask deploy' will also sync local folders and files to S3. Because the skill icon can be hosted in the S3 bucket, deploy to s3 will occur before the deploy of the skill.json file.
Behind the scenes, the following commands will be called:
make bucket
aws s3 mb s3://{bucket-name}/ --profile {aws-profile-name}
set CORS
aws s3api put-bucket-cors --bucket {bucket-name} --cors-configuration file://.deploy-s3/s3-cors.json --profile {aws-profile-name}
File: s3-cors.json
{
"CORSRules": [
{
"AllowedOrigins": ["*"],
"AllowedHeaders": ["Authorization"],
"AllowedMethods": ["GET"],
"MaxAgeSeconds": 3000
}
]
}
sync s3
aws s3 sync ./.deploy-s3 s3://{bucket-name}/ --profile {aws-profile-name} --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
