skip to Main Content

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


  1. 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.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search