A GruCloud module to create an AWS VPC suitable for EKS
npm install @grucloud/module-aws-vpcThe AWS VPC Grucloud module creates a base set of EC2 resources to be used by an EKS cluster.
Once again, a picture is worth a thousands words. This module packs and configures all these resources ready to be consumed by your application.
Below is the list of the resources involved as well a link towards their documentations:
- Vpc
- Subnet
- SecurityGroup
- Elastic IP Address
- Internet Gateway
- Nat Gateway
- Route Table
- Route
All these resources are just the foundation to build real world applications on top of it, for instance a Kubernetes cluster
Follow this simple 4 steps to use this module in your GruCloud project:
Install the @grucloud/module-aws-vpc module with _npm_:
``sh`
npm install @grucloud/module-aws-vpc
In your _iac.js_, import the module:
`js`
const ModuleAwsVpc = require("@grucloud/module-aws-vpc");
In your _createStack_, provides the config to the AWS provider through the _configs_ array:
`js`
const provider = AwsProvider({ configs: [config, ModuleAwsVpc.config] });
Create the resources:
`js`
const vpcResources = await ModuleAwsVpc.createResources({
provider,
});
That's it, as simple as that.
Refer to the example for the complete code.
The Javascript describing this module is implemented in iac.js, which exports:
- _createResources_: creates the resources for this provider.
- config.js: the default configuration
Refer to the example which shows off the usage of this module.
This module can be tested with the npm test` command. It executes the mocha test suite in the _test_ directory.