-
-
Notifications
You must be signed in to change notification settings - Fork 35
Conversation
to avoid making unsupported subnet group in specific region
This looks great. Can you add a test for it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few minor comments and then add some tests and this looks good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for your advice and please wait for the test code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jplock I added test code please check this out.
const expected = getSubnetGroupsOptions.reduce((acc, key) => Object.assign(acc, subnetGroupList[key]), {}) | ||
const actual = buildSubnetGroups(2, getSubnetGroupsOptions) | ||
expect(actual).toEqual(expected); | ||
expect.assertions(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this code is unnecessary because no asynchronous code is here. but I just put it on your style :)
src/subnet_groups.js
Outdated
} | ||
if (subnetGroups.length > 0) { | ||
return subnetGroups.reduce(function(acc, service) { | ||
let builtSubnetGroup = subnetGroupList[service.toLowerCase()](numZones); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a check here to ensure service is a valid key in subnetGroupList before trying to call it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it in src/index.js
.
I think this is unavoidable to input validation logic into src/index.js
.
because I don't want to get dirty importing serverless.classes.Error
object on src/subnet_groups.js
Hi.
I really appreciated to create this plugin. This is really nice~!
so I decided to use this plugin every project since now, but I faced some problem.
I work on
Seoul
region(ap-northeast-2).DAX
is not available in my regionso I added the option named
subnetGroup
.subnetGroup can pick subnet groups which user want to create.
Adding this options, I could avoid the error this plugin tried to make DAX Subnet group.
please consider to be merged.
Thank you~!