]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
heat templates : add missing credentials to IHA template
authorSteven Hardy <shardy@redhat.com>
Thu, 17 Jan 2013 11:13:48 +0000 (11:13 +0000)
committerSteven Hardy <shardy@redhat.com>
Thu, 17 Jan 2013 14:45:11 +0000 (14:45 +0000)
WordPress_Single_Instance_With_IHA lacks credentials so
cfn-push-stats can't authenticate with the cloudwatch api

ref bug 1100719

Change-Id: I218eea927a00b6cef58a4a1ee5d930c57ebb8a2e
Signed-off-by: Steven Hardy <shardy@redhat.com>
templates/WordPress_Single_Instance_With_IHA.template

index 1159c1a37a2eb035c02de88af374fccefde697da..e0022696d5490940eb808ed43724dbaa46e7069a 100644 (file)
   },
 
   "Resources" : {
+    "CfnUser" : {
+      "Type" : "AWS::IAM::User"
+    },
+    "WebServerKeys" : {
+      "Type" : "AWS::IAM::AccessKey",
+      "Properties" : {
+        "UserName" : {"Ref": "CfnUser"}
+      }
+    },
     "WebServerRestartPolicy" : {
       "Type" : "HEAT::HA::Restarter",
       "Properties" : {
         "AWS::CloudFormation::Init" : {
           "config" : {
             "files" : {
+              "/etc/cfn/cfn-credentials" : {
+                "content" : { "Fn::Join" : ["", [
+                  "AWSAccessKeyId=", { "Ref" : "WebServerKeys" }, "\n",
+                  "AWSSecretKey=", {"Fn::GetAtt": ["WebServerKeys",
+                                    "SecretAccessKey"]}, "\n"
+                ]]},
+                "mode"    : "000400",
+                "owner"   : "root",
+                "group"   : "root"
+              },
               "/tmp/cfn-hup-crontab.txt" : {
                 "content" : { "Fn::Join" : ["", [
                 "MAIL=\"\"\n",