You will find 1000 samples using:
Resources:
XXXXAPI:
Type: AWS::Serverless::Api
Properties:
DefinitionBody:
Fn::Transform:
Name: AWS::Include
Parameters:
Location: !Sub s3://${BucketName}/openapi.yml
StageName: !Sub ${StageName}
Transform calls a macro AWS::Include
, which will load a file from s3, do template substitution and returns the file as object. I would like to exactly this – but with a local file. AWS::Include
will only accept s3 references – any ideas?
2
Answers
CloudFormation executes on AWS servers and can’t access your local files on your workstation. So no, you can’t use local files in AWS::Include.
Based on AWS documentation, it will support include files only from S3.
If keeping the files in S3 for long term is a problem, then it can expired automatically using S3 configuration.