Comments (13)
@eahefnawy @pmuens The use case here is the creation of per-alias resources (defined by the user). This would automatically rename the logical resource ids to include the alias name (see my example in the README). This feature is very interesting for feature development, where one would add an per-alias resource, to make sure that every other developer would have it's own instance of the resource when he deploys to his alias. I will have a look at the feature issue in Serverless and check if I can do anything there.
from serverless-aws-alias.
Ok. I'll check. Maybe the provider variable git broken with another fix.
from serverless-aws-alias.
I tested the behavior and committed a fix into a separate branch. The table name (and other properties) are now substituted correctly (e.g. TableName: ${self:provider.alias}
.
Nevertheless the resource name (myKinesis${self:provider.alias}
) does not get replaced correctly. This seems to be a bug (maybe missing feature) in the Serverless framework. IMO it would be correct if Serverless would apply the variable substitution not only to variable values, but also to resource names.
/cc @pmuens @eahefnawy
from serverless-aws-alias.
@HyperBrain by resource names, you mean the logical IDs? That's interesting, but it's something that we've explicitly ignored for now. If you see a strong use case for that could you open an issue about it?
From the docs:
Note: You can only use variables in serverless.yml property values, not property keys. So you can't use variables to generate dynamic logical IDs in the custom resources section for example.Note: You can only use variables in serverless.yml property values, not property keys. So you can't use variables to generate dynamic logical IDs in the custom resources section for example.
from serverless-aws-alias.
Yes, currently we don't have support to use variables in keys (as @eahefnawy mentioned).
Here's the issue where we track this feature: serverless/serverless#2892
Could be an interesting addition though!
from serverless-aws-alias.
hmmm actually if I remember correctly we've ignored it because its not supported by the traverse module we were using back then, but now we ditched and might work out!
from serverless-aws-alias.
I merged the fix for the property values part. The issue will be kept open until the property based variable substitution has been added to the Serverless framework.
In the mean-time I will change the README and add a not that the example is currently not functional with a reference to this issue.
from serverless-aws-alias.
I merged the fix for the property values part. The issue will be kept open until the property based variable substitution has been added to the Serverless framework.
In the mean-time I will change the README and add a not that the example is currently not functional with a reference to this issue.
Sounds good. Thanks for the update on this one @HyperBrain 👍
For everyone reading through this: The Framework issue can be found here.
from serverless-aws-alias.
An alternative here would be that we create a new configuration section in serverless.yml
named aliasResources
with the same layout as the resources
property. The difference would be that all resources defined in there will be deployed per alias.
This would also allow to reference these resources in the same way as the standard CF resources (e.g. function event subscriptions, environment variables, etc.)
from serverless-aws-alias.
Any ideas on how to best solve this? I'm trying to get this plugin to work with serverless-nextjs-plugin
but getting resource id conflicts when I try to deploy a second alias.
from serverless-aws-alias.
You have two ways (as I know) to define per alias resources:
- You can have separate configurations (per alias). Use --config option, it's a new feature serverless/serverless#6216
- Use
serverless-plugin-ifelse
plugin.
from serverless-aws-alias.
@Enase Thanks, but some of the resources are generated by another plugin, so I don't have control over their resource ids.
from serverless-aws-alias.
all the plugins generate resources based on some parameters, you can manage it I believe
from serverless-aws-alias.
Related Issues (20)
- [/Resources/TOPIC_NAME/DependsOn/0] 'null' values are not allowed in templates
- TypeError : Cannot read property "Properties" of undefined HOT 4
- Log to CloudWatch Logs: LogGroup name not reflecting Alias HOT 1
- ServerlessError: Export 'project-name-ServerlessAliasReference' does not exist. HOT 19
- aliasStage (throttlingRateLimit, throttlingBurstLimit) setting has no effect HOT 1
- Domain manager support is not working since serverless-domain-manager 3.1.0-beta.0
- No alias is created when the serverless-plugin-split-stacks plugin is also used HOT 2
- When using an existing API Gateway, the APIs created are not pointing to the alias
- Deploy region china HOT 2
- Invalid tag when deploying masterAlias HOT 4
- Alias not applied to event bridge events
- Error: The API doesn't include a resource HOT 5
- Is there any way that we can seperate the stage name and alias name. HOT 1
- How to spec alias name on yml file
- Build fails: Export 'projectName-stageName-ServerlessAliasReference' does not exist HOT 11
- Serverless command "alias remove" not found
- TypeError: this.aliasStackGetAliasStackNames(...).mapSeries is not a function HOT 1
- Deploy produces an error: cannot find module '../lib/plugins/aws/lib/monitorStack' HOT 6
- npm serverless-aws-alias-v3 issue - Not attaching all used dependencies in build
- Is there a plan to support alias traffic weighting feature?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverless-aws-alias.