Last active
August 29, 2015 14:20
-
-
Save xli/fbb38b5974f6ea3a17a3 to your computer and use it in GitHub Desktop.
Create user and credentials for S3 multipart upload, output credentials for later configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"S3UploadUser" : { | |
"Type" : "AWS::IAM::User", | |
"Properties" : { | |
"Path" : "/", | |
"Policies" : [ { | |
"PolicyName" : "S3MultipartUpload", | |
"PolicyDocument" : { | |
"Version": "2012-10-17", | |
"Statement" : [ { | |
"Effect" : "Allow", | |
"Action" : [ "s3:PutObject", "s3:GetObject", "s3:AbortMultipartUpload", "s3:ListMultipartUploadParts", "s3:ListBucketMultipartUploads" ], | |
"Resource" : [ | |
{ "Fn::Join" : [ "", ["arn:aws:s3:::", { "Ref" : "UploadBucketName" }, "/*"]]} | |
] | |
}] | |
} | |
}] | |
} | |
}, | |
"S3UploadKey" : { | |
"Type" : "AWS::IAM::AccessKey", | |
"Properties" : { | |
"Status": "Active", | |
"UserName" : { "Ref" : "S3UploadUser" } | |
} | |
} | |
................. | |
// Outputs for EC2 instances: | |
"S3UploadAccessKeyId": { | |
"Description": "Access key id for S3 upload", | |
"Value": { "Ref" : "S3UploadKey" } | |
}, | |
"S3UploadSecretKey": { | |
"Description": "Secret key for S3 upload", | |
"Value" : { "Fn::GetAtt" : [ "S3UploadKey", "SecretAccessKey" ] } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment