Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/aws/aws-cdk into feat-add-a…
Browse files Browse the repository at this point in the history
…vailability-zone-distribution
  • Loading branch information
ren-yamanashi committed Nov 12, 2024
2 parents b51ccc3 + 338d4c2 commit 39f4400
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
25 changes: 24 additions & 1 deletion packages/aws-cdk/lib/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CliConfig, DynamicValue } from '@aws-cdk/yargs-gen';
import type { CliConfig, DynamicResult } from '@aws-cdk/yargs-gen';
import { StackActivityProgress } from './api/util/cloudformation/stack-activity-monitor';
import { RequireApproval } from './diff';

Expand Down Expand Up @@ -417,3 +417,26 @@ export function makeConfig(): CliConfig {
},
};
}

/**
* Informs the code library, `@aws-cdk/yargs-gen`, that
* this value references an entity not defined in this configuration file.
*/
export class DynamicValue {
/**
* Instructs `yargs-gen` to retrieve this value from the parameter with passed name.
*/
public static fromParameter(parameterName: string): DynamicResult {
return {
dynamicType: 'parameter',
dynamicValue: parameterName,
};
}

public static fromInline(f: () => any): DynamicResult {
return {
dynamicType: 'function',
dynamicValue: f,
};
}
}
2 changes: 1 addition & 1 deletion packages/aws-cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"devDependencies": {
"@aws-cdk/cdk-build-tools": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@aws-cdk/yargs-gen": "0.0.0",
"@octokit/rest": "^18.12.0",
"@types/archiver": "^5.3.4",
"@types/fs-extra": "^9.0.13",
Expand Down Expand Up @@ -105,7 +106,6 @@
"@aws-cdk/cloudformation-diff": "0.0.0",
"@aws-cdk/cx-api": "0.0.0",
"@aws-cdk/region-info": "0.0.0",
"@aws-cdk/yargs-gen": "0.0.0",
"@aws-sdk/client-appsync": "3.632.0",
"@aws-sdk/client-cloudformation": "3.632.0",
"@aws-sdk/client-cloudwatch-logs": "3.632.0",
Expand Down
23 changes: 0 additions & 23 deletions tools/@aws-cdk/yargs-gen/lib/yargs-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,3 @@ export interface DynamicResult {
dynamicType: 'parameter' | 'function';
dynamicValue: string | (() => any);
}

/**
* Informs the code library, `@aws-cdk/yargs-gen`, that
* this value references an entity not defined in this configuration file.
*/
export class DynamicValue {
/**
* Instructs `yargs-gen` to retrieve this value from the parameter with passed name.
*/
public static fromParameter(parameterName: string): DynamicResult {
return {
dynamicType: 'parameter',
dynamicValue: parameterName,
};
}

public static fromInline(f: () => any): DynamicResult {
return {
dynamicType: 'function',
dynamicValue: f,
};
}
}

0 comments on commit 39f4400

Please sign in to comment.