Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/radzionc/terraform-aws-documentdb-lambda
Terraform module which creates Amazon DocumentDB and AWS Lambda in same VPC
https://github.com/radzionc/terraform-aws-documentdb-lambda
api-gateway aws aws-lambda documentdb mongodb nodejs terraform terraform-module
Last synced: 2 months ago
JSON representation
Terraform module which creates Amazon DocumentDB and AWS Lambda in same VPC
- Host: GitHub
- URL: https://github.com/radzionc/terraform-aws-documentdb-lambda
- Owner: radzionc
- Created: 2019-04-27T03:54:46.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-10-16T11:44:12.000Z (over 4 years ago)
- Last Synced: 2024-04-24T10:21:05.998Z (9 months ago)
- Topics: api-gateway, aws, aws-lambda, documentdb, mongodb, nodejs, terraform, terraform-module
- Language: HCL
- Homepage:
- Size: 8.79 KB
- Stars: 11
- Watchers: 3
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# [terraform-aws-documentdb-lambda](https://medium.com/p/34a5d1061c15)
>
## create resources on AWS:
```bash
#
$ export AWS_ACCESS_KEY_ID=
$ export AWS_SECRET_ACCESS_KEY=# set variable as env vars or in vars.tf file
$ export TF_VAR_name= # by default geek_api
$ export TF_VAR_docdb_password=
# if you have a domain on AWS
# lambda will be available at https://.
$ export TF_VAR_certificate_arn=
$ export TF_VAR_zone_id=Z1NT1BON8JUIVM=
$ export TF_VAR_main_domain=$ terraform init
$ terraform apply
```## Outputs:
- aws_instance_public_dns
- url
- docdb_endpoint
- docdb_username
- bucket
- bucket_key
- name## Connect to Amazon DocumentDB
```bash
$ ssh -i tf--ec2 ubuntu
$ mongo \
--host \
--username \
--password
```## update function code:
```bash
$ export AWS_DEFAULT_REGION=
$ aws s3 cp lambda.zip s3:///
$ aws lambda update-function-code --function-name tf- --s3-bucket --s3-key
```## [Blog post](https://geekrodion.com/blog/documentdb-terraform)
## License
MIT © [RodionChachura](https://geekrodion.com)