๐Ÿš€ Languege 39

AWS Codepipeline lambda ์‹คํ–‰ํ•˜๊ธฐ

Codepipeline์—์„œ lambda๋ฅผ ์‹คํ–‰ํ•˜๋ ค๋ฉด, Codepipelin์—๊ฒŒ ์™„๋ฃŒ๋˜์—ˆ๋Š”์ง€ ์—ฌ๋ถ€๋ฅผ ์•Œ๋ ค์ค˜์•ผ ํ•œ๋‹ค. ์•„๋ž˜ ์ฝ”๋“œ๋Š” ๋‹จ๋…์‹คํ–‰ task๋ฅผ ์œ„ํ•œ ์ƒ˜ํ”Œ ์ฝ”๋“œ์ด๋‹ค. import urllib3 import json import boto3 import json import botocore.exceptions def lambda_handler(event, context): client = boto3.client("ecs", region_name="ap-northeast-2") waiter = client.get_waiter('tasks_stopped') code_pipeline = boto3.client('codepipeline') job_id = event['CodePipeline.job']['id'] ..

CodePipeline ECR Rolling Update๋ฅผ ์œ„ํ•œ TaskDefinition Update Lambda ์ฝ”๋“œ

CodePipelin ๊ตฌ์„ฑ ์‹œ, ๋นŒ๋“œ๊ณผ์ • ์—†์ด ECR -> ECS ์— ๋ฐ”๋กœ ๋ฐฐํฌํ•œ๋‹ค๋ฉด TaskDefinition ํŒŒ์ผ์„ ์—…๋ฐ์ดํŠธ ํ•ด์ค˜์•ผ ํ•œ๋‹ค. ๊ทธ๋Ÿฌ์ž๊ณ  Codebuild๋ฅผ ์“ฐ์ž๋‹ˆ, ํŒŒ์ผ ๋งŒ๋“œ๋Š”๋ฐ ๋ช‡์ดˆ๋ฉด ๋๋‚˜๋Š”๋ฐ, ๋น„์šฉ๋„ ๋น„์šฉ์ด๊ณ  codebuild๋Š” ๋ฌด๊ฒ๋‹ค ใ…  (์ด๊ฑฐ ๋Œ๋ฆฌ๋Š”๋ฐ 4๋ถ„๊ฑธ๋ฆฐ๋‹ค..) lambda๋กœ ํ•˜๋ฉด 30์ดˆ๋ฉด ๋๋‚˜๋‹ˆ ์ด๋ ‡๊ฒŒ ํ•ด๋ณด๋Š”๊ฒƒ์„ ์ถ”์ฒœํ•œ๋‹ค. =========================================== Source ------> Def-Step ------> ECS (rolling update) [ECR] [Lambda] =========================================== import json import boto3 import zipfile imp..

CI/CD ๊ณต๋ถ€ ๋…ธํŠธ #2

https://www.youtube.com/watch?v=3WZoVkvLE4A 3. ๊ฐœ๋ฐœํ™˜๊ฒฝ ๋ฐ CI/CD์˜ ๊ธฐ๋ณธ ๋™์ž‘ ์ดํ•ด ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์˜ ์ข…๋ฅ˜ ๊ฐœ๋ฐœ์ž์˜ ๋กœ์ปฌ ํ™˜๊ฒฝ ํ†ตํ•ฉํ…Œ์ŠคํŠธ QAํ™˜๊ฒฝ ์‹ค์œ ์ € ํ”„๋กœ๋•์…˜ ๊ฐœ๋ฐœ ํ”„๋กœ์„ธ์Šค ๊ฐœ๋ฐœ์ž๊ฐ€ ์ž์‹ ์˜ PC์—์„œ ๊ฐœ๋ฐœ์„ ์ง„ํ–‰ํ•œ๋‹ค. ๋‹ค๋ฅธ ๊ฐœ๋ฐœ์ž๊ฐ€ ์ž‘์„ฑํ•œ ์ฝ”๋“œ์™€ ์ฐจ์ด๊ฐ€ ๋ฐœ์ƒํ•˜์ง€ ์•Š๋Š”์ง€ ๋‚ด๋ถ€ ํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•œ๋‹ค. ์ง„ํ–‰ํ•œ ๋‚ด์šฉ์„ ๋‹ค๋ฅธ ๊ฐœ๋ฐœ์ž๋“ค๊ณผ ๋™์œ ํ•˜๊ธฐ ์œ„ํ•ด git ๊ฐ™์€ SCM์— ์˜ฌ๋ฆฐ๋‹ค -> dev ๋ธŒ๋žœ์น˜ Dev๋ธŒ๋žœ์น˜์˜ ๋‚ด์šฉ์„ ๊ฐœ๋ฐœ ํ™˜๊ฒฝ์— ๋ฐฐํฌํ•˜๊ธฐ ์ „์— Lint๋“ฑ ์ฝ”๋“œ ํฌ๋ฉงํŒ…์„ ํ•œ๋‹ค ๋ฐฐํฌํ•˜๊ธฐ ์œ„ํ•œ ๋นŒ๋“œ ๊ณผ์ •์„ ๊ฑฐ์นœ๋‹ค ์ฝ”๋“œ๋ฅผ ๋ฐฐํฌํ•œ๋‹ค ํ…Œ์ŠคํŠธ๋ฅผ ์ง„ํ–‰ํ•œ๋‹ค ์œ„ ๊ณผ์ •์„ Dev, QA, PRDํ™˜๊ฒฝ์—์„œ ๋ชจ๋‘ ํ•˜๊ณ  ๊ฐ๊ฐ ๋งž๋Š” ํ™˜๊ฒฝ์— ๋ฐฐํฌํ•œ๋‹ค. ์—ฌ๋Ÿฌ ๋ฐฐํฌํ™˜๊ฒฝ์˜ ๊ด€๋ฆฌ ์—ฌ๋Ÿฌ ๋ฐฐํฌํ™˜๊ฒฝ์˜ ๊ด€๋ฆฌ์—์„œ ํ•ต์‹ฌ์€ ์ธํ”„๋ผ..

CI/CD ๊ณต๋ถ€ ๋…ธํŠธ #1

https://www.youtube.com/watch?v=JPDKLgX5bRg&t=24s 1. CI/CD๋ž€ ๋ฌด์—‡์ธ๊ฐ€? Continuous Integration : ์—ฌ๋Ÿฌ ๊ฐœ๋ฐœ์ž๋“ค์˜ ์ฝ”๋“œ๋ฒ ์ด์Šค๋ฅผ ๊ณ„์†ํ•ด์„œ ํ†ตํ•ฉํ•˜๋Š”๊ฒƒ Continuous Delivery : ์‚ฌ์šฉ์ž์—๊ฒŒ ์ œํ’ˆ/์„œ๋น„์Šค๋ฅผ ์ง€์†์ ์œผ๋กœ ์ œ๊ณต, ์ฝ”๋“œ๋ฒ ์ด์Šค๊ฐ€ ํ•ญ์ƒ ๋ฐฐํฌ ๊ฐ€๋Šฅํ•œ ์ƒํƒœ๋ฅผ ์œ ์ง€ํ•˜๋Š”๊ฒƒ Continuous Deployment : ์ฝ”๋“œ๋ฒ ์ด์Šค๋ฅผ ์‚ฌ์šฉ์ž๊ฐ€ ์‚ฌ์šฉ๊ฐ€๋Šฅํ•œ ํ™˜๊ฒฝ์— ๋ฐฐํฌํ•œ๋Š๊ฒƒ์„ ์ž๋™ํ™” ํ•˜๋Š”๊ฒƒ ์ฆ‰, ์ฝ”๋“œ ๋นŒ๋“œ&ํ…Œ์ŠคํŠธ&๋ฐฐํฌ ์ž๋™ํ™”! ๊ฐ ๋‹จ๊ณ„๋ฅผ ํ•˜๋‚˜์˜ ํŒŒ์ดํ”„๋ผ์ธ์œผ๋กœ ์ •์˜ ์ฝ”๋“œ ์ž‘์„ฑ ๋นŒ๋“œ: webpack, ํƒ€์ž…์Šคํฌ๋ฆฝํŠธ ์ปดํŒŒ์ผ, ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ์ปดํŒŒ์ผ ํ…Œ์ŠคํŠธ: Jest, Junit ๋ฐฐํฌ: ... 2. ์  ํ‚จ์Šค์˜ ๊ธฐ๋ณธ ๊ฐœ๋…๊ณผ ๋™์ž‘ ๋ฐฉ์‹ ์  ํ‚จ์Šค๊ฐ€ ๋ญ์•ผ? ๊ท€์ฐฎ์€ ์ž‘์—…(..

[aws phpsdk ์„ค์น˜]

์ •๋ง ๊ฐ„๋‹จํ•˜์ง€๋งŒ, ์‰ฝ์ง€์•Š์•˜๋˜.... aws phpsdk ์„ค์น˜ ํ•˜๊ธฐ ์ž…๋‹ˆ๋‹ค ใ… .ใ…  1. ์‚ฌ์ „ ์กฐ๊ฑด # EC2 ์ธ์Šคํ„ด์Šค ํ”„๋กœํŒŒ์ผ(role)์„ค์ • EC2 role ์— ๋ฐ˜๋“œ์‹œ S3 ๊ถŒํ•œ์„ ๋„ฃ์–ด์ค๋‹ˆ๋‹ค (https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials.html) 2. aws php sdk ์„ค์น˜ # install httpd php 7.2 yum install httpd -y amazon-linux-extras install php7.2 -y # install php-xml && ์„œ๋น„์Šค ์žฌ์‹œ์ž‘ (์ค‘์š”)!!! yum install php-xml -y systemctl restart php-fpm systemctl restart htt..

[aws python] ๋ฃจํŠธ๋ณผ๋ฅจ ๋Š˜๋ฆฌ๊ธฐ!

#!/bin/bash # Specify the desired volume size in GiB as a command-line argument. If not specified, default to 20 GiB. SIZE=${1:-20} # Get the ID of the environment host Amazon EC2 instance. INSTANCEID=$(curl http://169.254.169.254/latest/meta-data//instance-id) # Get the ID of the Amazon EBS volume associated with the instance. VOLUMEID=$(aws ec2 describe-instances \ --instance-id $INSTANCEID \ ..

Python์—์„œ Hostname ํ™•์ธํ•˜๊ธฐ

์•„์ฃผ ๊ฐ„๋‹จํ•ฉ๋‹ˆ๋‹ค. import socket print(socket.gethostname()) (base) [root@ip-172-31-14-180 basicPubSub]# python3 Python 3.8.8 (default, Apr 13 2021, 19:58:26) [GCC 7.3.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> print(socket.gethostname()) ip-172-31-14-180.ap-northeast-2.compute.internal

[java ERROR] Spring Boot SSLHandshakeException

Java ์‹คํ–‰ ์ค‘ SSLHandshakeException ์˜ค๋ฅ˜๊ฐ€ ๋‚˜์™”๋„ค์šฉ.... ๊ฐœ๋ฐœํ—ˆ์ ‘์€ ํ•ด๊ฒฐํ•ด๋‹ฌ๋ผ๊ณ  ์†๋ชจ์•„ ๊ธฐ๋„ํ•˜๋ฉด์„œ ์šธ์–ด์š”....๐Ÿ˜ญ๐Ÿ˜ญ๐Ÿ˜ญ..์šธ๋‹ค๊ฐ€ ์ž˜ ํ•ด๊ฒฐ๋์Šต๋‹ˆ๋‹ค. โ— ์˜ค๋ฅ˜ ๋‚ด์šฉ : SSLHandshakeException Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate) โ— ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• : java.security ํŒŒ์ผ์˜ ๋‚ด์šฉ์„ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค. 1) java.security ํŒŒ์ผ์„ ์ฐพ์Šต๋‹ˆ๋‹ค. sh-3.2# find / -name java.security /Library/InstallerSandboxes/.PKInstallSan..

[AWS SDK for PHP 3] php sdk๋กœ Athena ์ฟผ๋ฆฌํ•ด๋ณด๊ธฐ

์•ˆ๋…•ํ•˜์„ธ์š” ๐Ÿค— ์˜ค๋Š˜์€ ๋ฌธ์„œ๊ฐ€ ๋งŽ์ง€ ์•Š์•„์„œ ์• ๋ฅผ ๋จน์€.... php sdk๋ฅผ ์ด์šฉํ•œ Athena ์ฟผ๋ฆฌ ์ž…๋‹ˆ๋‹ค!!! AWS SDK for PHP 3 ์„ค์น˜ : https://docs.aws.amazon.com/ko_kr/sdk-for-php/v3/developer-guide/getting-started_installation.html AWS SDK ๋ฌธ์ œ : https://docs.aws.amazon.com/aws-sdk-php/v3/api/class-Aws.Athena.AthenaClient.html ์ƒ˜ํ”Œ์ฝ”๋“œ

[AWS Code Commit] Mac codecommit 403 Error (The requested URL returned error: 403)

MAC ์œ ์ €๋“ค ์ค‘ AWS Code Commit ์ž๊ฒฉ์ฆ๋ช… ์˜ค๋ฅ˜(403) ๊ฐ€๋”... ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. fatal: unable to access '[git์ €์žฅ์†Œ๋ช…]': The requested URL returned error: 403 # git push https://git-codecommit.ap-northeast-2.amazonaws.com/v1/repos/example.info fatal: unable to access 'https://git-codecommit.ap-northeast-2.amazonaws.com/v1/repos/example.info/': The requested URL returned error: 403 ์•„๋ž˜ ์ˆœ์„œ์— ๋”ฐ๋ผ ๋ชจ๋“ ๊ฒƒ์ด ์ •์ƒ์ธ์ง€ ํ™•์ธํ•ด๋ด…๋‹ˆ๋‹ค. 1. git ์ž๊ฒฉ์ฆ๋ช… ์„ค์ •ํŒŒ์ผ ํ™•..

728x90