이번 과제는 매뉴얼을 따라한다고 하였지만 시행착오가 꽤 많았습니다.
(소요시간: 약 8시간)
HoL
Screenshots
과제 참고 사항
•
'https://github.com/ksmin23/octember-bizcard' 의 '(1) aws cdk를 사용하는 방법' 으로 수행하였습니다.
•
Cloud9 으로 IDE 를 생성하여 수행하였습니다.
◦
Cloud9 접속 후 IDE 생성 (EC2 기반)
◦
EC2 Terminal 접속하여 access key 설정 (default 사용)
▪
Cloud9 Terminal 에서 기본 credentials 밖에 사용되지 않음 (aws credentials)
•
cdk bootstrap 설치
◦
과제 수행을 여러번 재시도 하다가 cdk bootstrap 관련 잔재가 (CloudFormation 확인) 남아있으면
cdk bootstrap 명령이 정상적으로 수행되지 않을 수 있습니다.
•
cdk --profile=cdk_user synth 명령의 '--profile' 옵션은 access key 분류명을 얘기하는데
cloud9 활용시 별도 설정 필요없으며 'cdk synth' 만 수행해도 됩니다.
•
cdk deploy 시 꽤 시간이 걸리는 것 같습니다. (30분 이상?)
•
cdk destroy 를 수행 시, CloudWatch Log Groups, S3 Bucket, DynamoDB 테이블은 자동으로 삭제되지 않으므로, 반드시 직접 삭제해야 합니다. (EIP Limit 확인도 필요할 수 있습니다.)
•
ElasticSearch & Kibana 관련하여서는 접근 도메인이 사설IP (10.x.x.x) 로 지정되어있어서,
VPN 환경 구성하여 직접 연결해보진 못했습니다.
•
명함 이미지는 git 프로젝트 내 resources/samples 에 이미 존재합니다.
(처음에는 모르고 제가 가진 명함 몇개로 직접 시도하고 있었습니다.)
•
명함 이미지 업로드시 HTTP 헤더 설정 "Content-Type" 이 "image/jpg" 로 명확히 들어가야 합니다 ('image/jpeg' 가 안되었던 것 같은데 확인은 필요합니다.) 그렇지 않으면 DynamoDB 에서 'status' 컬럼이 'END' 가 되지않고 'PROCESS' 로 지속적으로 남아있습니다. 'status' 가 'END' 가 된다면 어느정도 내부 연동이 잘 되었다고 볼 수 있습니다.
•
Postman 활용 시 Response 의 'Visualize' 탭을 활용하면 테이블 형태의 응답값 결과를 확인할 수 있습니다. 단 'Test' 탭에서 아래와 같은 스키마 설정 등이 필요합니다.
Search 용 스키마 설정
var template = `
<table bgcolor="#FFFFFF">
<tr>
<th>Name</th>
<th>Company</th>
<th>JobTitle</th>
<th>PhoneNumber</th>
<th>Email</th>
<th>Addr</th>
</tr>
{{#each response}}
<tr>
<td>{{_source.name}}</td>
<td>{{_source.company}}</td>
<td>{{_source.job_title}}</td>
<td>{{_source.phone_number}}</td>
<td>{{_source.email}}</td>
<td>{{_source.addr}}</td>
</tr>
{{/each}}
</table>
`;
pm.visualizer.set(template, {
response: pm.response.json()
});
Shell
Recommend 용 스키마 설정
var template = `
<table bgcolor="#FFFFFF">
<tr>
<th>Name</th>
<th>PhoneNumber</th>
<th>Company</th>
<th>JobTitle</th>
<th>Email</th>
<th>Score</th>
</tr>
{{#each response}}
<tr>
<td>{{name}}</td>
<td>{{phone_number}}</td>
<td>{{company}}</td>
<td>{{job_title}}</td>
<td>{{email}}</td>
<td>{{score}}</td>
</tr>
{{/each}}
</table>
`;
pm.visualizer.set(template, {
response: pm.response.json()
});
Shell