Skip to content

Instantly share code, notes, and snippets.

@KinzP
KinzP / AWSTemplateFormatVersion_LUIT07.yml
Created May 20, 2022 15:57
Template_CloudFormation
AWSTemplateFormatVersion: 2010-09-09
Resources:
# Creating the VPC
VPC:
Type: 'AWS::EC2::VPC'
Properties:
CidrBlock: 10.10.0.0/16
EnableDnsSupport: true
EnableDnsHostnames: true
Tags:
AWSTemplateFormatVersion: 2010-09-09
Resources:
# Creating the VPC
cloudVPC:
Type: 'AWS::EC2::VPC'
Properties:
CidrBlock: 10.0.0.0/16
EnableDnsSupport: true
EnableDnsHostnames: true
Tags:
# Create an RDS MySql 5.7 Instance
Parameters:
Owner:
Description: Enter the Name of the owner for this Stack.
Type: String
Default: Name
VPC:
Description: Select VPC form the available VPCs in your account.
Type: AWS::EC2::VPC::Id
PrivateSubnet1:
AWSTemplateFormatVersion: '2010-09-09'
Description: NAT Gateway
Parameters:
Owner:
Description: Enter Team or Individual Name Responsible for the Stack.
Type: String
Default: FirstName LastName
VPC:
Description: Select VPC.
Type: AWS::EC2::VPC::Id
AWSTemplateFormatVersion: '2010-09-09'
Description: NAT Gateway
Parameters:
Owner:
Description: Enter Team or Individual Name Responsible for the Stack.
Type: String
Default: FirstName LastName
VPC:
Description: Select VPC.
Type: AWS::EC2::VPC::Id
# Create an RDS MySql 5.7 Instance
Parameters:
Owner:
Description: Enter the Name of the owner for this Stack.
Type: String
Default: Name
VPC:
Description: Select VPC form the available VPCs in your account.
Type: AWS::EC2::VPC::Id
PrivateSubnet1:
AWSTemplateFormatVersion: 2010-09-09
Resources:
# Creating the VPC
cloudVPC:
Type: 'AWS::EC2::VPC'
Properties:
CidrBlock: 10.0.0.0/16
EnableDnsSupport: true
EnableDnsHostnames: true
Tags:
# Create an RDS MySql 5.7 Instance
Parameters:
Owner:
Description: Enter the Name of the owner for this Stack.
Type: String
Default: Name
VPC:
Description: Select VPC form the available VPCs in your account.
Type: AWS::EC2::VPC::Id
PrivateSubnet1:
AWSTemplateFormatVersion: '2010-09-09'
Description: NAT Gateway
Parameters:
Owner:
Description: Enter Team or Individual Name Responsible for the Stack.
Type: String
Default: FirstName LastName
VPC:
Description: Select VPC.
Type: AWS::EC2::VPC::Id
import boto3
ec2 = boto3.resource('ec2')
no_of_instances = int(input("How many instances:" ))
instance = ec2.create_instances(
ImageId="ami-0cff7528ff583bf9a", #input AMI here
InstanceType='t2.micro',
KeyName='LUIT_Project14', #input keypair name here
MaxCount= 3,