aws-cloudformation.md 1.3 KB

aws cloudformation

์ธํ”„๋ผ๋ฅผ ์ฝ”๋“œ๋กœ ์ฒ˜๋ฆฌํ•˜์—ฌ AWS ๋ฐ ํƒ€์‚ฌ ๋ฆฌ์†Œ์Šค๋ฅผ ๋ชจ๋ธ๋ง, ํ”„๋กœ๋น„์ €๋‹ ๋ฐ ๊ด€๋ฆฌ. ๋” ๋งŽ์€ ์ •๋ณด: https://awscli.amazonaws.com/v2/documentation/api/latest/reference/cloudformation/index.html.

  • ํ…œํ”Œ๋ฆฟ ํŒŒ์ผ์—์„œ ์Šคํƒ ์ƒ์„ฑ:

aws cloudformation create-stack --stack-name {{์Šคํƒ-์ด๋ฆ„}} --region {{์ง€์—ญ}} --template-body {{file://๊ฒฝ๋กœ/๋Œ€์ƒ/ํŒŒ์ผ.yml}} --profile {{ํ”„๋กœํŒŒ์ผ}}

  • ์Šคํƒ ์‚ญ์ œ:

aws cloudformation delete-stack --stack-name {{์Šคํƒ-์ด๋ฆ„}} --profile {{ํ”„๋กœํŒŒ์ผ}}

  • ๋ชจ๋“  ์Šคํƒ ๋‚˜์—ด:

aws cloudformation list-stacks --profile {{ํ”„๋กœํŒŒ์ผ}}

  • ์‹คํ–‰ ์ค‘์ธ ๋ชจ๋“  ์Šคํƒ ๋‚˜์—ด:

aws cloudformation list-stacks --stack-status-filter CREATE_COMPLETE --profile {{ํ”„๋กœํŒŒ์ผ}}

  • ์Šคํƒ ์ƒํƒœ ํ™•์ธ:

aws cloudformation describe-stacks --stack-name {{์Šคํƒ-์•„์ด๋””}} --profile {{ํ”„๋กœํŒŒ์ผ}}

  • ์Šคํƒ์— ๋Œ€ํ•œ ๋“œ๋ฆฌํ”„ํŠธ ๊ฐ์ง€ ์‹œ์ž‘:

aws cloudformation detect-stack-drift --stack-name {{์Šคํƒ-์•„์ด๋””}} --profile {{ํ”„๋กœํŒŒ์ผ}}

  • ์ด์ „ ๋ช…๋ น์–ด ํ˜ธ์ถœ ๊ฒฐ๊ณผ์˜ 'StackDriftDetectionId'๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์Šคํƒ์˜ ๋“œ๋ฆฌํ”„ํŠธ ์ƒํƒœ ์ถœ๋ ฅ์„ ํ™•์ธ:

aws cloudformation describe-stack-resource-drifts --stack-name {{์Šคํƒ-๋“œ๋ฆฌํ”„ํŠธ-ํƒ์ง€-์•„์ด๋””}} --profile {{ํ”„๋กœํŒŒ์ผ}}