Skip to content

Commit

Permalink
fix(iotfleetwise): add patch to fix the schema definition of the reso…
Browse files Browse the repository at this point in the history
…urce 'AWS::IoTFleetWise::DecoderManifest'
  • Loading branch information
moelasmar committed Sep 7, 2024
1 parent 4c3b660 commit dfcbf45
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ import './s3';
import './sagemaker';
import './wafv2';
import './securitylake';
import './iotfleetwise';
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);
}),
);

0 comments on commit dfcbf45

Please sign in to comment.