{"id":1765,"date":"2020-12-08T11:28:44","date_gmt":"2020-12-08T03:28:44","guid":{"rendered":"https:\/\/9incloud.com\/?p=1765"},"modified":"2023-11-12T17:26:38","modified_gmt":"2023-11-12T09:26:38","slug":"cdk-aws-codedeploy-autoscaling-waitcondition-creationpolicy","status":"publish","type":"post","link":"https:\/\/9incloud.com\/aws\/cdk-aws-codedeploy-autoscaling-waitcondition-creationpolicy","title":{"rendered":"\u4f7f\u7528 CDK \u5efa\u7f6e AWS CodeDeploy \u61c9\u7528\u65bc AutoScaling (\u4e8c) – WaitCondition \u548c CreationPolicy \u4f7f\u7528\u65b9\u5f0f"},"content":{"rendered":"\n
\u7b2c\u4e8c\u7bc7\u6700\u4e3b\u8981\u662f\u6558\u8ff0\u4e00\u4e0b\u8e29\u5230\u7684\u96f7\u6216\u662f\u958b\u767c\u4e0a\u5361\u4f4f\u7684\u90e8\u5206\uff0c\u8edf\u9ad4\u958b\u767c\u53ea\u8981\u6709\u89aa\u624b\u53bb\u505a\uff0c\u57fa\u672c\u4e0a\u8e29\u5230\u96f7\u90fd\u662f\u6b63\u5e38\u7684\uff0c\u53ea\u662f\u6bcf\u500b\u4eba\u6216\u8a31\u8e29\u5230\u7684\u96f7\u90fd\u4e0d\u76f8\u540c\uff0c\u9019\u7bc7\u5c31\u9019\u6b21\u5be6\u4f5c\u4e2d\u8e29\u5230\u7684\u96f7\uff0c\u505a\u500b\u8aaa\u660e\uff0c\u6709\u4e9b\u96f7\u8e29\u5b8c\u5f8c\u4e5f\u89ba\u5f97\u53c8\u5b78\u5230\u4e86\u65b0\u7684\u6771\u897f\uff0c\u4e5f\u662f\u4e00\u500b\u4e0d\u932f\u7684\u7d93\u9a57<\/p>\n\n\n\n
\u00a0<\/p>\n
\u00a0<\/p>\n
\u9019\u500b\u554f\u984c\u5728\u7528 CDK \u958b\u767c\u6642\uff0c\u56f0\u64fe\u4e86\u6211\u4e00\u9663\u5b50\uff0c\u5728\u7d93\u904e\u4e00\u9663\u6478\u7d22\u5f8c\uff0c\u6700\u5f8c\u662f\u6c7a\u5b9a\u628a\u5efa\u7acb IAM \u7684\u90e8\u5206\u62c6\u6210\u4e00\u500b Construct\uff0c\u5176\u4ed6 CodeDeploy \u548c Auto Scaling \u7684\u90e8\u5206\u62c6\u6210\u53e6\u4e00\u500b Construct\uff0c\u4f46\u9019\u6a23\u6216\u8a31\u9084\u4e0d\u5920\u7d30\uff0c\u62c6\u6210 Construct \u6709\u4ee5\u4e0b\u5e7e\u9ede\u597d\u8655<\/p>\n
\u7576\u7136\u6216\u8a31\u66f4\u5f80\u4e0a\u4e00\u5c64\u4f86\u770b\uff0c\u4e00\u500b CDK App \u8dd1\u591a\u500b stack \u4e5f\u5408\u60c5\u5408\u7406\uff0c\u5982\u679c\u5169\u500b\u4ee5\u4e0a\u7684 Stack \u5f7c\u6b64\u4e4b\u9593\u76f8\u4f9d\u4e0d\u5927\u751a\u81f3\u6c92\u6709\u76f8\u4f9d\uff0c\u662f\u53ef\u4ee5\u8003\u616e\u5305\u6210 stack\uff0c\u56e0\u70ba\u6709\u76f8\u4f9d\u7684\u8a71\uff0c\u6211\u5011\u7e3d\u662f\u5e0c\u671b\u904b\u7528 CloudFormaton \u7684\u7279\u6027\uff0c\u82e5\u5931\u6557\u5c31\u80fd\u5168\u90e8 Rollback\uff0c\u7701\u53bb\u624b\u52d5\u518d\u53bb\u64cd\u4f5c AWS \u5f8c\u53f0<\/p>\n
\u6240\u4ee5\u958b\u767c\u6642\u9078\u64c7\u5305\u6210 construct \u4f86\u770b\uff0c\u66f4\u53ef\u4ee5\u9748\u6d3b\u7d44\u5408\u904b\u7528\uff0c\u56e0\u70ba construct \u662f CDK \u6700\u57fa\u5e95\u7684\u5143\u4ef6\uff0c\u4f9b\u8b80\u8005\u53c3\u8003<\/p>\n<\/div>\n\n\n\n
\u00a0<\/p>\n
\u5728\u5beb CDK \u6642\uff0c\u5f15\u7528\u65b9\u6cd5\u53ef\u4ee5\u76e1\u91cf\u53bb\u770b CDK \u7684 source code\uff0c\u56e0\u70ba\u88e1\u9762\u90fd\u6703\u63d0\u5230\u8a72\u600e\u9ebc\u4f7f\u7528\uff0c\u8981\u5e36\u5165\u4ec0\u9ebc\uff0c\u82e5\u662f cfn \u7684 L1 Construct\uff0c\u53c3\u6578\u5927\u90fd\u90fd\u6703\u63d0\u4f9b CloudFormation \u7684\u9023\u7d50\u4f9b\u53c3\u6578\uff0c\u975e\u5e38\u65b9\u4fbf<\/p>\n
\u800c\u6703\u8e29\u5230\u9019\u500b\u554f\u984c\uff0c\u662f\u56e0\u70ba\u6c92\u6709\u770b\u6e05\u695a\u8aaa\u660e\uff0c\u5728\u4f7f\u7528\u7684\u6642\u5019\u662f\u5982\u4e0b\u7a0b\u5f0f\u78bc<\/p>\n<\/div>\n\n\n\n