简体   繁体   中英

How to set up local AWS Secrets Manager Docker container for local testing purposes?

I'm looking to set up a local Docker instance of AWS Secrets Manager.

I've been scouring the web for an image or anything of the sort that I can use. I can only find documentation for AWS ECS secrets management.

Does anyone have any experience with setting up AWS Secrets Manager for local testing through Docker? Thanks!

Good question!
You could run localstack [1] inside a docker container. It mocks some of the AWS services for testing purposes. AWS Secrets Manager is supported at http://localhost:4584 by default.
There are some useful blog posts covering localstack. [2][3]

However, I could not find any blog post covering AWS Secrets Manager on localstack. I guess you have to try it out yourself.

References

[1] https://github.com/localstack/localstack
[2] https://medium.com/@andyalky/developing-aws-apps-locally-with-localstack-7f3d64663ce4
[3] https://medium.com/pareture/localstack-for-local-aws-dev-22775e483e3d

You can setup local AWS SecretManager inside LocalStack using the following command:

aws --endpoint-url=http://localhost:4566 secretsmanager create-secret --name my_secret --secret-string [{"my_uname":"username","my_pwd":"password"}]

Output:

{
    "ARN": "arn:aws:secretsmanager:us-east-1:000000000000:secret:my_secret-denusf",
    "Name": "my_secret",
    "VersionId": "e168cdf1-5c94-493d-bafd-791779a7515d"
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM