Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cfn-include): preserve properties of resources that are not in the current CFN schema #11822

Merged
merged 8 commits into from
Dec 4, 2020
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"Resources": {
"Bucket": {
"Type": "AWS::S3::Bucket",
"Properties": {
"PropertyNotInCfnSchema": 1,
"AccelerateConfiguration": {
"AccelerationStatus": "Enabled",
"PropertyNotInCfnSchema": false
},
"CorsConfiguration": {
"CorsRules": [
{
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"origin1"
],
"MaxAge": 5,
"PropertyNotInCfnSchema": "unmodeled property in array"
}
]
}
}
},
"Function": {
"Type": "AWS::Serverless::Function",
"Properties": {
"Handler": "index.handler",
"Runtime": "nodejs12.x",
"CodeUri": {
"Bucket": "bucket",
"Key": "key"
},
"Events": {
"Api": {
"Properties": {
"Method": "GET",
"Path": "/"
},
"Type": "Api",
"PropertyNotInCfnSchema": "unmodeled property in map"
}
}
}
}
},
"Transform": "AWS::Serverless-2016-10-31"
}
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,14 @@ describe('CDK Include', () => {
});
}).toThrow(/Parameter with logical ID 'FakeParameter' was not found in the template/);
});

test('can ingest a template that contains a property not in the current CFN spec, and output it unchanged', () => {
includeTestTemplate(stack, 'properties-not-in-cfn-spec.json');

expect(stack).toMatchTemplate(
loadTestFileToJsObject('properties-not-in-cfn-spec.json'),
);
});
});

interface IncludeTestTemplateProps {
Expand Down
Loading