Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save valentinbud/4d749b8bab87a17d7a409de66e535de2 to your computer and use it in GitHub Desktop.
Save valentinbud/4d749b8bab87a17d7a409de66e535de2 to your computer and use it in GitHub Desktop.
diff aerospike cloudformation template
--- /Users/bud/code/aerospike/aws-cloudformation/aerospike-existing-vpc.json 2017-04-28 08:35:50.000000000 +0300
+++ /Users/bud/code/f4m/tfdev/aerospike/templates/aerospike-cloudformation.json 2017-05-25 10:57:21.000000000 +0300
@@ -21,6 +21,31 @@
"Default" : "default",
"AllowedValues" : [ "default", "dedicated"]
},
+ "Cli53AwsAccessKey" : {
+ "Description" : "The cli53 AWS Access Key",
+ "Type" : "String",
+ "Default" : "AZNJVH"
+ },
+ "Cli53AwsSecretAccessKey" : {
+ "Description" : "The cli53 AWS Secret Access Key",
+ "Type" : "String",
+ "Default" : "AZNJVH"
+ },
+ "Cli53PrivateZone" : {
+ "Description" : "The cli53 private zone to update.",
+ "Type" : "String",
+ "Default" : "aws.abcdm.com"
+ },
+ "Cli53PublicZone" : {
+ "Description" : "The cli53 private zone to update.",
+ "Type" : "String",
+ "Default" : "abcdm.com"
+ },
+ "Cli53Hostname" : {
+ "Description" : "The cli53 private hostname.",
+ "Type" : "String",
+ "Default" : "xyz"
+ },
"NumberOfInstances" : {
"Description" : "Number of instances in the cluster",
"Type" : "Number",
@@ -90,7 +115,7 @@
"name": "ami-1ab8ad7e"
},
"eu-central-1": {
- "name": "ami-919345fe"
+ "name": "ami-7fb96210"
},
"ap-southeast-1": {
"name": "ami-eb51e388"
@@ -397,6 +422,23 @@
"#!/bin/bash -xe\n",
"yum update -y aws-cfn-bootstrap\n",
"yum install -y jq\n",
+
+ "export AWS_ACCESS_KEY_ID=", { "Ref" : "Cli53AwsAccessKey" }, "\n",
+ "export AWS_SECRET_ACCESS_KEY=", { "Ref": "Cli53AwsSecretAccessKey" }, "\n",
+
+ "cli53_hostname=", { "Ref": "Cli53Hostname" }, "\n",
+ "cli53_private_zone=", { "Ref": "Cli53PrivateZone" }, "\n",
+ "cli53_public_zone=", { "Ref": "Cli53PublicZone" }, "\n",
+
+ "local_hostname=$(curl -sS http://169.254.169.254/latest/meta-data/local-hostname)\n",
+ "public_hostname=$(curl -sS http://169.254.169.254/latest/meta-data/public-hostname)\n",
+
+ "/usr/local/bin/cli53 rrcreate --wait --replace ${cli53_private_zone}",
+ " \"${cli53_hostname} 60 CNAME ${local_hostname}.\"\n",
+
+ "/usr/local/bin/cli53 rrcreate --wait --replace ${cli53_public_zone}",
+ " \"${cli53_hostname} 60 CNAME ${public_hostname}.\"\n",
+
"/opt/aws/bin/cfn-init -v ",
" --stack ", { "Ref" : "AWS::StackName" },
" --resource LaunchConfig ",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment