- You can run the lambda function locally
- Don’t impact your team by sharing the same env ( update on the same buckets, same records )
- Debug & Speed up your working
- Don’t need to worry about paying for AWS usage for stupid action 🥰
The cdk.json
file tells the CDK Toolkit how to execute your app.
yarn build
compile typescript to jsyarn lint
check code styleyarn destroy
destroy the current stackyarn deploy
deploy this stack to your default AWS account/regionyarn bootstrap
clean up env
- Install Docker if you haven’t already. https://docs.docker.com/get-docker/
- Install AWS CLI. While we won’t be working with “real” AWS we will be using it to communicate with our local docker containers. https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html
Avoid the mistake when we use cdk
command maybe it can impact to real environment
This lib provides a thin wrapper script cdklocal for using the AWS CDK library against local APIs provided by LocalStack.
Refer : https://github.com/localstack/aws-cdk-local
npm install -g aws-cdk-local aws-cdk
Or yarn
yarn global add aws-cdk-local aws-cdk
$ cdklocal --version 1.65.5
Step 1. init create a fake aws credentials - use for our localstack as below ( This is required for our localstack )
cat ~/.aws/credentials
[default]
aws_access_key_id = test
aws_secret_access_key = test
region = us-west-2
output = json
{
"services": {
"dynamodbstreams": "running",
"firehose": "running",
"kinesis": "running",
"s3": "running",
"ses": "running",
"sns": "running",
"sqs": "running",
"dynamodb": "running"
}, "features": {"persistence": "initialized", "initScripts": "initialized"}
}
# telnet the to port 11211
telnet localhost 11211
# Add a new key to memcache
set Customer_Id 0 900 5
# Type your value ( Enter - A message STORED will be displayed)
00-000-000
STORED
# Recheck by get your key stored
get Customer_Id
00-000-000
# exit telnet
quit
Install Redis Client ( Add connection )
Download latest https://github.com/qishibo/AnotherRedisDesktopManager/releases package from https://github.com/qishibo/AnotherRedisDesktopManager/releases [or gitee in China], double click to install.
Or by winget: winget install qishibo.AnotherRedisDesktopManager
Download latest https://github.com/qishibo/AnotherRedisDesktopManager/releases package from release [or gitee in China], double click to install.
Or by brew: brew install --cask another-redis-desktop-manager
yarn deploy
IAM Statement Changes ...
┌───┬───────────────────────┬────────┬─────────────────┬───────────────────────────┬───────────────────────────────────────────────────────┐
│ │ Resource │ Effect │ Action │ Principal │ Condition │
├───┼───────────────────────┼────────┼─────────────────┼───────────────────────────┼───────────────────────────────────────────────────────┤
│ + │ ${SampleAppQueue.Arn} │ Allow │ sqs:SendMessage │ Service:sns.amazonaws.com │ "ArnEquals": { │
│ │ │ │ │ │ "aws:SourceArn": "${SampleAppTopic}" │
│ │ │ │ │ │ } │
└───┴───────────────────────┴────────┴─────────────────┴───────────────────────────┴───────────────────────────────────────────────────────┘
(NOTE: There may be security-related changes not in this list. See https://github.com/aws/aws-cdk/issues/1299)
Do you wish to deploy these changes (y/n)?
#### Type `y` and see our stack
ApplicationStack: deploying...
ApplicationStack: creating CloudFormation changeset...
✅ ApplicationStack
Stack ARN:
arn:aws:cloudformation:us-west-2:000000000000:stack/ApplicationStack/e67d04e2
aws --endpoint-url=http://localhost:4566 dynamodb list-tables
{
"TableNames": [
"test-development"
]
}
aws --endpoint-url=http://localhost:4566 dynamodb describe-table --table-name test-development
Tool | Description |
---|---|
S3 Viewer (MAC & Win) https://cyberduck.io/ |
![]() |
DynamoDB Viewer (MAC & Win) https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/workbench.settingup.html |
![]() |
SQS Sender https://github.com/kobee-tech-stack/sqs-viewer |
|
Redis Viewer (MAC & Win) https://github.com/qishibo/AnotherRedisDesktopManager |
... |