-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(iotfleetwise): add patch to fix the schema definition of the reso…
…urce 'AWS::IoTFleetWise::DecoderManifest'
- Loading branch information
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,4 @@ import './s3'; | |
import './sagemaker'; | ||
import './wafv2'; | ||
import './securitylake'; | ||
import './iotfleetwise'; |
56 changes: 56 additions & 0 deletions
56
packages/@aws-cdk/aws-service-spec/build/patches/service-patches/iotfleetwise.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { forResource, registerServicePatches, replaceResourceProperty } from './core'; | ||
import { patching } from '@aws-cdk/service-spec-importers'; | ||
|
||
/** | ||
* Fix the AWS::IoTFleetWise::DecoderManifest schema. The uploaded schema does not match the CFN docs | ||
* where property NetworkInterfaces definition refers to the non-exist CustomDecodingNetworkInterface type | ||
* and property SignalDecoders definition refers to the non-exist CustomDecodingSignalDecoder type. | ||
* This patch should be removed once the schema got updated. | ||
*/ | ||
registerServicePatches( | ||
forResource('AWS::IoTFleetWise::DecoderManifest', (lens) => { | ||
replaceResourceProperty( | ||
'SignalDecoders', | ||
{ | ||
type: 'array', | ||
minItems: 1, | ||
maxItems: 500, | ||
insertionOrder: false, | ||
items: { | ||
oneOf: [ | ||
{ | ||
$ref: '#/definitions/CanSignalDecoder', | ||
}, | ||
{ | ||
$ref: '#/definitions/ObdSignalDecoder', | ||
}, | ||
], | ||
}, | ||
}, | ||
patching.Reason.sourceIssue('Remove the wrong reference to the existing definition CustomDecodingSignalDecoder'), | ||
)(lens); | ||
|
||
replaceResourceProperty( | ||
'NetworkInterfaces', | ||
{ | ||
type: 'array', | ||
minItems: 1, | ||
maxItems: 500, | ||
insertionOrder: false, | ||
items: { | ||
oneOf: [ | ||
{ | ||
$ref: '#/definitions/CanNetworkInterface', | ||
}, | ||
{ | ||
$ref: '#/definitions/ObdNetworkInterface', | ||
}, | ||
], | ||
}, | ||
}, | ||
patching.Reason.sourceIssue( | ||
'Remove the wrong reference to the existing definition CustomDecodingNetworkInterface', | ||
), | ||
)(lens); | ||
}), | ||
); |