Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve CloudFormation functions for invoke local #6680

Open
Ryanauger95 opened this issue Sep 12, 2019 · 2 comments
Open

Resolve CloudFormation functions for invoke local #6680

Ryanauger95 opened this issue Sep 12, 2019 · 2 comments

Comments

@Ryanauger95
Copy link

Right now, If I have a variable definition:

TOPIC_ARN:
    Fn::Join:
    - ""
    - - "arn:aws:sns:"
      - ${self:provider.environment.DEPLOY_REGION}"
      - ":"
      - Ref: "AWS::AccountId"
      - ":"
      - ${self:custom.TOPIC

It won't run Fn::Join locally. The entire output just becomes a string:
console.log(TOPIC_ARN): “{ ‘Fn::Join’: [ ‘’, [Array] ] } }”

Is there any way/what should we do about this when testing locally?

@Wintereise
Copy link

Is there any way/what should we do about this when testing locally?

We've been namespacing it under custom.

 custom:
   innerAWSSNSPlatformApplicationArn:
        local: arn:aws:sns:${self:provider.region}:${self:custom.awsAccountId}:app/GCM/${self:service}-staging-push-sns
        dev: arn:aws:sns:${self:provider.region}:${self:custom.awsAccountId}:app/GCM/${self:service}-${self:provider.stage}-push-sns
        staging: arn:aws:sns:${self:provider.region}:${self:custom.awsAccountId}:app/GCM/${self:service}-${self:provider.stage}-push-sns
        prod: arn:aws:sns:${self:provider.region}:${self:custom.awsAccountId}:app/GCM/${self:service}-${self:provider.stage}-push-sns

Then, where you actually use it, you could go ${self:custom.<key>.<stage>, the trick would be to hardcode it for local.

Only a workaround, but has served us well so far.

@Wintereise
Copy link

Another more elegant way is https://github.com/jeremydaly/serverless-cloudside-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants