Skip to content

Commit

Permalink
Merge pull request #42 from SudKul/master
Browse files Browse the repository at this point in the history
Add CFN templates
  • Loading branch information
SudKul authored May 14, 2022
2 parents f753064 + 50f4909 commit cac4e7c
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 1 deletion.
14 changes: 14 additions & 0 deletions examples/Cloudformation/my_parameters.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"ParameterKey": "myVPC",
"ParameterValue": "vpc-098defbc811aad87c"
},
{
"ParameterKey": "PublicSubnet",
"ParameterValue": "subnet-031d7c02210432b1c"
},
{
"ParameterKey": "AMItoUse",
"ParameterValue": "ami-0fa49cc9dc8d62c84"
}
]
46 changes: 46 additions & 0 deletions examples/Cloudformation/template_EC2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
Parameters:
myVPC:
Description: VPC used to deploy our resources below
Type: AWS::EC2::VPC::Id
PublicSubnet:
Description: Subnet to be used for our Web Server
Type: AWS::EC2::Subnet::Id
AMItoUse:
Description: AMI to use for our base image
Type: String
Resources:
myWebAccessSecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupDescription: Allow http to our test host
VpcId:
Ref: myVPC
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 80
ToPort: 80
CidrIp: 0.0.0.0/0
SecurityGroupEgress:
- IpProtocol: -1
FromPort: -1
ToPort: -1
CidrIp: 0.0.0.0/0
myWebServerInstance:
Type: AWS::EC2::Instance
Properties:
InstanceType: t3.micro
ImageId: !Ref AMItoUse
NetworkInterfaces:
- AssociatePublicIpAddress: "true"
DeviceIndex: "0"
GroupSet:
- Ref: "myWebAccessSecurityGroup"
SubnetId:
Ref: "PublicSubnet"
UserData:
Fn::Base64: !Sub |
#!/bin/bash
sudo yum update -y
sudo yum install -y httpd
sudo systemctl start httpd
sudo systemctl enable httpd
11 changes: 11 additions & 0 deletions examples/Cloudformation/template_VPN.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
AWSTemplateFormatVersion: 2010-09-09
Description: Udacity - This template deploys a Virtual Private Network
Resources:
UdacityVPC:
Type: 'AWS::EC2::VPC'
Properties:
CidrBlock: 10.0.0.0/16
EnableDnsHostnames: 'true'
Tags:
- Key: name
Value: myfirsttestvpc
3 changes: 2 additions & 1 deletion examples/Deploy_Flask_App/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ spec:
spec:
containers:
- name: simple-flask
image: IMAGE_TAG
# image: IMAGE_TAG
image: sudkul/simple-flask
securityContext:
privileged: false
readOnlyRootFilesystem: false
Expand Down

0 comments on commit cac4e7c

Please sign in to comment.