usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [7/7] git commit: Added file that spins up a single working graphite server instance
Date Fri, 18 Jul 2014 13:15:40 GMT
Added file that spins up a single working graphite server instance


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/8662f778
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/8662f778
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/8662f778

Branch: refs/heads/cloud-formation-scripts
Commit: 8662f778ff50a571b18f968e380a9f5c8b5b553d
Parents: 458d944
Author: grey <greyes@apigee.com>
Authored: Tue Jul 15 12:11:24 2014 -0700
Committer: grey <greyes@apigee.com>
Committed: Tue Jul 15 12:11:24 2014 -0700

----------------------------------------------------------------------
 stack/awscluster/graphiteCloud.json | 217 +++++++++++++++++++++++++++++++
 1 file changed, 217 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/8662f778/stack/awscluster/graphiteCloud.json
----------------------------------------------------------------------
diff --git a/stack/awscluster/graphiteCloud.json b/stack/awscluster/graphiteCloud.json
new file mode 100644
index 0000000..3d1f356
--- /dev/null
+++ b/stack/awscluster/graphiteCloud.json
@@ -0,0 +1,217 @@
+{
+   "AWSTemplateFormatVersion":"2010-09-09",
+   "Description":"Usergrid AWS Cluster",
+   "Parameters":{
+     "KeyPair":{
+        "Description":"EC2 key pair to be use for SSH access",
+        "Type":"String",
+        "Default":"comcast-key-pair"
+     },
+      "GraphiteInstanceType":{
+         "Description":"Instance type for Graphite server",
+         "Type":"String",
+         "Default":"t1.micro",
+         "AllowedValues":[
+            "t1.micro",
+            "m1.small",
+            "m1.medium",
+            "m1.large",
+            "m3.large",
+            "m1.xlarge",
+            "m3.xlarge",
+            "m3.2xlarge",
+            "c3.4xlarge"
+         ],
+         "ConstraintDescription":"must be valid instance type."
+      },
+      "GraphiteServers":{
+         "Description":"Minimum number of graphite servers. There should only be one",
+         "Type":"Number",
+         "Default":"1",
+         "MinValue":"1"
+      }
+   },
+   "Mappings":{
+      "AWSInstanceType2Arch":{
+         "t1.micro":{
+            "Arch":"64"
+         },
+         "m1.small":{
+            "Arch":"64"
+         },
+         "m1.medium":{
+            "Arch":"64"
+         },
+         "m1.large":{
+            "Arch":"64"
+         },
+         "m1.xlarge":{
+            "Arch":"64"
+         },
+         "m3.large":{
+            "Arch":"64"
+         },
+         "m3.xlarge":{
+            "Arch":"64"
+         },
+         "c3.4xlarge":{
+            "Arch":"64"
+         }
+      },
+      "AWSRegionArch2AMI":{
+         "ap-southeast-2":{
+            "64":"ami-5993f663"
+         },
+         "us-east-1":{
+            "64":"ami-7cbd4f14"
+         },
+         "us-west-2":{
+            "64":"ami-2598ea15"
+         }
+      },
+      "TwoAZs":{
+         "ap-southeast-2":{
+            "AZ1":"ap-southeast-2a",
+            "AZ2":"ap-southeast-2b"
+         },
+         "us-east-1":{
+            "AZ1":"us-east-1b",
+            "AZ2":"us-east-1c"
+         },
+         "us-west-2":{
+            "AZ1":"us-west-2a",
+            "AZ2":"us-west-2b"
+         }
+      }
+   },
+   "Resources":{
+     "RootRole":{
+        "Type":"AWS::IAM::Role",
+        "Properties":{
+           "AssumeRolePolicyDocument":{
+              "Statement":[
+                 {
+                    "Effect":"Allow",
+                    "Principal":{
+                       "Service":[
+                          "ec2.amazonaws.com"
+                       ]
+                    },
+                    "Action":[
+                       "sts:AssumeRole"
+                    ]
+                 }
+              ]
+           },
+           "Path":"/"
+        }
+     },
+     "RolePolicies":{
+        "Type":"AWS::IAM::Policy",
+        "Properties":{
+           "PolicyName":"root",
+           "PolicyDocument":{
+              "Statement":[
+                 {
+                    "Effect":"Allow",
+                    "Action":"*",
+                    "Resource":"*"
+                 }
+              ]
+           },
+           "Roles":[
+              {
+                 "Ref":"RootRole"
+              }
+           ]
+        }
+     },
+     "RootInstanceProfile":{
+        "Type":"AWS::IAM::InstanceProfile",
+        "Properties":{
+           "Path":"/",
+           "Roles":[
+              {
+                 "Ref":"RootRole"
+              }
+           ]
+        }
+     },
+      "GraphiteUser":{
+         "Type":"AWS::IAM::User",
+         "Properties":{
+            "Path":"/",
+            "Policies":[
+               {
+                  "PolicyName":"root",
+                  "PolicyDocument":{
+                     "Statement":[
+                        {
+                           "Effect":"Allow",
+                           "Action":"*",
+                           "Resource":"*"
+                        }
+                     ]
+                  }
+               }
+            ]
+         }
+      },
+      "GraphiteKey":{
+         "Type":"AWS::IAM::AccessKey",
+         "Properties":{
+            "UserName":{
+               "Ref":"GraphiteUser"
+            }
+         }
+      },
+      "GraphiteInstance":{
+         "Type":"AWS::EC2::Instance",
+         "Properties":{
+            "UserData":{
+               "Fn::Base64":{
+                  "Fn::Join":[
+                     "",
+                     [
+                        "#!/bin/bash -x\n",
+                        "sudo git clone https://github.com/hopsoft/docker-graphite-statsd.git
\n",
+                        "sudo ./docker-graphite-statsd/bin/start \n",
+                        "sudo git clone https://github.com/dotcloud/collectd-graphite.git
\n",
+                        "sudo collectd-graphite/docker build -t collectd-graphite . \n"
+                     ]
+                  ]
+               }
+            },
+            "KeyName":{
+               "Ref":"KeyPair"
+            },
+            "ImageId":{
+               "Fn::FindInMap":[
+                  "AWSRegionArch2AMI",
+                  {
+                     "Ref":"AWS::Region"
+                  },
+                  {
+                     "Fn::FindInMap":[
+                        "AWSInstanceType2Arch",
+                        {
+                           "Ref":"GraphiteInstanceType"
+                        },
+                        "Arch"
+                     ]
+                  }
+               ]
+            },
+            "InstanceType":{
+               "Ref":"GraphiteInstanceType"
+            },
+            "IamInstanceProfile":{
+               "Ref":"RootInstanceProfile"
+            },
+            "SecurityGroups":[
+               "graphite"
+            ]
+         }
+      }
+   }
+}


Mime
View raw message