APIGateway as an domain name of cloudfront origin

i am creating an api gateway in my template :
functions
test:
handler: test.handler
events:
- http:
path: save-subscription
method: post
cors: false

later on i want to use the api address xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/
as a domain name of an oigin of my cloudfront
Origins:

is there a way to reference the api address dynamically?

Thanks

I used the serverless-pseudo-parameters plugin.

Then, I added a CloudFront resource with the following origin:
Origins:
- DomainName:
Fn::Join:
- ‘’
- - !Ref ApiGatewayRestApi
- ‘.execute-api.’
- !Ref AWS::Region
- ‘.amazonaws.com’
OriginPath: /${self:provider.stage}

I hope that helps