Skip to content
common:
phoenix_mode: true #default to false
environments:
dev:
phoenix_mode: false # turn off for dev env for faster deployment
strategy: inplace-update # default strategy: blue-green
option_settings:
- namespace: aws:elb:loadbalancer
option_name: SSLCertificateId
components:
- name: bg
strategy: inplace-update
option_settings:
- namespace: aws:autoscaling:asg
option_name: MinSize
value: "1"
- namespace: aws:autoscaling:asg
option_name: MaxSize
value: "1"
resources:
template: config/aws_resources.json
capabilities:
- CAPABILITY_IAM
inputs:
DBPassword: <%= ENV.fetch('AWSRESOURCES_DBPassword') %>
outputs:
S3UploadAccessKeyId:
namespace: aws:elasticbeanstalk:application:environment
option_name: S3_MULTIPART_UPLOAD_ACCESS_KEY_ID
"S3UploadUser" : {
"Type" : "AWS::IAM::User",
"Properties" : {
"Path" : "/",
"Policies" : [ {
"PolicyName" : "S3MultipartUpload",
"PolicyDocument" : {
"Version": "2012-10-17",
"Statement" : [ {
"Effect" : "Allow",
# in a Rails controller action
string_to_sign = params["to_sign"]
encoded = Base64.encode64(
OpenSSL::HMAC.digest(
OpenSSL::Digest::Digest.new("sha1"),
ENV["S3_MULTIPART_UPLOAD_SECRET_ACCESS_KEY"],
string_to_sign)).gsub("\n","")
render :text => encoded, :status => 200
// need jQuery and EvaporateJS
var config = $("[data-signer-url]");
var _e_ = new Evaporate({
signerUrl: config.data("signer-url"),
bucket: config.data("bucket"),
aws_key: config.data("aws-id")
});
var configuration = {
name: config.data("key"),
// see EvaporateJS document for other configurations need setup here
bucket = <s3 bucket name>
s3key = <s3 file key> # use a random uniq key
{
"data-aws-id" => ENV["S3_MULTIPART_UPLOAD_ACCESS_KEY_ID"],
"data-bucket" => bucket,
"data-key" => s3key,
"data-signer-url" => <your-data-signer-url>
}
# aws-ruby-sdk v1 API
def s3_multipart_upload_credentials(bucket, key, role_arn)
sts = AWS::STS.new
policy = AWS::STS::Policy.new
policy.allow(:actions => ["s3:PutObject",
"s3:GetObject",
"s3:AbortMultipartUpload",
"s3:ListMultipartUploadParts",
"s3:ListBucketMultipartUploads"],
:resources => "arn:aws:s3:::#{[bucket,key].join('/')}")
export PATH=$PATH:~/Downloads/IAMCli-1.5.0/bin
export AWS_IAM_HOME=~/Downloads/IAMCli-1.5.0
iam-servercertupload --aws-credential-file <credential.csv> -s <sname> -b <ssl.crt.txt> -k <ssl.key.txt> -c intermediate.crt.txt -p /cloudfront/<sname>/
PS1='\u@\h \W$(__git_ps1 "(%s)[$(git config --get user.name)]")\$ '
PS1='\h \W$(__git_ps1 "($(git config --get user.name)@%s)")\$ '
Something went wrong with that request. Please try again.