I have the below cdk in python for building my API
domain_name = _apigateway.DomainNameOptions(
certificate=certificate,
domain_name=custom_domain_name,
mtls={
"bucket": _s3.Bucket.from_bucket_arn(self, 'BucketByArn', mtls_bucket_arn),
"key": mtls_bucket_key
},
security_policy=_apigateway.SecurityPolicy("TLS_1_2")
)
api_01 = _apigateway.LambdaRestApi(
self,
api_id,
rest_api_name=rest_api_name,
domain_name=domain_name,
handler=measurements_fn,
deploy_options=_apigateway.StageOptions(stage_name=stage),
proxy=False
)
api_01.node.default_child.add_property_override(
"DisableExecuteApiEndpoint",
"true"
)
with 2 endpoints attached to the api and i would like to create an API Mapping. Based on the documentation i see that i should use _apigatewayv2.ApiMapping
_apigatewayv2.ApiMapping(
self,
id='someId',
api=api_01,
api_mapping_key='api/1.0',
domain_name=domain_name
)
but the domain_name option fails due to
Expected object reference, got {"$jsii.struct":{"fqn":"@aws-cdk/aws-apigateway.DomainNameOptions"
The case is that i need the DomainNameOptions because i'm using LambdaRestApi which based on the documentation expects such an object.
Any idea on how to implement API Mapping for my case?