{"id":13602616,"url":"https://github.com/cfn-modules/docs","last_synced_at":"2025-04-11T09:30:40.044Z","repository":{"id":33120559,"uuid":"139443203","full_name":"cfn-modules/docs","owner":"cfn-modules","description":"Rapid CloudFormation: Modular, production ready, open source.","archived":false,"fork":false,"pushed_at":"2025-02-11T07:42:54.000Z","size":1397,"stargazers_count":264,"open_issues_count":7,"forks_count":40,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-02-11T08:39:42.323Z","etag":null,"topics":["amazon-web-services","aws","aws-cloudformation","aws-cloudformation-templates","cfn","cfn-templates","cloudformation","cloudformation-template","cloudformation-templates","cloudformation-yaml"],"latest_commit_sha":null,"homepage":"https://github.com/cfn-modules","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cfn-modules.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-02T12:50:50.000Z","updated_at":"2025-02-11T07:32:39.000Z","dependencies_parsed_at":"2024-12-19T09:19:42.747Z","dependency_job_id":"53e93f0f-e363-445c-b2f7-de91d893fc61","html_url":"https://github.com/cfn-modules/docs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfn-modules%2Fdocs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfn-modules%2Fdocs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfn-modules%2Fdocs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfn-modules%2Fdocs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfn-modules","download_url":"https://codeload.github.com/cfn-modules/docs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248368167,"owners_count":21092312,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon-web-services","aws","aws-cloudformation","aws-cloudformation-templates","cfn","cfn-templates","cloudformation","cloudformation-template","cloudformation-templates","cloudformation-yaml"],"created_at":"2024-08-01T18:01:31.754Z","updated_at":"2025-04-11T09:30:39.616Z","avatar_url":"https://github.com/cfn-modules.png","language":"Shell","readme":"![cfn-modules](./logo.png)\n\n# cfn-modules User Guide\n\nRapid CloudFormation: Modular, production ready, open source.\n\n## Why cfn-modules?\nWe started with [aws-cf-templates](https://github.com/widdix/aws-cf-templates) in 2015. Three years later, we believe that we have learned enough to come up with a new approach to use CloudFormation more efficient.\n\n### Modular\nReusing CloudFormation templates is hard. Most often, templates are initially copied and then modified.\n\nTwo problems arise. First, updates to the copy are not applied to the original. Second, updates to the original are not applied to the copy. **In essence: we do not learn from each other!**\n\nBy using an easy to use package manager ([npm](https://www.npmjs.com/)) you can install and update `cfn-modules` to spin up complex infrastructure in minutes that just works.\n\n### Production ready\nAll modules are production-ready. If no other limitations are documented, they are:\n\n* Highly available\n    * no single point of failure\n* Scalable\n    * increase or decrease the capacity based on utilization\n* Secure\n    * using the latest operating systems and software components\n    * follow the least privilege principle (e.g., IAM policies and Security Groups)\n    * backups of state (not configuration) enabled\n    * encryption at-rest enabled\n    * encryption in-transit enabled and preferred\n* Operator-friendly\n    * logging enabled\n    * alerting enabled\n    * updatable\n\n### Open source\nAll modules are licensed under [Apache-2.0](./LICENSE). Commercial use is allowed.\n\n## Prerequisites\n* AWS CLI installed ([install](https://docs.aws.amazon.com/cli/latest/userguide/installing.html))\n* npm \u003e=5.6 installed ([install Node.js 10.x](https://nodejs.org/))\n\n## Getting started\n\n`cfn-modules` are installed and updated with the package manager [npm](https://www.npmjs.com/). The [module catalog](https://www.npmjs.com/org/cfn-modules) contains all available modules. Let's start with a simple example: An EC2 instance launched into a VPC.\n\n\u003e [Install Node.js 10.x](https://nodejs.org/) if `npm` is not installed on your system \n\nInstall the modules using npm:\n\n```\nnpm i @cfn-modules/vpc@1.0.0\nnpm i @cfn-modules/ec2-instance-amazon-linux@1.0.0\n```\n\nUse the modules as nested stacks in your CloudFormation template. The [vpc](https://www.npmjs.com/package/@cfn-modules/vpc) module comes with no required parameters. The [ec2-instance-amazon-linux](https://www.npmjs.com/package/@cfn-modules/ec2-instance-amazon-linux) module comes with the required `VpcModule` parameter to make the connection with the `vpc` module. The `UserData` [parameter](https://www.npmjs.com/package/@cfn-modules/ec2-instance-amazon-linux#parameters) is optional. Use it to install additional software like the Apache HTTP Server. Create a file named `example.yml` with the following content:\n\n```\n---\nAWSTemplateFormatVersion: '2010-09-09'\nResources:\n  Vpc:\n    Type: 'AWS::CloudFormation::Stack'\n    Properties:\n      Parameters:\n        S3Endpoint: 'false' # speed up the example\n        DynamoDBEndpoint: 'false' # speed up the example\n        FlowLog: 'false' # speed up the example\n        NatGateways: 'false' # speed up the example\n      TemplateURL: './node_modules/@cfn-modules/vpc/module.yml'\n  Instance:\n    Type: 'AWS::CloudFormation::Stack'\n    Properties:\n      Parameters:\n        VpcModule: !GetAtt 'Vpc.Outputs.StackName' # reference the vpc module\n        UserData: |\n          yum install -y httpd24\n          service httpd start\n          echo \"cfn-modules\" \u003e /var/www/html/index.html\n        IngressTcpPort1: '80' # open up port 80 to the world\n      TemplateURL: './node_modules/@cfn-modules/ec2-instance-amazon-linux/module.yml'\nOutputs:\n  Url:\n    Value: !Sub 'http://${Instance.Outputs.PublicIpAddress}'\n```\n\nUpload the CloudFormation template and the dependencies to S3 with the `aws cloudformation package` command.\n\n\u003e [Install AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/installing.html) if `aws` is not installed on your system \n\nIf you use `cfn-modules` the first time, create an S3 bucket to store the artifacts first (otherwise, skip this step). Choose a unique bucket name, e.g. `cfn-modules-$Name-$Region`.\n\nIn the following command, replace `$Name` with a unique name (e.g. your initials or company name), and replace `$Region` with your AWS default region (e.g. `us-east-1`) to create an S3 bucket:\n\n```\naws s3 mb s3://cfn-modules-$Name-$Region\n```\n\nNow you can upload all artifacts to S3:\n\n```\naws cloudformation package --template-file example.yml --s3-bucket cfn-modules-$Name-$Region --output-template-file packaged.yml\n```\n\nFinally, you can create a CloudFormation stack with `aws cloudformation deploy`:\n\n```\naws cloudformation deploy --template-file packaged.yml --stack-name ec2-example --capabilities CAPABILITY_IAM\n```\n\nCreating the stack will take about 10 minutes. You can find the URL to the demo page in the stack outputs:\n\n```\naws cloudformation describe-stacks --stack-name ec2-example --query \"Stacks[0].Outputs\"\n```\n\nDon't forget to delete the stack:\n\n```\naws cloudformation delete-stack --stack-name ec2-example\naws cloudformation wait stack-delete-complete --stack-name ec2-example\n```\n\nFin. Check out our examples next.\n\n## Examples\n* Auto Scaling Group (singleton)\n    * [SSM](./examples/asg-singleton-ssm/)\n* EC2\n    * [Mount EBS volume](./examples/ec2-ebs/)\n    * [Mount EFS file system](./examples/ec2-efs/)\n    * [Connect to MySQL](./examples/ec2-mysql/)\n    * [Connect to Postgres](./examples/ec2-postgres/)\n    * [SSH bastion](./examples/ec2-ssh-bastion/)\n    * [SSM](./examples/ec2-ssm/)\n* Fargate\n    * [ALB with Cognito auth](./examples/fargate-alb-auth-cognito/)\n    * [ALB with proxy pattern](./examples/fargate-alb-proxy-pattern/)\n    * [ALB service to service](./examples/fargate-alb-service-to-service/)\n    * [ALB to single container](./examples/fargate-alb-single-container/)\n* [MSK cluster](./examples/msk-cluster/)\n* Serverless\n    * [Cron](./examples/serverless-cron/)\n    * [Auto IAM policies](./examples/serverless-iam/)\n    * [Image resize](./examples/serverless-image-resize/)\n    * [SQS queue](./examples/serverless-sqs-queue/)\n    * [Webhook](./examples/serverless-webhook/)\n\nCheck out the [examples](./examples/) folder to see all examples.\n\n## Modules\n\n* [acm-wildcard-certificate-public](https://github.com/cfn-modules/acm-wildcard-certificate-public)\n* [alerting](https://github.com/cfn-modules/alerting)\n* Load Balancer\n    * [alb](https://github.com/cfn-modules/alb)\n    * [alb-listener](https://github.com/cfn-modules/alb-listener)\n    * [alb-redirect-to-https](https://github.com/cfn-modules/alb-redirect-to-https)\n    * [nlb](https://github.com/cfn-modules/nlb)\n    * [lb-dns-record](https://github.com/cfn-modules/lb-dns-record)\n* Auto Scaling Group (singleton)\n    * [asg-singleton-amazon-linux2](https://github.com/cfn-modules/asg-singleton-amazon-linux2)\n* [client-sg](https://github.com/cfn-modules/client-sg)\n* [cloudwatch-dashboard](https://github.com/cfn-modules/cloudwatch-dashboard)\n* [cognito-userpool](https://github.com/cfn-modules/cognito-userpool)\n* [dynamodb-table](https://github.com/cfn-modules/dynamodb-table)\n* [ebs-volume](https://github.com/cfn-modules/ebs-volume)\n* EC2 instance\n    * [ec2-instance-amazon-linux](https://github.com/cfn-modules/ec2-instance-amazon-linux)\n    * [ec2-instance-amazon-linux2](https://github.com/cfn-modules/ec2-instance-amazon-linux2)\n* ECS\n    * [ecs-cluster](https://github.com/cfn-modules/ecs-cluster)\n    * [ecs-alb-target](https://github.com/cfn-modules/ecs-alb-target)\n    * [ecs-nlb-listener-and-target](https://github.com/cfn-modules/ecs-nlb-listener-and-target)\n    * Fargate\n        * [fargate-scheduled-task](https://github.com/cfn-modules/fargate-scheduled-task)\n        * [fargate-service](https://github.com/cfn-modules/fargate-service)\n* [efs-file-system](https://github.com/cfn-modules/efs-file-system)\n* [elasticache-redis](https://github.com/cfn-modules/elasticache-redis)\n* [kinesis-data-stream](https://github.com/cfn-modules/kinesis-data-stream)\n* [kms-key](https://github.com/cfn-modules/kms-key)\n* Lambda\n    * [lambda-event-source-cron](https://github.com/cfn-modules/lambda-event-source-cron)\n    * [lambda-event-source-dynamodb-stream](https://github.com/cfn-modules/lambda-event-source-dynamodb-stream)\n    * [lambda-event-source-kinesis-data-stream](https://github.com/cfn-modules/lambda-event-source-kinesis-data-stream)\n    * [lambda-event-source-sqs-queue](https://github.com/cfn-modules/lambda-event-source-sqs-queue)\n    * [lambda-event-source-webhook](https://github.com/cfn-modules/lambda-event-source-webhook)\n    * [lambda-function](https://github.com/cfn-modules/lambda-function)\n* [msk-cluster](https://github.com/cfn-modules/msk-cluster)\n* RDS\n    * [rds-aurora-serverless](https://github.com/cfn-modules/rds-aurora-serverless)\n    * [rds-aurora-serverless-postgres](https://github.com/cfn-modules/rds-aurora-serverless-postgres) \n    * [rds-mysql](https://github.com/cfn-modules/rds-mysql)\n    * [rds-postgres](https://github.com/cfn-modules/rds-postgres)\n* Route53\n    * [route53-hosted-zone-private](https://github.com/cfn-modules/route53-hosted-zone-private)\n    * [route53-hosted-zone-public](https://github.com/cfn-modules/route53-hosted-zone-public)\n    * [route53-hosted-zone-wrapper](https://github.com/cfn-modules/route53-hosted-zone-wrapper)\n* [s3-bucket](https://github.com/cfn-modules/s3-bucket)\n* [secret](https://github.com/cfn-modules/secret)\n* [sqs-queue](https://github.com/cfn-modules/sqs-queue)\n* [ssh-bastion](https://github.com/cfn-modules/ssh-bastion)\n* [vpc](https://github.com/cfn-modules/vpc)\n\nCheck out the [module catalog](https://www.npmjs.com/org/cfn-modules) to browse all modules.\n\n## About\nA [cloudonaut.io](https://cloudonaut.io) project. Engineered by [widdix](https://widdix.net).\n","funding_links":[],"categories":["aws","Shell"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfn-modules%2Fdocs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfn-modules%2Fdocs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfn-modules%2Fdocs/lists"}