ããã«ã¡ã¯ãèªç§°ã½ããã¦ã§ã¢ã¨ã³ã¸ãã¢ã®æ©æ¬ (@hassaku_63)ã§ãã
æ¬è¨äºã¯ CDK 㨠TypeScript ã®åç´è åãã§ããä»åã®é¡æã«éããå²ã¨é »åºãã¯ããã¯ã ã¨æãã®ã§ãææ¢ãã«å®è£ ãã¦ãã人ã¯ãã²åèã«ãã¦ãã ããã
ãã®è¨äºã§ã¯ãdev ç°å¢ã§ã¯è©¦è¡é¯èª¤ããããã« DeletionPolicy, UpdateReplacePolicy ã "DELETE" ã«å¼·å¶ã»ããããæ¹æ³ããç´¹ä»ãã¾ãã
ã¾ããæå¾ã®ã»ã¯ã·ã§ã³ã§ã¯ãæ £ç¨å¥ãçãªè¡¨ç¾ãè¦ããå ±æãããã¨ã®éè¦æ§ã«ã¤ãã¦ç§è¦ãè¿°ã¹ã¾ãã
åæ: ç¨èªã®å®ç¾©
dev, stg, prod ã®ãããªããã®ç°å¢ã®ä½ç½®ä»ããå®ç¾©ããå称ãç§ãã¡ã¯ãã使ãã¾ãããããããç°å¢ãã¨ããã¹ãã¼ã¸ãã®ããã«å¼ã°ãããã¨ãå¤ãæ¦å¿µã ã¨æãã¾ãããã®è¨äºã§ã¯ä¸è²«ãã¦ãã¹ãã¼ã¸ãã¨å¼ç§°ãã¾ãã
ãã®è¨äºã§å®è£ ãããã®
éçºããã¸ã§ã¯ãããã£ã¤ãæ¤è¨¼ä¸ã®ãã§ã¼ãºã«ããã¨ããCloudFormation Stack ãã¨æ°æ¥½ã«åé¤ãã¦åãããã¤ããããªãå ´åãããã¨æãã¾ãã
ãã¨ãã° CloudWatch LogGroup ã DynamoDB Table, ECR Repository ãªã©ãCDK çã«ããã©ã«ã㧠RETAIN ããªã·ã¼ãè¨å®ããã¦ãããªã½ã¼ã¹ãããã¾ãããããããªã½ã¼ã¹ãæ§ç¯ããå ´åãcdk destroy ã®å®è¡æã«ã¨ã©ã¼ãçãã¦ãã¾ãï¼ãããã¯æ®åãªã½ã¼ã¹ã«ãªã£ã¦ãã¾ãï¼å ´åãããã¾ããStack ãã¨ç ´å£ãã¦è©¦è¡é¯èª¤ãåãããéçºåæã®ãã§ã¼ãºã§ã¯ãããã¯ãã¾ãããããããã¾ããã
ãã£ã¦ãæ¤è¨¼éçºãè¡ã£ã¦ãããã¹ãã¼ã¸ãã§ã®ã¿ãDeletionPolicy 㨠UpdateReplacePolicy ã "Delete" ã«ã»ãããããã¨ã§ãCloudFormation ãªã½ã¼ã¹ã®åé¤ãåé¡ãªãè¡ããããã«ãã¾ãã
ããã CDK ã® Aspects ã¨ããä»çµã¿ãå©ç¨ãã¦å®è£ ãã¦ã¿ã¾ãã
ä¸æ¹ã§ãä¸è¨ã®å±æ§ã "Delete" ã«ã»ããããæ±ãã¯ãåºæ¬çã«èªåã®æå ã§åããå ´å以å¤ã¯ã©ã®ãããªã¹ãã¼ã¸ã§ãé¿ããæ¹ããããã®ã§ãããã£ããæ¬çªç°å¢ã«ãã®è¨å®ãé©ç¨ããã¦ãã¾ããããªäºæ ã¯é¿ãããã§ãããã£ã¦ãããã§ãã1ã¤ã®è¦ä»¶ãå å³ãã¾ããããªãã¡ããããããå人æ¤è¨¼ç¨éãã«å¯¾å¿ããã¹ãã¼ã¸ã§ã®ã¿ DeletionPolicy 㨠UpdateReplacePolicy ã®å¤æ´ãè¡ããããªæ¯ãèãã追å ãã¾ããæ¬è¨äºã§ã¯ãã®ã¹ãã¼ã¸ã "dev" ã¨ãã¾ãã
åããª: Aspects ã®ç´¹ä»
CDK Aspects 㯠construct tree ã®ä»»æã®ãã¼ãï¼ããã³ãã®åãã¼ãå ¨ä½ï¼ã«å¯¾ãã¦ä½ããã®å¦çãé©ç¨ããã¦ã¼ã¹ã±ã¼ã¹ã§å©ç¨ã§ãã¾ãããã®ããã㯠CDK å ¬å¼ããã¥ã¡ã³ãã® "Conpects" ã«è¨è¿°ãããã¾ãã
Aspects ã®æãå ¸åçãªä½¿ç¨ä¾ã¯ã¿ã°ã®ä¸æ¬ä»ä¸ã§ããããCDK ã§ãé常ã«å ¸åçãªã¦ã¼ã¹ã±ã¼ã¹ã¨ãã¦è¦ã¦ããã®ã§ããããAspects ã®å®è£ ã¨ã㦠Tags ã¯ã©ã¹ãæ¨æºæä¾ããã¦ãã¾ããCDK App ããã㯠Stack ã«å¯¾ãã¦ãã¿ã°ã®ä»ä¸ãå¯è½ãªãªã½ã¼ã¹ã¿ã¤ããã¹ã¦ã«ç¹å®ã®ã¿ã°ãä»ä¸ããè¨è¿°ããCDK ã§ã¯1è¡ã§å®è£ å¯è½ã§ãããã®æ¹æ³ã¯ CDK Concepts ã® Tags ã®ãã¼ã¸ã§ãç´¹ä»ããã¦ãã¾ãã以ä¸ãããã¥ã¡ã³ãããå©ç¨æ¹æ³ãå¼ç¨ãç´¹ä»ãã¾ãã
Tags.of(myConstruct).add('key', 'value');
ãã®å®è£
ã«ãããmyConstruct ã¨ãã Construct ã¨ãã®é
ä¸ã«ããã¿ã®ã³ã°å¯è½ãªãªã½ã¼ã¹ã« key=value
ã®ãªã½ã¼ã¹ã¿ã°ãä»ä¸ããã¾ããåå¥ãªã½ã¼ã¹ã«è¨è¿°ããæ¹æ³ãããç°¡ç´ ã§ããã¤æ¼ãããªãã®ãé常ã«å¬ãããã¤ã³ãã§ãããmyConstruct ã®é¨åã«ã¯ CDK App ã Stack ã®ã¤ã³ã¹ã¿ã³ã¹ãå
¥ããã®ãå
¸åçã§ãã
Aspects ã®å¿ç¨ã¯ãããããããã§ãããã¾ãããç§å人ã¯ãããã¤åã«æ©è½ãããããªãã¼ã·ã§ã³ããå®è¡ããç®çã§å©ç¨ããã®ãä¸çªå ¸åçã§ãã㤠CDK ã®æ¨å³ãè¯ãå¼ãåºãã使ãæ¹ã ã¨èãã¦ãã¾ããæ¯éè¦ãã¾ãããã
Aspects ã®èå¾ã«ããè¨è¨ãã¿ã¼ã³
Aspects 㯠GoF ãã¶ã¤ã³ãã¿ã¼ã³ã® Visitor ãå¿ç¨ãããã®ã§ã*1ã
åå ¸*2ã§ã¯ãã¦ã¼ã¹ã±ã¼ã¹ã¨ã㦠ASTï¼æ½è±¡æ§ææ¨ï¼ã®ãããªæ¨æ§é ã®èµ°æ»ãè¡ãã¦ã¼ãã£ãªãã£ãç´¹ä»ããã¦ãã¾ããCDK ã® Construct tree ãæ¨æ§é ãæãã¦ã¾ããã¾ããããããã®ãã¼ã (construct) ã«å¯¾ããæ¯ãèããå®è£ ãããã¨ããã¦ã¼ã¹ã±ã¼ã¹ã«ãé©åãã¾ãã
Visitor ãã¿ã¼ã³ãå®è£ ãã Aspects ã¦ã¼ãã£ãªãã£ã®æä¾ã¯é常ã«åççã§ãã
(2024/09/18) 追è¨
CDK ã§æ¡ç¨ããã¦ãã GoF ãã¶ã¤ã³ãã¿ã¼ã³ã®è©±...ã¨ãããã¨ã§ããã°ãAWS Dev Day 2023 ã§ã®å¾è¤ãã (@365_step_tech) ã®ç»å£ããç´¹ä»ããã°ãªãã¾ããï¼æ¸ãã¦ãéä¸ã¯ãã£ãã失念ãã¦ããã¾ããï¼ããã¶ã¤ã³ãã¿ã¼ã³ã«ã¤ãã¦ãã£ã¨ç¥ããããªã£ãæ¹ã¯ããã²ä»¥ä¸ã®è¨äºãè¦ã¦ã¿ã¦ãã ããããªã³ã¯å ã®è¨äºæ«å°¾ãããAWS Dev Day 2023 ã®ç»å£è³æãã確èªããã ãã¾ãã
å®è£
bin/
é
ä¸ã§ CDK App ãå®ç¾©ãã¦ããã¢ã¸ã¥ã¼ã«ã§ã次ã®ããã«å®è£
ãã¾ãã
ããã¤ããã¤ã³ããããã¾ãã®ã§ããµãã»ã¯ã·ã§ã³ã§è§£èª¬ãã¾ãã
Stage ã®åå®ç¾©ã¨åã¬ã¼ãã®å®è£
対å¿ããå®è£ ç®æã¯æ¬¡ã®ãããã¯ã§ãã
const availableStages = ['dev', 'stg', 'prod'] as const; type Stage = typeof availableStages[number]; // 'dev' | 'stg' | 'prod' // åã¬ã¼ãé¢æ°ããã®é¢æ°ã®æ»ãå¤ã¯ boolean function isValidStage(stage: string): stage is Stage { return availableStages.includes(stage as Stage); } // context key 'stage' ã®å¤ãåå¾ã // ãã®ä¾ã§ã¯ããããã¤æã« cdk deploy -c stage=dev ã®ããã«æå®ãããã¨ã§ã¹ãã¼ã¸ã®å¤ãä¸ããæ³å® const stage = app.node.tryGetContext('stage'); if (!isValidStage(stage)) { throw new Error(`Invalid stage: ${stage}`); } // ãã以éã§ã¯ãå¤æ° stage ã Stage åã¨ãã¦æ¨è«ããã
TypeScript ã®åã¬ã¼ããç¨ãããã¨ã§ãContext ããåãåã£ãã¹ãã¼ã¸å¼æ°ãæ³å®ããã¹ãã¼ã¸ (dev/ stg/ prod) ã®ããããã§ãããã¨ãä¿è¨¼ã§ãã¾ãã å®éã«ä½¿ã£ã¦ã¿ãã¨ãããã¾ãããã¨ãã£ã¿ä¸ã§åæ¨è«ãåãã®ãé常ã«ãããããã§ããTypeScript ãç¨ããããã§ã¯ãåæ¨è«ãæ©è½ããããã«æ¸ããã¨ãé常ã«éè¦ã§ããåã¬ã¼ãé¢æ°ã¯åºç¤ãã¯ããã¯ã§ãã®ã§ãå¿ ãè¦ãã¦ããã¾ãããã
åã¬ã¼ãã«ã¤ãã¦ã¯æ¥æ¬èªã§ã¢ã¯ã»ã¹ã§ããæ å ±æºããã§ã«ããã¾ãã®ã§ã詳ããã¯ãã¡ãã«è²ãã¾ãã以ä¸ã®ãã¼ã¸ãåèã«ãã¦ãã ããã
åã¬ã¼ã | TypeScript Deep Dive æ¥æ¬èªç
åã¬ã¼ãé¢æ° (type guard function) | TypeScriptå ¥éããµãã¤ãã«TypeScriptã
ä»åæ示ããåã¬ã¼ãé¢æ° isValidStage
ã§ã¯ãæ»ãå¤ã®å®£è¨ã« stage is Stage
ã¨è¨è¿°ãã¦ãã¾ããããæ¸ããã¨ã§ããæ»ãå¤ã true ã§ããã°ãstage å¼æ°ã¯ "Stage" åã¨ãã¦æ¨è«ãã¦ãããã¨æè¨ãã¦ãããã¨ã«ãªãã¾ããããã¾ã§ããã¯ãTypeScript ã®ã³ã³ãã¤ã©ã«ããä¼ãããã¨ããã ãã®è©±ãªã®ã§ãåã¬ã¼ãé¢æ°ã®ä¸èº«ã®å¦¥å½æ§ã¯æ¸ãæãä¿è¨¼ããå¿
è¦ãããç¹ã«æ³¨æãã¦ãã ããã
ãã®ã»ã¯ã·ã§ã³ã§ç¤ºããå 容ã«ã¯ãåã¬ã¼ãé¢æ°ä»¥å¤ã«ããã¤ã³ããããã¾ãã以ä¸ã®è¨è¿°ã§ãã
const availableStages = ['dev', 'stg', 'prod'] as const; type Stage = typeof availableStages[number];
availableStages[number]
ã®é¨åããç¥ããªãã¨æå³ä¸æã«è¦ããããããã¾ããããã㯠Indexed Access Typesï¼ã¤ã³ããã¯ã¹ã¢ã¯ã»ã¹åï¼ã¨å¼ã°ãã¾ããIndexed access types ã«é¢ããããã¥ã¡ã³ãã¯ã以ä¸ã®ãã¼ã¸ããåèãã ããã
TypeScript: Documentation - Indexed Access Types
typeof availableStages[number]
ã¨è¨è¿°ãããã¨ã§ã availableStages
ã®é
åå¤æ°ã®åè¦ç´ ã®å¤ã typeof ãã¦å¾ãããåã左辺㮠Stage åã®å®ç¾©ã¨ãªãã¾ãã
ç´åã® availableStages ã®å®£è¨ã« as const
ãå
¥ã£ã¦ãç¹ããã¤ã³ãã§ããããæ¸ããã¨ã§ãavailableStages ã®åæ¨è«ã¯ dev, stg, prod ã®3ã¤ã®æååè¦ç´ ã®ã¿ãæ㤠readonly ãªé
ååã¨ãã¦èªèããã¾ãã試ãã«ã³ã¼ããæå
ã«ã³ãããã¦ãas const ãåé¤ãã¦åæ¨è«ãã©ããªããã確èªãã¦ã¿ãã¨è¯ãã§ããããavailableStages 㯠string ã®é
åå string[]
ã¨ãã¦æ¨è«ãããããã«ãã£ã¦ Stage åã®æ¨è«çµæãæå¾
ã«æ²¿ãã string åã¨ãã¦æ¨è«ããã¦ãã¾ãã¾ãã
èªä½ Aspects "EnforceDeletionPolicy" ã®å®è£
dev ã¹ãã¼ã¸ã§ã®ã¿é©ç¨ããããããªã·ã¼ããå®è£ ãã¾ãããã㯠IAspects ã¤ã³ã¿ãã§ã¼ã¹ãç¶æ¿ããã¯ã©ã¹ã¨ãã¦å®è£ ãã¾ãã
class EnforceDeletionPolicy implements cdk.IAspect { public visit(node: IConstruct): void { // ãã¹ã¦ã® CloudFormation ãªã½ã¼ã¹ã«é©ç¨ if (node instanceof cdk.CfnResource) { // DeletionPolicy ããã³ UpdateReplacePolicy ã "Delete" ã«ä¸æ¸ãããã¡ã½ãã node.applyRemovalPolicy(cdk.RemovalPolicy.DESTROY); } } } // dev ã¹ãã¼ã¸ã®å ´åã ãé©ç¨ if (stage === 'dev') { // CDK App ã¨ãã®é ä¸ã® construct ãã¼ãã«å¯¾ã㦠EnforceDeletionPolicy ãé©ç¨ãã cdk.Aspects.of(app).add(new EnforceDeletionPolicy()); }
visit ã¡ã½ããã§ãèªåé©ç¨ããããã¸ãã¯ãå®è£ ããå¿ è¦ãããã¾ãããã©ã¡ã¼ã¿ã® node ã¯ãç¾å¨èµ°æ»ããã¦ãã construct ã示ãã¾ããä»åã®å®è£ ã§ã¯ã次ã®ããã«ãã¦ãã¾ãã
- visit ã«æ¸¡ããããã¹ã¦ã® construct ã®ãã¡ãCloudFormation ãªã½ã¼ã¹ã§ãããã® (CfnResource) ãã¹ã¦ã« DeletionPolicy = "Delete" ããã³ UpdateReplacePolicy = "Delete" ãé©ç¨
- ï¼Context çµç±ã§æ¸¡ãããï¼ãããã¤ã¹ãã¼ã¸ã "dev" ã§ããå ´åã®ã¿ãCDK App å ¨ä½ã«ãã® Aspects ãé©ç¨ãã
Aspects.of(...)
ã§æ¸¡ãã construct ãããã® Aspects ã®é©ç¨ç¯å²ã«ãªãã¾ããããã«å
¥ãå¤ã¯ App ã Stack ãªãã¸ã§ã¯ãã§ããå ´åãå¤ãã¨æãã¾ããä»åã®ä¾ã§ã¯ App ã渡ãã¦ãã¾ãã
ã¾ã¨ã & ãã¾ã
åããã¨ã CloudFormation ã ãã§å®è£ ãããã¨ããã®ã¯ããªããªã骨ãæããã®ã§ã¯ãªããã¨æãã¾ããã¡ãã£ã¨ããã³ã¼ãã®æ¸ãæ¹ã CDK ã®ã¤ãã£ãªã ããç¥ã£ã¦ããã°ãå°ãªãè¡æ°ã§ãããããã¨ãæçã«è¡¨ç¾ã§ãã CDK ã®ãã¨ããç§ã¯å¥½ãã§ãã
ã人åã§ãæ°ãã¤ããå¿ è¦ã¯ããã¾ãããCDK ã«ä»»ãã¾ãããã
æå¾ã«ãè£è¶³çãªãã¼ããããã¤ãæ·»ãã¾ãã
ãã¾ã(1) - removalPolicy ã®è¨å®ã ãã§ã¯ä¸ååãªãªã½ã¼ã¹ããã
ä¾ãã° ECR ãªãã¸ããªã®å ´åããã§ã«ã¤ã¡ã¼ã¸ã push ããã¦ããå ´åã¯åé¤ããããã¯ããä»æ§ãããã¾ããremovalPolicy ã®è¨å®ã ãã§ã¯ãæå¾ éãã« cdk destroy ããã¹ã¦ãçä»ãã¦ããã¾ããã
ECR Repository ã«é¢ãã¦ã¯ãemptyOnDelete
ã¨ããããããã£ãéããã©ã«ãã® true ã«æå®ããã°è¯ãã§ãããããæå®ããã¨ãpush æ¸ã¿ã®ã¤ã¡ã¼ã¸ãåå¨ããå ´åã§ãå¼·å¶çã«ã¬ãã¸ããªãåé¤ã§ãã¾ãã
class Repository (construct) · AWS CDK
ãããå ã»ã©ã® Aspects ã«çµã¿è¾¼ãã å®è£ ä¾ã¯æ¬¡ã®ããã«ãªãã¾ãã
class EnforceDeletionPolicy implements cdk.IAspect { public visit(node: IConstruct): void { if (node instanceof cdk.CfnResource) { node.applyRemovalPolicy(cdk.RemovalPolicy.DESTROY); } // 追è¨â if (node instanceof CfnRepository) { node.emptyOnDelete = true; } } }
ãªã½ã¼ã¹èªèº«ãã¹ãã¼ããã«ã§ããå ´åã¯ããããåå¥ã®èæ ®ãå¿ è¦ã«ãªãå ´åãããã¾ãã®ã§ã詳ããã¯ããããã® Construct ã¯ã©ã¹ã®ãªãã¡ã¬ã³ã¹ãã確èªãã ããã
ãã¾ã(2) - CDK ã¨ããªãã¼ã·ã§ã³
ãã¨ããªãã¼ã·ã§ã³ã¨ããæè㧠CDK ãèªãã¨ããå½å ã«ã¯ãã§ã«ç´ æ´ãããå é§è ãããã£ããã¾ã*3ããã®æ¹ã AWS ã«å¯ç¨¿ãããè¨äºããã®å ´ã§ãç´¹ä»ãã¾ãã
ãã®è¨äºã§ã¯ãããªãã¼ã·ã§ã³ã¨ããç®çã«å¯¾ã㦠Aspects ãå«ãè¤æ°ã®æ段ã使ãããã¨ãå¦ã¹ã¾ãããCDK ã®æ¨å³ãå¼ãåºãå®è£ ãã«ãå°ãã§ããã°ãã¾ãã¯ãã®è¨äºãè¦ã¦ã¿ã¾ããããããªãã¼ã·ã§ã³ã¯é常ã«å®åçã»å®è·µçãªãããã¯ã§ããããã®ã¡ãªãããããããããã§ããããªãã¼ã·ã§ã³ãå®è£ ã§ããããã«ãªãã¨ãééããªãããªãã® CDK ã©ã¤ãã®è³ªã¯åä¸ãã¾ãã
ãã¾ã(3) - å ±éèªå½ãã¤ãã£ãªã ãå¦ã³ãå©ç¨ããã
æå¾ã«ããå ±éèªå½ãããã¤ãã£ãªã ããå¦ã³ãå ±æããå©ç¨ãããã¨ã«é¢ããæ義ã«ã¤ãã¦ç§è¦ãæ·»ãã¦ç· ãããã¨æãã¾ãã
Visitor ãã¿ã¼ã³ã®åå¨ã CDK Construct tree, Aspects ã®æ¦å¿µãç¥ã£ã¦ããã°ãAspects ãç¨ããå®è£ ãåºç¾ããéã«èªã¿æãæ¨æ¸¬ã§ããæ å ±éã¯æ ¼æ®µã«å¢ãã¾ããConstruct tree ã«å¯¾ãã¦é©ç¨ããããªã«ãããã®å¦çãããããããã¨ããæå³ã¯ä¸ç¬ã§ä¼ããã¾ãããããããé©åãªæ½è±¡åã®åã§ãããèªå½ãè²ã¦ãæ義ã ã¨æãã¾ãã
å ±éèªå½ã使ããã¨ã§ä¸åº¦ã«å ±æã§ããæ å ±éã»ã³ã³ããã¹ããè±ãã«ãªãã°ãçãè¨èã§ããå¤ãã®ãã¨ããããæ£ç¢ºã«èªããããã«ãªãã¾ããå°é家ãé©åãªå ´é¢ã§é©åã«å°éç¨èªãç¨ãããã¨ã§ãç°¡æ½ã«ã»æ£ç¢ºã«ã»æ¬è³ªçãªï¼ããªãã¡å¹ççãªï¼è°è«ãè¡ãã®ã¨åãã§ããæ¥é ã®ã³ãã¥ãã±ã¼ã·ã§ã³ãæ£ç¢ºã§å¹ççã«è¡ããããã¨ã¯ããã¼ã ã®çç£æ§åä¸ã«ç´çµãã¦ãã¾ããé½é½¬ãªãå¹ççã«æ¥ã ã®ã³ãã¥ãã±ã¼ã·ã§ã³ãåãããã¼ã ã¯ãããã ã仮説æ¤è¨¼ã®ãµã¤ã¯ã«ãæ©ããæ·±ãåãã¾ããçµæã¨ãã¦ãæ£ãããã®ãæ£ããä½ã*4ããå§åçã«ãããããã®ã§ãã
ãã¼ã ãã«ãã£ã³ã°ãå¼ãç¶ãã®å ´é¢ã«ããã¦ããããåå¿è ã«ããããããã«ãã¨ãã趣æ¨ã®æè¦ãåºãããã¾ãããã®å¿æ§ãã¯ä¸è¦ç«æ´¾ã«è¦ãã¾ããããã®è£ã§ã¯ä¸è¨ã®ãããªçç£æ§ã¨ã®ãã¬ã¼ããªããé¸æãã¦ããã¨ãè¨ãã¾ãã誰ã«ã§ã...ããããåå¿è ã¬ãã«ã§ãåãããããªèªå½ãã使ããªãï¼ä½¿ããªãç¶æ³ã¯ããã¼ã ã®çç£æ§ã®ä¸éãå¼ãä¸ããå¯è½æ§ãããã®ã§ããåå¿è ã«å¯¾ããã±ã¢ãéè¦ãããå ´é¢ãå½ç¶ã«ããã¨æãã¾ãããããããã®èå¾ã«ãããã¬ã¼ããªããå«ãã¦é¸æããã®ã ã¨ããèªè¦ã¯æã£ã¦ããæ¹ãè¯ãã§ãããã
ã¾ããèªå½ãé©åã«å ±æãããã¨ã§ãã¼ã ã®çç£æ§ãä¸ããã®ã¯ãä½ã CDK ã«éã£ããã¨ã§ã¯ããã¾ããããè¨èã®è§£éãåããªãã£ãããããã¯ä¸ä¸è´ã§ãããã¨ã«æ°ä»ãã¬ã¾ã¾è©±ãé²ãã¦ãã¾ã£ããã¨ã§çããåæ»ãä¸é½åã¯ãèªè ã®ã¿ãªãã¾ãæ°å¤ããçµé¨ããã¦ããã¨æãã¾ãããããã£ã観ç¹ããããé©åãªå ±éèªå½ãã¤ãã£ãªã ãé©åã«å¦ã³ãæ§ç¯ããå ±æãã使ç¨ãããã¨ã«æ義ãããã¨è¨ãã¾ãã
é¡ããã°ãèªãã®å°éæ§ã«ãã£ã¦ä¾¡å¤æä¾ãè¡ãéå£ã«ããã¦ã¯ã誰ããããåç»ã§ããæ·å± ã®ä½ãç°å¢ã®æ´åãããããé«ãè¦æ±æ°´æºã«å°éãããããªãæ¯æ´æ´»åãã«ããå¤ãã®æè³ãããããã®ã§ãããã®è¨äºãæ¸ãç®çã«ã¯ããããæèãå«ã¾ãã¦ãã¾ããæ¬è¨äºã社å çã«ãã社å¤ã® CDK ã¦ã¼ã¶ã¼ã«ã¨ã£ã¦ãããæ £ç¨å¥ããå¦ã¶ä¸å©ã«ãªãã¨å¹¸ãã§ãã
(2024/09/17) 追è¨
AWS ããã®å ¬å¼ããã°ããããé常ã«å®è·µç㪠Aspects ã®å¿ç¨ä¾ã®è¨äºãåºã¦ãã¾ãããã²ãã¡ããåèã«ãã¦ã¿ã¦ãã ããã
*1:GoF ãã¶ã¤ã³ãã¿ã¼ã³ã¯20年以ä¸åã«æå±ãããèãæ¹ã§ãããä»ã§ããªãæç¨ãªãã¿ã¼ã³ãå¤æ°åå¨ãã¾ããVisitor ã¯ãã®ä¸ã¤ã§ããä½è«ã§ãããç§ã¯ Observer ãææ¨ãã§ã
*2:é¦è¨³ç: ãªãã¸ã§ã¯ãæåã«ãããåå©ç¨ã®ããã®ãã¶ã¤ã³ãã¿ã¼ã³ 1999/10/1, Erich Gamma è
*3:ãªããå·çè ã®å¾è¤ããã¯ããªãã¼ã·ã§ã³ãå½å ã«éå®ããã¨ã CDK çéã®ãããã©ã³ãã¼ã§ã
*4:è¨èã®åºå ¸: æ£ãããã®ãæ£ããã¤ããããããã¯ããã¤ããã¨ã¯ã©ããããã¨ãªã®ãããããã¯ã¢ã¸ã£ã¤ã«ã®ãã®å ã«ã¤ã㦠2019/6/14, å¸è°· è¡å è
æ©æ¬ æå¼¥(è¨äºä¸è¦§)
ããã¼ã¸ããµã¼ãã¹é¨
å 製éçºä¸å¿ã«ãã£ã¦ã¾ããæ®æ®µã¯ãµã¼ãã¼ã¬ã¹é¢é£ã CDK ã触ããã¨ãå¤ãã§ã