Skip to content

Instantly share code, notes, and snippets.

@bo67192
Created November 2, 2016 02:35
Show Gist options
  • Save bo67192/9b62d9b8dbf65e33f84477b6a0f6e40d to your computer and use it in GitHub Desktop.
Save bo67192/9b62d9b8dbf65e33f84477b6a0f6e40d to your computer and use it in GitHub Desktop.
Example Cloudformation template to create opsworks stack
{
"AWSTemplateFormatVersion": "2010-09-09",
"Metadata": {
"AWS::CloudFormation::Designer": {
"d44d7b48-13cf-47fc-b755-39115ba78fff": {
"size": {
"width": 310,
"height": 300
},
"position": {
"x": 150,
"y": 30
},
"z": 1,
"embeds": [
"0a50c4a6-484c-48ac-8f2a-e97fc90f285d",
"9a08d739-268e-4df0-ab25-3b0005b0d6f7",
"1d9ca4be-9501-45d8-a7ed-e64972e55087"
]
},
"9a08d739-268e-4df0-ab25-3b0005b0d6f7": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 210,
"y": 90
},
"z": 2,
"parent": "d44d7b48-13cf-47fc-b755-39115ba78fff",
"embeds": []
},
"1d9ca4be-9501-45d8-a7ed-e64972e55087": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 210,
"y": 240
},
"z": 2,
"parent": "d44d7b48-13cf-47fc-b755-39115ba78fff",
"embeds": [],
"isassociatedwith": [
"9a08d739-268e-4df0-ab25-3b0005b0d6f7"
],
"dependson": [
"0a50c4a6-484c-48ac-8f2a-e97fc90f285d"
]
},
"26a94103-014f-4f83-8268-bc60db150606": {
"source": {
"id": "1d9ca4be-9501-45d8-a7ed-e64972e55087"
},
"target": {
"id": "9a08d739-268e-4df0-ab25-3b0005b0d6f7"
},
"z": 2
},
"34880a8a-76c1-46c6-bd97-2b5660656e86": {
"source": {
"id": "e33c6388-9cda-481b-93ad-955130b0e3cb"
},
"target": {
"id": "71d72122-11f2-44f8-8bcc-e31e2e33561c"
},
"z": 3
},
"a4be135a-ba74-4f14-8176-3307fca376c3": {
"source": {
"id": "26824fcb-228f-4626-b749-c559ec84a759"
},
"target": {
"id": "71d72122-11f2-44f8-8bcc-e31e2e33561c"
},
"z": 2
},
"6c272328-2048-4edc-8fe0-22a789ab74c6": {
"source": {
"id": "7e585e94-44cd-4120-95ae-6139bda4c1f4"
},
"target": {
"id": "e33c6388-9cda-481b-93ad-955130b0e3cb"
},
"z": 2
},
"2edbc01a-76b4-404a-ad93-4e83be732557": {
"source": {
"id": "e33c6388-9cda-481b-93ad-955130b0e3cb"
},
"target": {
"id": "772496e0-af19-4be9-9fda-0d7d0952bba2"
},
"z": 3
},
"453b4745-55b3-4194-a7c3-20e05d0deea5": {
"source": {
"id": "772496e0-af19-4be9-9fda-0d7d0952bba2"
},
"target": {
"id": "26824fcb-228f-4626-b749-c559ec84a759"
},
"z": 4
},
"0a50c4a6-484c-48ac-8f2a-e97fc90f285d": {
"size": {
"width": 60,
"height": 60
},
"position": {
"x": 360,
"y": 240
},
"z": 2,
"parent": "d44d7b48-13cf-47fc-b755-39115ba78fff",
"embeds": [],
"isassociatedwith": [
"9a08d739-268e-4df0-ab25-3b0005b0d6f7"
]
},
"fca33340-aeb2-4983-b0b0-c5337f852ec6": {
"source": {
"id": "0a50c4a6-484c-48ac-8f2a-e97fc90f285d"
},
"target": {
"id": "7e585e94-44cd-4120-95ae-6139bda4c1f4"
},
"z": 3
},
"e90511ff-2cda-4ac2-9dce-c1b48e5e9877": {
"source": {
"id": "0a50c4a6-484c-48ac-8f2a-e97fc90f285d"
},
"target": {
"id": "9a08d739-268e-4df0-ab25-3b0005b0d6f7"
},
"z": 3
},
"afd6ad39-02cb-42f3-a058-b495a8c8104c": {
"source": {
"id": "0a50c4a6-484c-48ac-8f2a-e97fc90f285d"
},
"target": {
"id": "9a08d739-268e-4df0-ab25-3b0005b0d6f7"
},
"z": 4
},
"6c846d87-b9b6-43db-adbc-30d8d272f1f6": {
"source": {
"id": "1d9ca4be-9501-45d8-a7ed-e64972e55087"
},
"target": {
"id": "0a50c4a6-484c-48ac-8f2a-e97fc90f285d"
},
"z": 5
},
"55f7fa9c-6c9a-4818-b10e-03269690f656": {
"source": {
"id": "0a50c4a6-484c-48ac-8f2a-e97fc90f285d"
},
"target": {
"id": "9a08d739-268e-4df0-ab25-3b0005b0d6f7"
},
"z": 3
}
}
},
"Resources": {
"OpsworksStack": {
"Type": "AWS::OpsWorks::Stack",
"Properties": {
"HostnameTheme": "Layer_Dependent",
"Name": "OpsworksStack",
"UseCustomCookbooks": "true",
"CustomCookbooksSource": {
"Type": "s3",
"Url": "https://s3.amazonaws.com/opsworks-repo/repo_version1.tar.gz"
},
"ServiceRoleArn": "arn:aws:iam::9872349872349:role/aws-opsworks-service-role",
"DefaultInstanceProfileArn": "arn:aws:iam::3729239832:instance-profile/instanceprofile",
"UseOpsworksSecurityGroups": "false",
"VpcId": "vpc-839skjds",
"DefaultSubnetId": "subnet-is837d",
"DefaultSshKeyName": "default-ssh-key",
"AgentVersion": "LATEST",
"ConfigurationManager": {
"Name": "Chef",
"Version": "12"
}
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "d44d7b48-13cf-47fc-b755-39115ba78fff"
}
}
},
"OpsworksLayer": {
"Type": "AWS::OpsWorks::Layer",
"Properties": {
"Name": "OpsWorksLayer",
"Shortname": "opsworkslayer",
"AutoAssignElasticIps": "false",
"AutoAssignPublicIps": "false",
"EnableAutoHealing": "false",
"StackId": {
"Ref": "OpsworksStack"
},
"CustomRecipes": {
"Setup": [
"chef-recipe::default"
]
},
"Type": "custom",
"VolumeConfigurations": [
{
"MountPoint": "/vol/log/data",
"NumberOfDisks": 1,
"Size": 100
}
],
"CustomSecurityGroupIds": ["sg-kdi837","sg-dkwld83"]
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "9a08d739-268e-4df0-ab25-3b0005b0d6f7"
}
}
},
"OpsworksInstance": {
"Type": "AWS::OpsWorks::Instance",
"Properties": {
"AmiId": "ami-e3c3b8f4",
"Os": "Custom",
"StackId": {
"Ref": "OpsworksStack"
},
"LayerIds": [
{
"Ref": "OpsworksLayer"
}
],
"InstanceType": "m4.large",
"AutoScalingType": "timer",
"TimeBasedAutoScaling": {
"Monday": {
"0": "on",
"11": "on",
"12": "on",
"13": "on",
"14": "on",
"15": "on",
"16": "on",
"17": "on",
"18": "on",
"19": "on",
"20": "on",
"21": "on",
"22": "on",
"23": "on"
},
"Tuesday": {
"0": "on",
"11": "on",
"12": "on",
"13": "on",
"14": "on",
"15": "on",
"16": "on",
"17": "on",
"18": "on",
"19": "on",
"20": "on",
"21": "on",
"22": "on",
"23": "on"
},
"Wednesday": {
"0": "on",
"11": "on",
"12": "on",
"13": "on",
"14": "on",
"15": "on",
"16": "on",
"17": "on",
"18": "on",
"19": "on",
"20": "on",
"21": "on",
"22": "on",
"23": "on"
},
"Thursday": {
"0": "on",
"11": "on",
"12": "on",
"13": "on",
"14": "on",
"15": "on",
"16": "on",
"17": "on",
"18": "on",
"19": "on",
"20": "on",
"21": "on",
"22": "on",
"23": "on"
},
"Friday": {
"0": "on",
"11": "on",
"12": "on",
"13": "on",
"14": "on",
"15": "on",
"16": "on",
"17": "on",
"18": "on",
"19": "on",
"20": "on",
"21": "on",
"22": "on",
"23": "on"
}
},
"VirtualizationType": "hvm"
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "1d9ca4be-9501-45d8-a7ed-e64972e55087"
}
},
"DependsOn": [
"OpsworksInstance2"
]
},
"OpsworksInstance2": {
"Type": "AWS::OpsWorks::Instance",
"Properties": {
"AmiId": "ami-e3c3b8f4",
"Os": "Custom",
"StackId": {
"Ref": "OpsworksStack"
},
"InstanceType": "m4.large",
"AutoScalingType": "timer",
"TimeBasedAutoScaling": {
"Monday": {
"0": "on",
"11": "on",
"12": "on",
"13": "on",
"14": "on",
"15": "on",
"16": "on",
"17": "on",
"18": "on",
"19": "on",
"20": "on",
"21": "on",
"22": "on",
"23": "on"
},
"Tuesday": {
"0": "on",
"11": "on",
"12": "on",
"13": "on",
"14": "on",
"15": "on",
"16": "on",
"17": "on",
"18": "on",
"19": "on",
"20": "on",
"21": "on",
"22": "on",
"23": "on"
},
"Wednesday": {
"0": "on",
"11": "on",
"12": "on",
"13": "on",
"14": "on",
"15": "on",
"16": "on",
"17": "on",
"18": "on",
"19": "on",
"20": "on",
"21": "on",
"22": "on",
"23": "on"
},
"Thursday": {
"0": "on",
"11": "on",
"12": "on",
"13": "on",
"14": "on",
"15": "on",
"16": "on",
"17": "on",
"18": "on",
"19": "on",
"20": "on",
"21": "on",
"22": "on",
"23": "on"
},
"Friday": {
"0": "on",
"11": "on",
"12": "on",
"13": "on",
"14": "on",
"15": "on",
"16": "on",
"17": "on",
"18": "on",
"19": "on",
"20": "on",
"21": "on",
"22": "on",
"23": "on"
}
},
"VirtualizationType": "hvm",
"LayerIds": [
{
"Ref": "OpsworksLayer"
}
]
},
"Metadata": {
"AWS::CloudFormation::Designer": {
"id": "0a50c4a6-484c-48ac-8f2a-e97fc90f285d"
}
}
}
},
"Mappings": {},
"Parameters": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment