Skip to content

Commit dfc31fd

Browse files
committed
update Spec2Cdk to skip some services
1 parent c8945c4 commit dfc31fd

File tree

6 files changed

+9
-13
lines changed

6 files changed

+9
-13
lines changed

packages/aws-cdk-lib/custom-resources/lib/helpers-internal/sdk-v2-to-v3.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@
5757
"forecastqueryservice": "forecastquery",
5858
"forecastservice": "forecast",
5959
"globalaccelerator": "global-accelerator",
60-
"iot1clickdevicesservice": "iot-1click-devices-service",
61-
"iot1clickprojects": "iot-1click-projects",
6260
"iotevents": "iot-events",
6361
"ioteventsdata": "iot-events-data",
6462
"iotjobsdataplane": "iot-jobs-data-plane",

packages/aws-cdk-lib/custom-resources/lib/helpers-internal/sdk-v3-metadata.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,6 @@
492492
"internetmonitor": {
493493
"iamPrefix": "internetmonitor"
494494
},
495-
"iot-1click-devices-service": {
496-
"iamPrefix": "iot1click"
497-
},
498-
"iot-1click-projects": {
499-
"iamPrefix": "iot1click"
500-
},
501495
"iot-data-plane": {
502496
"iamPrefix": "iotdata"
503497
},

packages/aws-cdk-lib/scripts/gen.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ async function main() {
2020
const generated = (await generateAll(awsCdkLibDir, {
2121
coreImport: '../../core',
2222
cloudwatchImport: '../../aws-cloudwatch',
23+
skippedServices: ['AWS::IoT1Click'],
2324
scopeMapPath,
2425
}));
2526

packages/aws-cdk-lib/scripts/scope-map.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,9 +359,6 @@
359359
"aws-iot": [
360360
"AWS::IoT"
361361
],
362-
"aws-iot1click": [
363-
"AWS::IoT1Click"
364-
],
365362
"aws-iotanalytics": [
366363
"AWS::IoTAnalytics"
367364
],

tools/@aws-cdk/spec2cdk/lib/cfn2ts/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@ function computeSuffix(scope: string, allScopes: string[]): string | undefined {
107107
*/
108108
export async function generateAll(
109109
outPath: string,
110-
{ scopeMapPath, ...options }: GenerateAllOptions,
110+
{ scopeMapPath, skippedServices, ...options }: GenerateAllOptions,
111111
): Promise<ModuleMap> {
112-
const scopes = await getAllScopes('cloudFormationNamespace');
112+
const allScopes = await getAllScopes('cloudFormationNamespace');
113+
const scopes = skippedServices? allScopes.filter((scope) => !skippedServices.includes(scope)) : allScopes;
113114
const moduleMap = await readScopeMap(scopeMapPath);
114115

115116
// Make sure all scopes have their own dedicated package/namespace.

tools/@aws-cdk/spec2cdk/lib/cfn2ts/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ export interface GenerateAllOptions extends CodeGeneratorOptions, AugmentationsG
2828
* Path of the file containing the map of module names to their CFN Scopes
2929
*/
3030
scopeMapPath: string;
31+
32+
/**
33+
* List of service names to be skipped it will be in format AWS::Service like AWS::S3
34+
*/
35+
skippedServices?: string[];
3136
}
3237

3338
/**

0 commit comments

Comments
 (0)