Skip to content

Commit

Permalink
doc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
gojko committed Dec 21, 2016
1 parent b98ef44 commit fc886ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
7 changes: 5 additions & 2 deletions docs/create.md
Expand Up @@ -64,9 +64,12 @@ claudia create {OPTIONS}
* `--aws-retries`: _optional_ number of times to retry AWS operations if they fail
* _For example_: 15
* _Defaults to_: 15
* `--security-group-ids`: _optional_ comma-separated list of security group ids if you would like the function to have VPC access. If you would like VPC access at least one security group and one subnet belonging to the same VPC must be submitted.
* `--security-group-ids`: _optional_ A comma-delimited list of AWS VPC Security Group IDs, which the function will be able to access.
Note: these security groups need to be part of the same VPC as the subnets provided with --subnet-ids.
* _For example_: sg-1234abcd
* `--subnet-ids`: _optional_ comma-separated list of subnet ids if you would like the function to have VPC access. If you would like VPC access at least one security group and one subnet belonging to the same VPC must be submitted.
* `--subnet-ids`: _optional_ A comma-delimited list of AWS VPC Subnet IDs, which this function should be able to access.
At least one subnet is required if you are using VPC access.
Note: these subnets need to be part of the same VPC as the security groups provided with --security-group-ids.
* _For example_: subnet-1234abcd,subnet-abcd4567
* `--set-env`: _optional_ comma-separated list of VAR=VALUE environment variables to set
* _For example_: S3BUCKET=testbucket,SNSQUEUE=testqueue
Expand Down
20 changes: 9 additions & 11 deletions src/commands/create.js
Expand Up @@ -68,10 +68,10 @@ module.exports = function create(options, optionalLogger) {
return 'deploy-proxy-api requires a handler. please specify with --handler';
}
if (!options['security-group-ids'] && options['subnet-ids']) {
return 'VPC access requires at lease one security group id *and* one subnet id';
return 'VPC access requires at least one security group id *and* one subnet id';
}
if (options['security-group-ids'] && !options['subnet-ids']) {
return 'VPC access requires at lease one security group id *and* one subnet id';
return 'VPC access requires at least one security group id *and* one subnet id';
}
if (options.handler && options.handler.indexOf('.') < 0) {
return 'Lambda handler function not specified. Please specify with --handler module.function';
Expand Down Expand Up @@ -146,9 +146,9 @@ module.exports = function create(options, optionalLogger) {
Role: roleArn,
Runtime: options.runtime || 'nodejs4.3',
Publish: true,
VpcConfig: {
SecurityGroupIds: (options['security-group-ids'] && options['security-group-ids'].split(',')) || [],
SubnetIds: (options['subnet-ids'] && options['subnet-ids'].split(',')) || []
VpcConfig: options['security-group-ids'] && options['subnet-ids'] && {
SecurityGroupIds: (options['security-group-ids'] && options['security-group-ids'].split(',')),
SubnetIds: (options['subnet-ids'] && options['subnet-ids'].split(','))
}
}).promise();
},
Expand Down Expand Up @@ -575,18 +575,16 @@ module.exports.doc = {
argument: 'security-group-ids',
optional: true,
example: 'sg-1234abcd',
description: 'A comma-delimited list of AWS security group ids belonging to the VPC this function should access.\n' +
'Note: these security groups need to be part of the same VPC as the subnets you provide.',
default: '15'
description: 'A comma-delimited list of AWS VPC Security Group IDs, which the function will be able to access.\n' +
'Note: these security groups need to be part of the same VPC as the subnets provided with --subnet-ids.'
},
{
argument: 'subnet-ids',
optional: true,
example: 'subnet-1234abcd,subnet-abcd4567',
description: 'A comma-delimited list of AWS subnet ids belonging to the VPC this function should access.\n' +
description: 'A comma-delimited list of AWS VPC Subnet IDs, which this function should be able to access.\n' +
'At least one subnet is required if you are using VPC access.\n' +
'Note: these subnets need to be part of the same VPC as the security groups you provide.',
default: '15'
'Note: these subnets need to be part of the same VPC as the security groups provided with --security-group-ids.'
},
{
argument: 'set-env',
Expand Down

0 comments on commit fc886ee

Please sign in to comment.