Giter Club home page Giter Club logo

Comments (5)

eugene-manuilov avatar eugene-manuilov commented on June 7, 2024 1

Thanks @jonlorusso. I am going to add artifacts section to the cfpack.config.js file where you will be able to define files that need to be uploaded before deploy. It will look like this:

module.exports = {
    entry: "...",
    output: "...",
    verbose: true,
    silent: false,
    stack: {
        name: "...",
        region: "...",
        params: {
            ...
        },
        artifacts: [
            {
                bucket: 'my-bucket',
                files: {
                    'api/schema.graphql': 'local/schema/schema.graphql',
                    'lambdas/first-function.zip': {
                        include: ['*.js', '*.json'],
                        exclude: ['package-lock.json', 'tests/**/*'],
                        path: 'local/files/**/*',
                        compression: 'zip', // zip | tar.gz | none
                    },
                },
            },
        ],
    },
};

Then you will need to update your snippet to be:

  AppSyncSchema:
    Type: "AWS::AppSync::GraphQLSchema"
    Properties:
      DefinitionS3Location: s3://my-bucket/api/schema.graphql
      ApiId: !GetAtt [ AppSyncAPI, ApiId ]

Then when you run cfpack deploy command, it will prepare artifacts and upload it to s3 bucket first, then will trigger CloudFormation stack update. Does it make sense to you?

from cfpack.

eugene-manuilov avatar eugene-manuilov commented on June 7, 2024

Hi @jonlorusso

could you please show me your template? cfpack uses AWS Node.js API, so I am sure that it is possible to upload something to a s3 bucket. Just want to see your template as an example of a use case.

from cfpack.

jonlorusso avatar jonlorusso commented on June 7, 2024

@eugene-manuilov

So here's a snippet:

  AppSyncSchema:
    Type: "AWS::AppSync::GraphQLSchema"
    Properties:
      DefinitionS3Location: schema.graphql
      ApiId: !GetAtt [ AppSyncAPI, ApiId ]

When I run the aws cloudformation package command, the schema.graphql file is uploaded to S3 and the template is modified:

    Properties:
      ApiId:
        Fn::GetAtt:
        - AppSyncAPI
        - ApiId
      DefinitionS3Location: s3://mystackname/db7c9d50e4e8e71d3653438745db5fd8

from cfpack.

eugene-manuilov avatar eugene-manuilov commented on June 7, 2024

Hi @jonlorusso

the new version has been just published. It contains functionality that allows to upload artifacts before updating CloudFormation stack. Please, let me know if it help.

https://github.com/eugene-manuilov/cfpack#artifacts-1

from cfpack.

eugene-manuilov avatar eugene-manuilov commented on June 7, 2024

Closing this task now. Feel free to open a new one if you have anything else.

from cfpack.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.