
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
초기 설정 코드 하고 하던중 오류가 나면서 저 웹에도 안올라가요.

터미널
(venv)
정민재@DESKTOP-BTBI854 MINGW64 ~/Desktop/스파르타/projects/05.fan/deploy
$ eb init
Select a default region
1) us-east-1 : US East (N. Virginia)
2) us-west-1 : US West (N. California)
3) us-west-2 : US West (Oregon)
4) eu-west-1 : EU (Ireland)
5) eu-central-1 : EU (Frankfurt)
6) ap-south-1 : Asia Pacific (Mumbai)
7) ap-southeast-1 : Asia Pacific (Singapore)
8) ap-southeast-2 : Asia Pacific (Sydney)
9) ap-northeast-1 : Asia Pacific (Tokyo)
10) ap-northeast-2 : Asia Pacific (Seoul)
11) sa-east-1 : South America (Sao Paulo)
12) cn-north-1 : China (Beijing)
13) cn-northwest-1 : China (Ningxia)
14) us-east-2 : US East (Ohio)
15) ca-central-1 : Canada (Central)
16) eu-west-2 : EU (London)
17) eu-west-3 : EU (Paris)
own)
(default is 3): 10
own) (default is 3): 10
You have not yet set up your credentials or your credentials are incorrect
You must provide your credentials.
(aws-access-id): AKIATXUEKV742ERW6U7W
(aws-secret-key): CIpB7YX8Y++wN5ku3q8Q1H7cfWmQxyQkQz9xaoEl
Enter Application Name
(default is "deploy"):
Application deploy has been created.
It appears you are using Python. Is this correct?
(Y/n): Y
Select a platform branch.
1) Python 3.8 running on 64bit Amazon Linux 2
2) Python 3.7 running on 64bit Amazon Linux 2
(default is 1):
Cannot setup CodeCommit because there is no Source Control setup, continuing with initialization
Do you want to set up SSH for your instances?
(Y/n): Y
Type a keypair name.
(Default is aws-eb):
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\정민재\.ssh\aws-eb
Your public key has been saved in C:\Users\정민재\.ssh\aws-eb.pub
The key fingerprint is:
SHA256:S9hpFgudLC5GebrQDJnbo+Ya4cZq98Ne+vqR4Ui0kms aws-eb
The key's randomart image is:
+---[RSA 3072]----+
| |
| o . o . |
| + o.+ = |
| Bo+.= + |
|. ooOoo.S |
|o. +++o+o. |
WARNING: Uploaded SSH public key for "aws-eb" into EC2 for region ap-northeast-2.
(venv)
정민재@DESKTOP-BTBI854 MINGW64 ~/Desktop/스파르타/projects/05.fan/deploy
$ eb create myweb
Creating application version archive "app-230105_125644608744".
Uploading deploy/app-230105_125644608744.zip to S3. This may take a while.
Upload Complete.
Environment details for: myweb
Application name: deploy
Region: ap-northeast-2
Deployed Version: app-230105_125644608744
Environment ID: e-eexrug5yrf
Platform: arn:aws:elasticbeanstalk:ap-northeast-2::platform/Python 3.8 running on 64bit Amazon Linux 2/3.4.3
Tier: WebServer-Standard-1.0
CNAME: UNKNOWN
Updated: 2023-01-05 03:56:48.319000+00:00
Printing Status:
2023-01-05 03:56:46 INFO createEnvironment is starting.
2023-01-05 03:56:48 INFO Using elasticbeanstalk-ap-northeast-2-256901820409 as Amazon S3 storage bucket for environment data.
정민재@DESKTOP-BTBI854 MINGW64 ~/Desktop/스파르타/projects/05.fan/deploy
$
(venv)
정민재@DESKTOP-BTBI854 MINGW64 ~/Desktop/스파르타/projects/05.fan/deploy
$ eb create myweb
Creating application version archive "app-230105_125747988640".
Uploading deploy/app-230105_125747988640.zip to S3. This may take a while.
Upload Complete.
ERROR: InvalidParameterValueError - Environment myweb already exists.
(venv)
정민재@DESKTOP-BTBI854 MINGW64 ~/Desktop/스파르타/projects/05.fan/deploy
$ eb list
* myweb
(venv)
정민재@DESKTOP-BTBI854 MINGW64 ~/Desktop/스파르타/projects/05.fan/deploy
$ eb use env-name
ERROR: NotFoundError - Environment "env-name" not Found.
(venv)
정민재@DESKTOP-BTBI854 MINGW64 ~/Desktop/스파르타/projects/05.fan/deploy
$ ~/my-app$ git add
bash: /c/Users/정민재/my-app$: No such file or directory
(venv)
정민재@DESKTOP-BTBI854 MINGW64 ~/Desktop/스파르타/projects/05.fan/deploy
$ ~/my-app$ git commit -m "First commit"
bash: /c/Users/정민재/my-app$: No such file or directory
(venv)
정민재@DESKTOP-BTBI854 MINGW64 ~/Desktop/스파르타/projects/05.fan/deploy
$ eb create myweb
Creating application version archive "app-230105_130021949391".
Uploading deploy/app-230105_130021949391.zip to S3. This may take a while.
Upload Complete.
ERROR: InvalidParameterValueError - Environment myweb already exists.
(venv)
정민재@DESKTOP-BTBI854 MINGW64 ~/Desktop/스파르타/projects/05.fan/deploy
$
application
from flask import Flask, render_template, request, jsonify
application = app = Flask(__name__)
from pymongo import MongoClient
import certifi
ca = certifi.where()
client = MongoClient('mongodb+srv://test:sparta@cluster0.axbe5fk.mongodb.net/?retryWrites=true&w=majority',tlsCAFile=ca)
db = client.dbsparta
@app.route('/')
def home():
return render_template('index.html')
@app.route("/guestbook", methods=["POST"])
def guestbook_post():
name_receive = request.form['name_give']
comment_receive = request.form['comment_give']
doc = {
'name':name_receive,
'comment': comment_receive
}
db.fan.insert_one(doc)
return jsonify({'msg': '저장 완료!'})
@app.route("/guestbook", methods=["GET"])
def guestbook_get():
all_comments = list(db.fan.find({},{'_id':False}))
return jsonify({'result': all_comments})
if __name__ == '__main__':
app.run()
