Bug
The Distribution construct accepts functionAssociations in BehaviorOptions but does not render them to the Terraform JSON output. The property is silently ignored.
Expected behavior
CloudFront Function associations defined via:
defaultBehavior: {
functionAssociations: [{
function: myFunction,
eventType: FunctionEventType.VIEWER_REQUEST,
}],
}
should produce a function_association block in the synthesized aws_cloudfront_distribution resource.
Actual behavior
The function_association block is missing from the synthesized cdk.tf.json. The _renderDefaultCacheBehavior() method in distribution.js (lines 159-184) does not map functionAssociations to the provider output.
Workaround
(distribution as any).resource.addOverride("default_cache_behavior.function_association", [
{
event_type: "viewer-request",
function_arn: directoryIndexFunction.functionArn,
},
]);
Version
terraconstructs 0.2.3
@cdktf/provider-aws latest
Bug
The
Distributionconstruct acceptsfunctionAssociationsinBehaviorOptionsbut does not render them to the Terraform JSON output. The property is silently ignored.Expected behavior
CloudFront Function associations defined via:
should produce a
function_associationblock in the synthesizedaws_cloudfront_distributionresource.Actual behavior
The
function_associationblock is missing from the synthesizedcdk.tf.json. The_renderDefaultCacheBehavior()method indistribution.js(lines 159-184) does not mapfunctionAssociationsto the provider output.Workaround
Version
terraconstructs0.2.3@cdktf/provider-awslatest