Skip to content

Commit

Permalink
Now reading bucket from Cumulus directly. Closes #11
Browse files Browse the repository at this point in the history
We now have a Cumulus namespace in CF as well
  • Loading branch information
Sebastian Dahlgren committed Sep 24, 2013
1 parent 390925c commit e8d145b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 16 deletions.
23 changes: 11 additions & 12 deletions cumulus/docs/cloudformation-template-example.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@
"ConstraintDescription" : "must be a valid EC2 instance type."
},

"S3BundleBucket": {
"Description" : "S3 bucket for this stack",
"Type": "String",
"Default": "se.skymill.bundles"
"Cumulus::Environment": {
"Description" : "Cumulus environment name",
"Type": "String"
},

"EnvironmentName": {
"Description" : "Cumulus environment name",
"Cumulus::BundleBucket": {
"Description" : "Cumulus bundle bucket name",
"Type": "String"
},

"Version": {
"Cumulus::Version": {
"Description" : "Version of the software",
"Type": "String"
}
Expand All @@ -50,7 +49,7 @@
"Type": "AWS::AutoScaling::LaunchConfiguration",
"Metadata" : {
"Cumulus": {
"Version": { "Ref" : "Version" }
"Version": { "Ref" : "Cumulus::Version" }
},

"AWS::CloudFormation::Authentication" : {
Expand All @@ -71,10 +70,10 @@
"aws_access_key_id: ", { "Ref" : "WebServerKeys" }, "\n",
"aws_secret_access_key: ", {"Fn::GetAtt": ["WebServerKeys", "SecretAccessKey"]}, "\n",
"region: ", {"Ref" : "AWS::Region"}, "\n",
"s3_bundles_bucket: se.skymill.bundles\n",
"s3_bundles_bucket: ", { "Ref" : "Cumulus::BundleBucket"}, "\n",
"stack: ", { "Ref" : "AWS::StackName" }, "\n",
"bundle_type: webserver\n",
"version: ", { "Ref" : "Version" }, "\n"
"version: ", { "Ref" : "Cumulus::Version" }, "\n"
]]},
"mode" : "000644",
"owner" : "root",
Expand All @@ -84,8 +83,8 @@
"/usr/local/bin/cumulus_bundle_handler.py" : {
"source" : { "Fn::Join" : ["",
["http://s3-", {"Ref" : "AWS::Region"}, ".amazonaws.com/",
{ "Ref" : "S3BundleBucket" }, "/", { "Ref" : "EnvironmentName"},
"/", { "Ref" : "Version"}, "/cumulus_bundle_handler.py"]]},
{ "Ref" : "Cumulus::BundleBucket"}, "/", { "Ref" : "Cumulus::Environment"},
"/", { "Ref" : "Cumulus::Version"}, "/cumulus_bundle_handler.py"]]},
"mode" : "000755",
"owner" : "root",
"group" : "root",
Expand Down
24 changes: 20 additions & 4 deletions cumulus/lib/stack_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,19 @@ def ensure_stack(stack, environment, template, disable_rollback=False):
stack,
parameters=[
(
'EnvironmentName',
'Cumulus::BundleBucket',
config_handler.get_environment_option('bucket')
),
(
'Cumulus::Environment',
config_handler.get_environment()
),
(
'Cumulus::Environment',
config_handler.get_environment()
),
(
'Version',
'Cumulus::Version',
config_handler.get_environment_option('version')
)
],
Expand All @@ -63,11 +71,19 @@ def ensure_stack(stack, environment, template, disable_rollback=False):
stack,
parameters=[
(
'EnvironmentName',
'Cumulus::BundleBucket',
config_handler.get_environment_option('bucket')
),
(
'Cumulus::Environment',
config_handler.get_environment()
),
(
'Cumulus::Environment',
config_handler.get_environment()
),
(
'Version',
'Cumulus::Version',
config_handler.get_environment_option('version')
)
],
Expand Down

0 comments on commit e8d145b

Please sign in to comment.