Skip to content

Instantly share code, notes, and snippets.

View AndrewBestbier's full-sized avatar

Andrew AndrewBestbier

  • McKinsey & Company
  • London
View GitHub Profile
AppLaunchConfig: # (1)
Type: AWS::AutoScaling::LaunchConfiguration # (2)
Properties:
ImageId: ami-0389b2a3c4948b1a0
InstanceType: t2.micro
SecurityGroups:
- !Ref InstanceSecurityGroup
AssociatePublicIpAddress: true
UserData:
Fn::Base64:
AppLaunchConfig: # (2)
Type: AWS::AutoScaling::LaunchConfiguration # (2)
Properties:
ImageId: ami-0389b2a3c4948b1a0
InstanceType: t2.micro
SecurityGroups:
- !Ref InstanceSecurityGroup
UserData:
Fn::Base64:
Fn::Sub: |
FirstInstance:
Type: AWS::EC2::Instance
Properties:
ImageId: ami-0389b2a3c4948b1a0
InstanceType: t2.micro
SecurityGroups:
- !Ref InstanceSecurityGroup # (1)
UserData:
Fn::Base64:
Fn::Sub: |
FirstInstance: # (1)
Type: AWS::EC2::Instance # (2)
Properties:
ImageId: ami-0389b2a3c4948b1a0 # (3)
InstanceType: t2.micro # (4)
UserData:
Fn::Base64:
Fn::Sub: | # (5)
#!/bin/bash -xe
yum update -y
PublicSubnetA: # (1)
Type: AWS::EC2::Subnet # (2)
Properties:
VpcId: !Ref VPC # (3)
CidrBlock: 10.0.0.0/24 # (4)
AvailabilityZone: !Select [0, !GetAZs ] # (5)
PublicSubnetB:
Type: AWS::EC2::Subnet
Properties:
AWSTemplateFormatVersion: 2010-09-09 # (1)
Resources: # (2)
VPC: # (3)
Type: AWS::EC2::VPC # (4)
Properties:
CidrBlock: 10.0.0.0/16 # (5)
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Resources:
DynamoBooksTable:
Type: AWS::Serverless::SimpleTable
Properties:
TableName: books
PrimaryKey:
Name: id
Type: String
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Resources:
DynamoBooksTable:
Type: AWS::Serverless::SimpleTable
Properties:
TableName: books
PrimaryKey:
Name: id
Type: String
AWSTemplateFormatVersion: "2010-09-09" # (1)
Transform: AWS::Serverless-2016-10-31 # (1)
Resources: # (2)
DynamoBooksTable: # (3)
Type: AWS::Serverless::SimpleTable # (4)
Properties:
TableName: books # Naming our table
PrimaryKey:
Name: id # Setting the primary key of each item in our database as id
Type: String
AWSTemplateFormatVersion: "2010-09-09" # (1)
Transform: AWS::Serverless-2016-10-31 # (1)
Resources: # (2)
DynamoBooksTable: # (3)
Type: AWS::Serverless::SimpleTable # (4)
Properties:
TableName: books # (5)
PrimaryKey:
Name: id # (6)
Type: String