diff --git a/install-ubuntu.sh b/install-ubuntu.sh index 5312e70..056c039 100644 --- a/install-ubuntu.sh +++ b/install-ubuntu.sh @@ -12,6 +12,7 @@ sudo apt install -y git python3-pip python3.10-venv # Clone the repository if [ ! -d "/opt/flask-socketio-llm-completions" ]; then sudo git clone https://github.com/russellballestrini/flask-socketio-llm-completions.git /opt/flask-socketio-llm-completions + touch /opt/flask-socketio-llm-completions/.flaskenv else echo "The directory /opt/flask-socketio-llm-completions already exists." fi @@ -52,6 +53,7 @@ Group=$(whoami) WorkingDirectory=/opt/flask-socketio-llm-completions Environment="PATH=/opt/flask-socketio-llm-completions/env/bin" ExecStart=/opt/flask-socketio-llm-completions/env/bin/python app.py +EnvironmentFile=/opt/flask-socketio-llm-completions/.flaskenv Restart=always @@ -83,4 +85,3 @@ FLASK_APP=app.py flask db stamp head deactivate echo "Setup and service configuration completed successfully." - diff --git a/template.yaml b/template.yaml index 65a820c..63c34c2 100644 --- a/template.yaml +++ b/template.yaml @@ -55,11 +55,16 @@ Resources: PolicyDocument: Version: '2012-10-17' Statement: - - Sid: "Statement1" + - Sid: "InvokeModel" Effect: "Allow" Action: - "bedrock:InvokeModel" Resource: "*" + - Sid: "InvokeModelWithResponseStream" + Effect: "Allow" + Action: + - "bedrock:InvokeModelWithResponseStream" + Resource: "*" InstanceProfile: Type: AWS::IAM::InstanceProfile @@ -122,10 +127,6 @@ Outputs: Description: The Instance ID of the EC2 instance Value: !Ref EC2Instance - EC2PrivateIpAddress: - Description: "Private IP address of the EC2 instance" - Value: !GetAtt EC2Instance.PrivateIpAddress - LoadBalancerDNSName: Description: The DNS name of the ALB Value: !GetAtt LoadBalancer.DNSName