diff --git a/lib/templates/resources-cf.json b/lib/templates/resources-cf.json index 60cc01a95..2cb3f594a 100644 --- a/lib/templates/resources-cf.json +++ b/lib/templates/resources-cf.json @@ -9,6 +9,10 @@ "Type": "String", "Default": "myapp.com" }, + "aaProjectBucket": { + "Type": "String", + "Default": "myapp.com" + }, "aaStage": { "Type": "String" }, @@ -204,6 +208,16 @@ } ] } + }, + "ProjectS3Bucket" : { + "Type" : "AWS::S3::Bucket", + "Properties" : { + "AccessControl" : "Private", + "BucketName" : { + "Ref": "aaProjectBucket" + } + }, + "DeletionPolicy" : "Retain" } }, "Outputs": { diff --git a/lib/utils/aws.js b/lib/utils/aws.js index c72495514..cebe9fa9c 100644 --- a/lib/utils/aws.js +++ b/lib/utils/aws.js @@ -488,6 +488,10 @@ exports.cfCreateResourcesStack = function(awsProfile, awsRegion, projRootPath, p ParameterKey: 'aaStage', ParameterValue: projStage, UsePreviousValue: false, + }, { + ParameterKey: 'aaProjectBucket', + ParameterValue: projStage, + UsePreviousValue: false, }, { ParameterKey: 'aaDataModelPrefix', ParameterValue: projStage, diff --git a/lib/utils/index.js b/lib/utils/index.js index 0a90fea8a..84878acba 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -214,6 +214,22 @@ exports.generateLambdaName = function(awsmJson) { }); }; +/** + * Generate ProjectBucket Name + * @param stage + * @param region + * @param projectDomain + * @returns {string} + */ + +exports.generateProjectBucketName = function(stage, region, projectDomain) { + + // Sanitize + stage = stage.trim().toLowerCase; + + +}; + /** * Gets all lambda functionName's *