-
Notifications
You must be signed in to change notification settings - Fork 13
/
template-amended.yaml
34 lines (31 loc) · 1004 Bytes
/
template-amended.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
AWSTemplateFormatVersion: '2010-09-09'
Description: A simple CloudFormation template for creating a security group and launching an EC2 instance
Resources:
SecurityGroup:
Type: AWS::EC2::SecurityGroup
Properties:
GroupName: chatgpt-demo-sg
GroupDescription: Security group for chatgpt-demo EC2 instance
SecurityGroupIngress:
- IpProtocol: tcp
FromPort: 22
ToPort: 22
CidrIp: 0.0.0.0/0
- IpProtocol: tcp
FromPort: 8501
ToPort: 8501
CidrIp: 0.0.0.0/0
EC2Instance:
Type: AWS::EC2::Instance
Properties:
InstanceType: g4dn.xlarge
ImageId: ami-09f85944838b438c5
SecurityGroups:
- Ref: SecurityGroup
UserData:
'Fn::Base64': |
#!/bin/bash
# Activate the pre-built pytorch environment
source activate pytorch
# Install the libraries "transformers" and "streamlit" via pip
pip install transformers streamlit