From 61bac5a124eeac5637220b0dc1c7741752e2e6ae Mon Sep 17 00:00:00 2001 From: Coldot <41678750+Coldot@users.noreply.github.com> Date: Sat, 22 Mar 2025 23:08:50 +0900 Subject: [PATCH 1/9] =?UTF-8?q?Feat:=20AWS=20ECS=20=ED=99=98=EA=B2=BD=20?= =?UTF-8?q?=EB=B3=80=EC=88=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 작업 내역 - AWS_REGION 및 COGNITO_USER_POOL_ID 환경 변수를 ECS 태스크 정의에 추가함 --- .aws/ecs-task-definition.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.aws/ecs-task-definition.json b/.aws/ecs-task-definition.json index 43db2dd..52de7c9 100644 --- a/.aws/ecs-task-definition.json +++ b/.aws/ecs-task-definition.json @@ -18,6 +18,10 @@ { "name": "ENV", "value": "prod" + }, + { + "name": "AWS_REGION", + "value": "ap-northeast-2" } ], "environmentFiles": [], @@ -43,6 +47,10 @@ { "name": "MONGODB_PASSWORD", "valueFrom": "arn:aws:secretsmanager:ap-northeast-2:864981757354:secret:rds!cluster-b06771f3-3e07-4b6c-8e7b-b793cb7b498e-CcZIQG:password::" + }, + { + "name": "COGNITO_USER_POOL_ID", + "valueFrom": "arn:aws:secretsmanager:ap-northeast-2:864981757354:secret:xrpedia/credentials-UAy9x0:xrpedia-cognito-user-pool-id::" } ], "ulimits": [], From fae2d5a7d71583bdecaecd9e4743206c5f9e1514 Mon Sep 17 00:00:00 2001 From: Coldot <41678750+Coldot@users.noreply.github.com> Date: Sat, 22 Mar 2025 23:14:22 +0900 Subject: [PATCH 2/9] =?UTF-8?q?Feat:=20=EC=82=AC=EC=9A=A9=EC=9E=90=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20=EC=9D=91=EB=8B=B5=20DTO=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 작업 내역 - 사용자 정보를 위한 Pydantic 기반의 UserInfoResponse 클래스 추가 --- src/main/users/dto/UserInfoDto.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/main/users/dto/UserInfoDto.py diff --git a/src/main/users/dto/UserInfoDto.py b/src/main/users/dto/UserInfoDto.py new file mode 100644 index 0000000..9b7919e --- /dev/null +++ b/src/main/users/dto/UserInfoDto.py @@ -0,0 +1,8 @@ +from pydantic import BaseModel + +class UserInfoResponse(BaseModel): + user_id: str + nickname: str + level_title: str + point: float + total_revenue: float From d63f5e5aea1cd75529f24d72c82a0af23cd572ed Mon Sep 17 00:00:00 2001 From: Coldot <41678750+Coldot@users.noreply.github.com> Date: Sat, 22 Mar 2025 23:14:27 +0900 Subject: [PATCH 3/9] =?UTF-8?q?Feat:=20=EC=82=AC=EC=9A=A9=EC=9E=90=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20=EC=A1=B0=ED=9A=8C=20API=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 작업 내역 - 사용자 정보를 조회하는 GET /users 엔드포인트 추가 - UserInfoResponse DTO를 사용하여 응답 모델 정의 --- src/main/users/router/UserAPIRouter.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/users/router/UserAPIRouter.py b/src/main/users/router/UserAPIRouter.py index 9ad7398..f9abf5e 100644 --- a/src/main/users/router/UserAPIRouter.py +++ b/src/main/users/router/UserAPIRouter.py @@ -1,6 +1,7 @@ import uuid from fastapi import APIRouter, Depends from src.main.auth.dependencies import get_current_user +from src.main.users.dto.UserInfoDto import UserInfoResponse from src.main.users.service.UserService import UserService router = APIRouter( @@ -22,4 +23,11 @@ async def create_wallet( user_id: uuid.UUID = Depends(get_current_user), user_service: UserService = Depends() ): - return await user_service.generate_wallet(str(user_id)) \ No newline at end of file + return await user_service.generate_wallet(str(user_id)) + +@router.get("", response_model=UserInfoResponse) +async def get_user_info( + user_id: uuid.UUID = Depends(get_current_user), + user_service: UserService = Depends() +): + return user_service.get_user_info(str(user_id)) From 87c2cf7ddf5154fe69d5c122a72fca7fec659d4e Mon Sep 17 00:00:00 2001 From: Coldot <41678750+Coldot@users.noreply.github.com> Date: Sat, 22 Mar 2025 23:14:33 +0900 Subject: [PATCH 4/9] =?UTF-8?q?Feat:=20Cognito=20=EC=82=AC=EC=9A=A9?= =?UTF-8?q?=EC=9E=90=20=EC=A0=95=EB=B3=B4=20=EC=A1=B0=ED=9A=8C=20=EA=B8=B0?= =?UTF-8?q?=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 작업 내역 - UserService에 Cognito 클라이언트를 추가하여 사용자 정보를 조회하는 get_user_info 메서드 구현 - 사용자 풀 ID를 환경 변수에서 가져오도록 설정 - nickname을 포함한 사용자 정보 응답 모델 생성 --- src/main/users/service/UserService.py | 51 ++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/src/main/users/service/UserService.py b/src/main/users/service/UserService.py index 5c60d2f..f8c6c78 100644 --- a/src/main/users/service/UserService.py +++ b/src/main/users/service/UserService.py @@ -1,12 +1,30 @@ from xrpl.clients import JsonRpcClient from xrpl.asyncio.wallet import generate_faucet_wallet from src.main.users.repository.UserRepository import UserRepository +import boto3 +import os +from src.main.users.dto.UserInfoDto import UserInfoResponse +from dotenv import load_dotenv + +load_dotenv() TESTNET_URL = "https://s.altnet.rippletest.net:51234" client = JsonRpcClient(TESTNET_URL) class UserService: def __init__(self): self.user_repository = UserRepository() + if os.environ.get('ENV') == 'local-profile': + self.cognito_client = boto3.client( + 'cognito-idp', + region_name=os.environ.get('AWS_REGION', 'ap-northeast-2'), + profile_name=os.environ.get('AWS_PROFILE', 'default') + ) + else: + self.cognito_client = boto3.client( + 'cognito-idp', + region_name=os.environ.get('AWS_REGION', 'ap-northeast-2') + ) + self.user_pool_id = os.environ.get('COGNITO_USER_POOL_ID', '') def get_wallets(self, user_id: str): wallets = self.user_repository.find_wallets_by_user_id(user_id) @@ -18,4 +36,35 @@ async def generate_wallet(self, user_id: str): wallet = await generate_faucet_wallet(client=client, debug=True) wallet_address = wallet.classic_address result = self.user_repository.save_wallet(user_id, wallet_address) - return result \ No newline at end of file + return result + + def get_user_info(self, user_id: str) -> UserInfoResponse: + # Cognito에서 nickname 조회 + nickname = "Unknown" + try: + if self.user_pool_id: + # Cognito 사용자 풀에서 사용자 정보 조회 + response = self.cognito_client.list_users( + UserPoolId=self.user_pool_id, + Filter=f'sub = "{user_id}"' + ) + + if response.get('Users') and len(response['Users']) > 0: + # 사용자의 속성에서 nickname 찾기 + for attr in response['Users'][0].get('Attributes', []): + if attr['Name'] == 'nickname': + nickname = attr['Value'] + break + except Exception as e: + print(f"Error fetching user from Cognito: {str(e)}") + + # 응답 객체 생성 및 반환 + user_info = UserInfoResponse( + user_id=user_id, + nickname=nickname, + level_title="조회되지 않음", # 요구사항에 따라 하드코딩 + point=0.0, # 요구사항에 따라 하드코딩 + total_revenue=0.0 # 요구사항에 따라 하드코딩 + ) + + return user_info \ No newline at end of file From 042496e8fe1b7f48ffa9189811b61048d33dd5c4 Mon Sep 17 00:00:00 2001 From: Coldot <41678750+Coldot@users.noreply.github.com> Date: Sat, 22 Mar 2025 23:24:40 +0900 Subject: [PATCH 5/9] =?UTF-8?q?Feat:=20XRPL=20=EA=B3=84=EC=A0=95=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20=EC=A1=B0=ED=9A=8C=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 작업 내역 - UserService에 XRPL 네트워크에서 계정 정보를 조회하는 get_account_info 메서드 추가 - 사용자의 지갑 주소를 기반으로 XRPL 계정 잔액을 조회하여 응답 모델에 포함하도록 수정 --- src/main/users/service/UserService.py | 36 ++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/src/main/users/service/UserService.py b/src/main/users/service/UserService.py index f8c6c78..c0dbea0 100644 --- a/src/main/users/service/UserService.py +++ b/src/main/users/service/UserService.py @@ -1,5 +1,7 @@ from xrpl.clients import JsonRpcClient from xrpl.asyncio.wallet import generate_faucet_wallet +from xrpl.models.requests import AccountInfo +from xrpl.utils import xrp_to_drops from src.main.users.repository.UserRepository import UserRepository import boto3 import os @@ -37,6 +39,20 @@ async def generate_wallet(self, user_id: str): wallet_address = wallet.classic_address result = self.user_repository.save_wallet(user_id, wallet_address) return result + + def get_account_info(self, client: JsonRpcClient, address: str, **kwargs) -> dict: + """ + XRPL 네트워크에서 이 계정의 정보를 가져옵니다. + + Args: + client (JsonRpcClient): 요청을 보낼 클라이언트입니다. + address (str): 계정 정보를 조회할 계정의 주소입니다. + **kwargs: 추가적인 선택적 매개변수들입니다. + + Returns: + dict: 이 계정의 정보를 포함하는 딕셔너리 객체입니다. + """ + return client.request(AccountInfo(account=address, **kwargs)) def get_user_info(self, user_id: str) -> UserInfoResponse: # Cognito에서 nickname 조회 @@ -57,13 +73,31 @@ def get_user_info(self, user_id: str) -> UserInfoResponse: break except Exception as e: print(f"Error fetching user from Cognito: {str(e)}") + + # MongoDB에서 사용자의 지갑 주소 조회 + point = 0.0 + wallets = self.user_repository.find_wallets_by_user_id(user_id) + if wallets: + try: + # 첫 번째 지갑의 잔액 조회 + wallet_address = wallets[0].get('address') + if wallet_address: + # XRPL 네트워크에서 계정 정보 조회 + account_info = self.get_account_info(client, wallet_address) + if account_info and 'result' in account_info: + # 잔액 정보 추출 + balance = account_info['result'].get('account_data', {}).get('Balance', '0') + # XRP 단위로 변환 (XRP는 소수점 6자리까지 표현) + point = float(balance) / 1000000 + except Exception as e: + print(f"Error fetching account balance from XRPL: {str(e)}") # 응답 객체 생성 및 반환 user_info = UserInfoResponse( user_id=user_id, nickname=nickname, level_title="조회되지 않음", # 요구사항에 따라 하드코딩 - point=0.0, # 요구사항에 따라 하드코딩 + point=point, # XRPL 계정 잔액으로 설정 total_revenue=0.0 # 요구사항에 따라 하드코딩 ) From fc22df8496e494c3912c78f512d17f39435fa422 Mon Sep 17 00:00:00 2001 From: Coldot <41678750+Coldot@users.noreply.github.com> Date: Sat, 22 Mar 2025 23:33:20 +0900 Subject: [PATCH 6/9] =?UTF-8?q?Chore:=20.gitignore=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 작업 내역 - .DS_Store 항목 추가 - .docs 항목 추가 --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c571e8b..3252333 100644 --- a/.gitignore +++ b/.gitignore @@ -173,4 +173,5 @@ cython_debug/ # PyPI configuration file .pypirc -.DS_Store \ No newline at end of file +.DS_Store +.docs \ No newline at end of file From 7523ede22cdd004d24a9ca81c0c512f92b2981c6 Mon Sep 17 00:00:00 2001 From: Coldot <41678750+Coldot@users.noreply.github.com> Date: Sat, 22 Mar 2025 23:39:18 +0900 Subject: [PATCH 7/9] =?UTF-8?q?Feat:=20XRPL=20=EA=B3=84=EC=A0=95=20?= =?UTF-8?q?=EA=B1=B0=EB=9E=98=20=EB=82=B4=EC=97=AD=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 작업 내역 - UserService에 XRPL 네트워크에서 계정의 거래 내역을 조회하는 get_account_transactions 메서드 추가 - 사용자의 총 수익을 계산하여 응답 모델에 포함하도록 수정 --- src/main/users/service/UserService.py | 45 +++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/src/main/users/service/UserService.py b/src/main/users/service/UserService.py index c0dbea0..59b4a1a 100644 --- a/src/main/users/service/UserService.py +++ b/src/main/users/service/UserService.py @@ -1,6 +1,6 @@ from xrpl.clients import JsonRpcClient from xrpl.asyncio.wallet import generate_faucet_wallet -from xrpl.models.requests import AccountInfo +from xrpl.models.requests import AccountInfo, AccountTx from xrpl.utils import xrp_to_drops from src.main.users.repository.UserRepository import UserRepository import boto3 @@ -53,6 +53,22 @@ def get_account_info(self, client: JsonRpcClient, address: str, **kwargs) -> dic dict: 이 계정의 정보를 포함하는 딕셔너리 객체입니다. """ return client.request(AccountInfo(account=address, **kwargs)) + + def get_account_transactions(self, client: JsonRpcClient, address: str, limit: int = 0, **kwargs) -> list: + """ + XRPL 네트워크에서 이 계정의 거래 내역을 가져옵니다. + + Args: + client (JsonRpcClient): 요청을 보낼 클라이언트입니다. + address (str): 거래 내역을 조회할 계정의 주소입니다. + limit (Optional[int]): 검색할 거래의 최대 개수입니다. 0이면 모두 검색합니다. 기본값은 0입니다. + **kwargs: 추가적인 선택적 매개변수들입니다. + + Returns: + list: 이 계정의 거래 내역을 포함하는 리스트입니다. + """ + result = client.request(AccountTx(account=address, limit=limit, **kwargs)) + return result.get('result', {}).get('transactions', []) def get_user_info(self, user_id: str) -> UserInfoResponse: # Cognito에서 nickname 조회 @@ -76,6 +92,7 @@ def get_user_info(self, user_id: str) -> UserInfoResponse: # MongoDB에서 사용자의 지갑 주소 조회 point = 0.0 + total_revenue = 0.0 wallets = self.user_repository.find_wallets_by_user_id(user_id) if wallets: try: @@ -89,8 +106,30 @@ def get_user_info(self, user_id: str) -> UserInfoResponse: balance = account_info['result'].get('account_data', {}).get('Balance', '0') # XRP 단위로 변환 (XRP는 소수점 6자리까지 표현) point = float(balance) / 1000000 + + # 계정의 거래 내역 조회 + transactions = self.get_account_transactions(client, wallet_address) + + # 사용자가 받은 모든 금액 합산 (수익) + for tx in transactions: + # 트랜잭션이 '지불' 타입이고, 이 지갑이 수취인인 경우 + if (tx.get('tx', {}).get('TransactionType') == 'Payment' and + tx.get('tx', {}).get('Destination') == wallet_address): + # 지불된 금액 추출 (delivered_amount 또는 Amount 사용) + delivered_amount = tx.get('meta', {}).get('delivered_amount') + amount = tx.get('tx', {}).get('Amount') + + # 실제 받은 금액 계산 + received_amount = 0 + if delivered_amount and isinstance(delivered_amount, str): + received_amount = float(delivered_amount) / 1000000 + elif amount and isinstance(amount, str): + received_amount = float(amount) / 1000000 + + total_revenue += received_amount + except Exception as e: - print(f"Error fetching account balance from XRPL: {str(e)}") + print(f"Error fetching data from XRPL: {str(e)}") # 응답 객체 생성 및 반환 user_info = UserInfoResponse( @@ -98,7 +137,7 @@ def get_user_info(self, user_id: str) -> UserInfoResponse: nickname=nickname, level_title="조회되지 않음", # 요구사항에 따라 하드코딩 point=point, # XRPL 계정 잔액으로 설정 - total_revenue=0.0 # 요구사항에 따라 하드코딩 + total_revenue=total_revenue # 계산된 총 수익 ) return user_info \ No newline at end of file From 2bf710e71935f06200fdbb56173be0a26215f66a Mon Sep 17 00:00:00 2001 From: Coldot <41678750+Coldot@users.noreply.github.com> Date: Sun, 23 Mar 2025 00:01:19 +0900 Subject: [PATCH 8/9] =?UTF-8?q?Feat:=20=EC=82=AC=EC=9A=A9=EC=9E=90=20?= =?UTF-8?q?=EC=A7=80=EA=B0=91=20=EC=A0=95=EB=B3=B4=20=EC=A1=B0=ED=9A=8C=20?= =?UTF-8?q?=EB=B0=A9=EC=8B=9D=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 작업 내역 - UserService에서 사용자의 지갑 정보를 조회하는 방식을 개선하여, MongoDB에서 직접 지갑 정보를 가져오도록 수정 - XRPL 네트워크에서의 잔액 및 거래 내역 조회 로직을 주석 처리하고, MongoDB에서의 총 수익 및 포인트 계산 로직 추가 - 응답 모델에서 사용자 레벨 타이틀을 NFT 등급으로 변경 --- src/main/users/service/UserService.py | 82 +++++++++++++++------------ 1 file changed, 47 insertions(+), 35 deletions(-) diff --git a/src/main/users/service/UserService.py b/src/main/users/service/UserService.py index 59b4a1a..a591723 100644 --- a/src/main/users/service/UserService.py +++ b/src/main/users/service/UserService.py @@ -91,51 +91,63 @@ def get_user_info(self, user_id: str) -> UserInfoResponse: print(f"Error fetching user from Cognito: {str(e)}") # MongoDB에서 사용자의 지갑 주소 조회 - point = 0.0 - total_revenue = 0.0 - wallets = self.user_repository.find_wallets_by_user_id(user_id) - if wallets: - try: - # 첫 번째 지갑의 잔액 조회 - wallet_address = wallets[0].get('address') - if wallet_address: - # XRPL 네트워크에서 계정 정보 조회 - account_info = self.get_account_info(client, wallet_address) - if account_info and 'result' in account_info: - # 잔액 정보 추출 - balance = account_info['result'].get('account_data', {}).get('Balance', '0') - # XRP 단위로 변환 (XRP는 소수점 6자리까지 표현) - point = float(balance) / 1000000 + # point = 0.0 + # total_revenue = 0.0 + # wallets = self.user_repository.find_wallets_by_user_id(user_id) + # if wallets: + # try: + # # 첫 번째 지갑의 잔액 조회 + # wallet_address = wallets[0].get('address') + # if wallet_address: + # # XRPL 네트워크에서 계정 정보 조회 + # account_info = self.get_account_info(client, wallet_address) + # if account_info and 'result' in account_info: + # # 잔액 정보 추출 + # balance = account_info['result'].get('account_data', {}).get('Balance', '0') + # # XRP 단위로 변환 (XRP는 소수점 6자리까지 표현) + # point = float(balance) / 1000000 - # 계정의 거래 내역 조회 - transactions = self.get_account_transactions(client, wallet_address) + # # 계정의 거래 내역 조회 + # transactions = self.get_account_transactions(client, wallet_address) - # 사용자가 받은 모든 금액 합산 (수익) - for tx in transactions: - # 트랜잭션이 '지불' 타입이고, 이 지갑이 수취인인 경우 - if (tx.get('tx', {}).get('TransactionType') == 'Payment' and - tx.get('tx', {}).get('Destination') == wallet_address): - # 지불된 금액 추출 (delivered_amount 또는 Amount 사용) - delivered_amount = tx.get('meta', {}).get('delivered_amount') - amount = tx.get('tx', {}).get('Amount') + # # 사용자가 받은 모든 금액 합산 (수익) + # for tx in transactions: + # # 트랜잭션이 '지불' 타입이고, 이 지갑이 수취인인 경우 + # if (tx.get('tx', {}).get('TransactionType') == 'Payment' and + # tx.get('tx', {}).get('Destination') == wallet_address): + # # 지불된 금액 추출 (delivered_amount 또는 Amount 사용) + # delivered_amount = tx.get('meta', {}).get('delivered_amount') + # amount = tx.get('tx', {}).get('Amount') - # 실제 받은 금액 계산 - received_amount = 0 - if delivered_amount and isinstance(delivered_amount, str): - received_amount = float(delivered_amount) / 1000000 - elif amount and isinstance(amount, str): - received_amount = float(amount) / 1000000 + # # 실제 받은 금액 계산 + # received_amount = 0 + # if delivered_amount and isinstance(delivered_amount, str): + # received_amount = float(delivered_amount) / 1000000 + # elif amount and isinstance(amount, str): + # received_amount = float(amount) / 1000000 - total_revenue += received_amount + # total_revenue += received_amount - except Exception as e: - print(f"Error fetching data from XRPL: {str(e)}") + # except Exception as e: + # print(f"Error fetching data from XRPL: {str(e)}") + + # nft_grade, point, total_revenue 조회 -> 모두 `wallets` 컬렉션에서 조회 + total_revenue = 0.0 + point = 0.0 + nft_grade = "조회되지 않음" + + wallets = self.user_repository.find_wallets_by_user_id(user_id) + if wallets: + for wallet in wallets: + total_revenue += wallet.get('total_revenue', 0.0) + point += wallet.get('point', 0.0) + nft_grade = wallet.get('nft_grade', "조회되지 않음") # 응답 객체 생성 및 반환 user_info = UserInfoResponse( user_id=user_id, nickname=nickname, - level_title="조회되지 않음", # 요구사항에 따라 하드코딩 + level_title=nft_grade, point=point, # XRPL 계정 잔액으로 설정 total_revenue=total_revenue # 계산된 총 수익 ) From 8a3f57f9ec7fe1d9794e06c455a74c3c2b5f7beb Mon Sep 17 00:00:00 2001 From: Coldot <41678750+Coldot@users.noreply.github.com> Date: Sun, 23 Mar 2025 00:06:15 +0900 Subject: [PATCH 9/9] =?UTF-8?q?Chore:=20MongoDB=20URL=20=ED=99=98=EA=B2=BD?= =?UTF-8?q?=20=EB=B3=80=EC=88=98=20=EC=97=85=EB=8D=B0=EC=9D=B4=ED=8A=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 작업 내역 - ECS 태스크 정의에서 MongoDB 관련 환경 변수를 기존의 SSM에서 Secrets Manager로 변경하여 MONGODB_URL 추가 --- .aws/ecs-task-definition.json | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/.aws/ecs-task-definition.json b/.aws/ecs-task-definition.json index 52de7c9..8d2e6a7 100644 --- a/.aws/ecs-task-definition.json +++ b/.aws/ecs-task-definition.json @@ -29,24 +29,8 @@ "volumesFrom": [], "secrets": [ { - "name": "MONGODB_URI", - "valueFrom": "arn:aws:ssm:ap-northeast-2:864981757354:parameter/xrpedia/documentdb/host" - }, - { - "name": "MONGODB_PORT", - "valueFrom": "arn:aws:ssm:ap-northeast-2:864981757354:parameter/xrpedia/documentdb/port" - }, - { - "name": "MONGODB_DB", - "valueFrom": "arn:aws:ssm:ap-northeast-2:864981757354:parameter/xrpedia/documentdb/dbname" - }, - { - "name": "MONGODB_USER", - "valueFrom": "arn:aws:secretsmanager:ap-northeast-2:864981757354:secret:rds!cluster-b06771f3-3e07-4b6c-8e7b-b793cb7b498e-CcZIQG:username::" - }, - { - "name": "MONGODB_PASSWORD", - "valueFrom": "arn:aws:secretsmanager:ap-northeast-2:864981757354:secret:rds!cluster-b06771f3-3e07-4b6c-8e7b-b793cb7b498e-CcZIQG:password::" + "name": "MONGODB_URL", + "valueFrom": "arn:aws:secretsmanager:ap-northeast-2:864981757354:secret:xrpedia/credentials-UAy9x0:xrpedia-mongodb-url::" }, { "name": "COGNITO_USER_POOL_ID",