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

Support for CloudFormation Condition #28

Open
iDVB opened this issue Nov 9, 2018 · 4 comments
Open

Support for CloudFormation Condition #28

iDVB opened this issue Nov 9, 2018 · 4 comments

Comments

@iDVB
Copy link
Contributor

iDVB commented Nov 9, 2018

Any change we can add support for CFN condition?
Something like...

lambdaAtEdge:
  - distribution: WebsiteDistribution
    eventType: origin-response
    condition: isDev
...
Conditions:
    isDev: {"Fn::Equals" : ["${self:custom.vars.STAGE}", "dev"]}

so that when the function is created it will place that condition on the Association and the function itself.

I'm happy to put a PR in if that sounds good.

@jthomerson
Copy link
Member

Hmmm. I struggle to see why someone would want to deploy one stage differently - especially without the function or its association - than other stages. But, that's probably my OCD - I want absolute parity between dev, qa, prd. I'd like to hear more about your usecase.

All that said, I'm not fundamentally against adding this support if you wanted to submit a PR and have some easy-to-understand usecase. In your PR don't forget to update the docs (README) accordingly.

@iDVB
Copy link
Contributor Author

iDVB commented Nov 9, 2018

@jthomerson Well the question is larger. Why would anyone want to use CFN conditions at all?
The reason we use them is to do things like

  • Add a WAF to the CDN in dev only
  • Not add a Lambda@Edge for dev (since dev doesn't even use a CDN)

Some of our applications are 99% frontend JS, HTML, CSS hosted statically. so 99% of what needs to be tested is the visual site itself. We sometimes use a CDN in prod for these to handle the URL rewrites for the routes.

Since provisioning a CDN takes 30mins+ we decided to go with Speed over Parity. We can deploy a site without a CDN in 2mins. This makes deploying feat-* branch tests VERY fast.

The parity comes later in the pipe before prod.

@jthomerson
Copy link
Member

Thanks for the clear explanation. Looking forward to the PR

@tibraga
Copy link

tibraga commented May 30, 2021

Any news?

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

No branches or pull requests

3 participants