Skip to content

Commit

Permalink
fix: add cloud arch
Browse files Browse the repository at this point in the history
  • Loading branch information
SirPhemmiey committed Jun 26, 2022
1 parent 88a891f commit 9c74596
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
Binary file added .DS_Store
Binary file not shown.
Binary file added Udagram-Cloud-Arch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
46 changes: 45 additions & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,47 @@ Resources:
RouteTableId: !Ref PrivateRouteTable2
SubnetId: !Ref PrivateSubnet2

UdacityS3ReadOnlyEC2:
Type: AWS::IAM::Role
Properties:
RoleName:
!Sub ${EnvironmentName}-Role
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service:
- ec2.amazonaws.com
Action:
- sts:AssumeRole
Path: "/"

RolePolicies:
Type: AWS::IAM::Policy
Properties:
PolicyName: AmazonS3ReadOnlyAccess
PolicyDocument:
Version: '2012-10-17'
Statement:
-
Effect: Allow
Action:
- s3:Get*
- s3:List*
Resource:
- arn:aws:s3:::udagram-project
- arn:aws:s3:::udagram-project/*
Roles:
- Ref: UdacityS3ReadOnlyEC2

ProfileWithRoles:
Type: AWS::IAM::InstanceProfile
Properties:
Path: "/"
Roles:
- Ref: UdacityS3ReadOnlyEC2

LBSecGroup:
Type: AWS::EC2::SecurityGroup
Properties:
Expand Down Expand Up @@ -257,11 +298,14 @@ Resources:
Fn::Base64: !Sub |
#!/bin/bash
apt-get update -y
apt-get install unzip awscli -y
apt-get install apache2 -y
systemctl start apache2.service
cd /var/www/html
echo "Udagram Up and Running!" > index.html
aws s3 cp s3://udagram-project/udacity-starter-website.zip .
unzip -o udacity-starter-website.zip
ImageId: ami-0df32f8302dfe67df
IamInstanceProfile: !Ref ProfileWithRoles
SecurityGroups:
- Ref: WebServerSecGroup
InstanceType: t3.medium
Expand Down

0 comments on commit 9c74596

Please sign in to comment.