Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
aws-blue-green-toolkit
Advanced tools
Utility functions to help with performing blue/green and canary deployments in AWS infrastructure
Utility functions to help with performing blue/green and canary deployments in AWS infrastructure
AWS support for blue/green and canary deployments is provided by CodeDeploy. CodeDeploy is great in what it does, but it only really manages swapping versions for web services. Any services that sit behind the public facing API don't get managed by the CodeDeploy flow.
A common pattern for blue/green and canary deployments is to not just use a pair of services for the web component, but use a pair of services for the whole pipeline, eg data ingestion, databases, queues, data manipulation lambdas etc. You can manage starting, hydrating, and using these services as part of the CodeDeploy pipeline through the use of hooks (in the form of lambdas). Using these hook lambdas you can manage blue/green or canary deployments of a whole stack of services using the aws-sdk, unfortunately this normally means writing a lot of code to manage the process.
This module is a set of utility functions that I use to reduce the boilerplate required to set up these deploment hook lambdas.
For an example web api, using a node application in docker, with a SQL data store, and data updates being published on an SNS topic, the architecture may looks something like this:
In order to manage blue/green deployments for this service, CodeDeploy will directly handle deploying the new ECS service, attaching target groups to load balancers, flipping traffic over to the new service, and tearing down the old containers.
Unfortunately this really only covers less than half of the architecture. Everything from the data updates topic through to the database is up to you to manage through hooks. When deploying a new version of the service, the steps required will be something like this:
CodeDeploy will carry out steps 6, 7, 9, and 15. This module contains tools to help you perform the other steps from your deployment hook lambda functions.
Enum for describing the state of an RDS cluster
Type: number
Tools for managing pairs of ECS services
Disables an ECS service by setting the desired task count to zero
reference
StackReference The stack to modifyReturns any {Promise}
Enables an ECS service by setting the desired task count to it's normal value
reference
StackReference The stack to modifyReturns any {Promise}
Toolkit for SQS operations
Purges a queue pair (q and dlq) based on config and queue reference
reference
StackReference Reference to a subscription queue stackReturns Promise<void>
src/main/dynamo-tools.ts:14-55
Toolkit for Dynamo operations
src/main/dynamo-tools.ts:35-48
Deletes a dynamo table
reference
StackReference Reference to a active tableReturns Promise<void>
src/main/cloudwatch-tools.ts:16-80
Toolkit for CloudWatch operations
src/main/cloudwatch-tools.ts:36-41
Disable all alarm actions
reference
StackReference Reference to a subscription queue stackReturns Promise<void>
src/main/cloudwatch-tools.ts:49-54
Enable all alarm actions
reference
StackReference Reference to a subscription queue stackReturns Promise<void>
src/main/kinesis-tools.ts:18-91
Toolkit for Kinesis data stream operations
src/main/kinesis-tools.ts:39-46
Deregisters an existing consumer for a Kinesis data stream
reference
StackReference Reference to an active stackReturns Promise<void>
src/main/kinesis-tools.ts:55-64
Describes a consumer for a Kinesis data stream
reference
StackReference Reference to an active stackReturns Promise<DescribeStreamConsumerOutput>
src/main/kinesis-tools.ts:73-82
Registers a new consumer for a Kinesis data stream
reference
StackReference Reference to an active stackReturns Promise<RegisterStreamConsumerOutput>
Enum for referencing blue or green stacks
Type: number
src/main/aurora-tools.ts:32-374
Toolkit for Aurora operations
src/main/aurora-tools.ts:58-76
Gets the current state of one of the Aurora clusters
reference
StackReference Reference to a db clusterReturns Promise<ClusterState>
src/main/aurora-tools.ts:85-87
Reverts a cluster's minimum reader count to the configured minimum
reference
StackReference Reference to a db clusterReturns Promise<void>
src/main/aurora-tools.ts:96-101
Scales out a cluster to match it's partner's size
reference
StackReference Reference to a db clusterReturns Promise<void>
src/main/aurora-tools.ts:110-120
Get a count of the number of active readers for a cluster
reference
StackReference Reference to a db clusterReturns Promise<number> The number of active readers
src/main/aurora-tools.ts:129-132
Starts a stopped db cluster
reference
StackReference Reference to a db clusterReturns Promise<void>
src/main/aurora-tools.ts:141-144
Stops a running db cluster
reference
StackReference Reference to a db clusterReturns Promise<void>
src/main/aurora-tools.ts:153-185
Deletes a running db cluster
reference
StackReference Reference to a db clusterReturns Promise<void>
src/main/aurora-tools.ts:195-235
Parses a message from an rds event subscription, if the event was triggered by a scale out operation, the tags defined in config are applied to the newly created reader.
record
SNSEventRecord An SNS event record of the type published by rds event streamsReturns Promise<void>
src/main/aurora-tools.ts:249-300
Parses a message from an rds event subscription, if the event was triggered by a scale out operation and the new instance does not have performance insights enabled, the instance is updated to enable performance insights.
record
SNSEventRecord An SNS event record of the type published by rds event streamsreEnableIfDisabled
boolean Whether or not to automatically re enable insights if they are disabled (optional, default true
)retryDelay
number Time in ms to wait before retrying (optional, default 60e3
)retryAttempts
number Number of retry attempts (optional, default 5
)Returns any {Promise}
src/main/lambda-tools.ts:38-345
Toolkit for Lambda operations
src/main/lambda-tools.ts:68-83
Creates a lambda's event source mapping (eg, a Kinesis stream)
reference
StackReference Reference to a lambda stackeventSourceArn
string The ARN of the event sourcesourceSpecificParameters
Omit<CreateEventSourceMappingRequest, ("FunctionName"
| "EventSourceArn"
)> (optional, default {}
)sourceSpecificParams
(Omit<CreateEventSourceMappingRequest, ("FunctionName"
| "EventSourceArn"
)>) Any params specific to the event source (optional, default {}
)Returns any {Promise}
src/main/lambda-tools.ts:94-96
Deletes a lambda's event mapping (eg, a Kinesis stream)
You may use the listEventSourceMappings
method if you
need to retrieve UUIDs of the function event sources
UUID
StackReference The identifier of the event source mappingReturns Promise<void>
src/main/lambda-tools.ts:105-107
Disables a lambda's event mappings (eg, an SQS subscription)
reference
StackReference Reference to a lambda stackReturns Promise<void>
src/main/lambda-tools.ts:116-118
Disables a lambda's cloudwatch events rule (ie, cron trigger)
reference
StackReference Reference to a lambda stackReturns Promise<void>
src/main/lambda-tools.ts:127-129
Enables a lambda's event mappings (eg, an SQS subscription)
reference
StackReference Reference to a lambda stackReturns Promise<void>
src/main/lambda-tools.ts:138-140
Enables a lambda's cloudwatch events rule (ie, cron trigger)
reference
StackReference Reference to a lambda stackReturns Promise<void>
src/main/lambda-tools.ts:150-156
Returns details about a Lambda function alias.
reference
StackReference Reference to a lambda stackName
string The name of the alias to return data aboutReturns Promise<AliasConfiguration>
src/main/lambda-tools.ts:165-237
Returns the latest metrics about a Lambda function alias.
reference
StackReference Reference to a lambda stackReturns Promise<LatestLambdaMetricsMap>
src/main/lambda-tools.ts:246-254
Gets the currently running version of a lambda fn
reference
StackReference Reference to a lambda stackReturns Promise<string> The lambda version
src/main/lambda-tools.ts:263-282
Lists all event source mappings for the referenced function
reference
StackReference -- Reference to a lambda stackReturns any {Promise<EventSourceMappingConfiguration[]>}
Toolkit for SNS operations
Disables an SNS subscription
reference
StackReference Reference to a subscription queue stackReturns Promise<void>
Enables an SNS subscription
reference
StackReference Reference to a subscription queue stackReturns Promise<void>
FAQs
Utility functions to help with performing blue/green and canary deployments in AWS infrastructure
The npm package aws-blue-green-toolkit receives a total of 53 weekly downloads. As such, aws-blue-green-toolkit popularity was classified as not popular.
We found that aws-blue-green-toolkit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.