Skip to content

Commit 754b4bc

Browse files
committed
README changes
1 parent a35830c commit 754b4bc

File tree

1 file changed

+79
-45
lines changed

1 file changed

+79
-45
lines changed

README.md

Lines changed: 79 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,59 @@
11
# AWS CloudFormation Sample Templates
22

3-
Use sample AWS CloudFormation templates to learn how to declare specific AWS
4-
resources or solve a particular use case. We recommend that you use sample
5-
templates as a starting point for creating your own templates, not for
6-
launching production-level environments. Before launching a template, always
7-
review the resources that it will create and the permissions it requires.
3+
This repository contains sample CloudFormation templates that you can use
4+
to help you get started on new infrastructure projects. Keep in mind that these
5+
templates are not meant to be production-ready "QuickStarts". You should
6+
take the time to learn how they work, adapt them to your needs, and make sure
7+
that they meet your company's compliance standards.
88

9-
## About the Repository
10-
11-
The AWS CloudFormation team and approved contributors provide and maintain
12-
sample templates in the `aws` folder.
13-
14-
We also collect and make available templates developed by the community. These
15-
sample templates are located in the `community` folder and its subfolders. We
16-
encourage your contributions to these templates. Note, however, that we don't
17-
test, maintain, or support community templates.
9+
Each template in this repository passes
10+
[CloudFormation Linter](https://github.com/aws-cloudformation/cfn-lint)
11+
(cfn-lint) checks, and also a basic set of
12+
[CloudFormation Guard](https://github.com/aws-cloudformation/cloudformation-guard)
13+
rules based on the CIS Top 20, with exceptions for some rules where it
14+
made sense to keep the sample focused on a single use case.
1815

1916
## Discord
2017

21-
Join us on Discord to discuss rain and all things CloudFormation! Connect and interact with CloudFormation developers and
22-
experts, find channels to discuss rain, the CloudFormation registry, StackSets,
23-
cfn-lint, Guard and more:
18+
Join us on Discord to discuss rain and all things CloudFormation! Connect and
19+
interact with CloudFormation developers and experts, find channels to discuss
20+
rain, the CloudFormation registry, StackSets, cfn-lint, Guard and more:
2421

2522
[![Join our Discord](https://discordapp.com/api/guilds/981586120448020580/widget.png?style=banner3)](https://discord.gg/9zpd7TTRwq)
2623

2724
## Submitting Templates
2825

29-
Before you submit a template, we suggest that you follow these guidelines to
30-
help maintain consistency between templates.
26+
Before you submit a template, we suggest that you follow these guidelines:
3127

32-
- Test your template. Can you successfully create a stack with it? When you
33-
create a stack, AWS CloudFormation uses the `ValidateTemplate` API to check
34-
your template. When you delete a stack, is the stack (and all of its
35-
resources) successfully deleted? Make sure users aren't left with stray
36-
resources or stacks that have deletion errors.
28+
- Fork the repository and create a fresh branch to work on your sample
29+
```
30+
git remote add upstream [email protected]:aws-cloudformation/rain.git
31+
git fetch upstream
32+
git checkout -b my-branch-name upstream/main
33+
git push -u origin
34+
```
35+
- Write the template in YAML, with a `.yaml` suffix (not `.yml` or
36+
`.template`). Our build scripts will auto-generate a JSON file based on the
37+
YAML. YAML is the source of truth for all templates in this repository.
38+
- Test your template. Can you successfully create a stack with it? When you
39+
delete a stack, is the stack (and all of its resources) successfully deleted?
40+
Make sure users aren't left with stray resources or stacks that have deletion
41+
errors.
3742
- In the Description section, add a brief description of your template. The
3843
description should indicate what the template does and why it's useful. For
39-
example:
40-
```Description: "Create a LAMP stack using a single EC2 instance and
44+
example:
45+
```
46+
Description: "Create a LAMP stack using a single EC2 instance and
4147
a local MySQL database for storage. This template demonstrates using the AWS
4248
CloudFormation bootstrap scripts to install the packages and files necessary
4349
to deploy the Apache web server, PHP, and MySQL when the instance is
4450
launched."
4551
```
4652
- Format your template to make it human readable:
47-
- Err on the side of human readability. If it makes your template easier to
48-
read, do it.
49-
- Use cfn-lint to lint your template and make sure it is valid.
50-
- Consider using two-space indents to reduce line wrapping.
53+
- Err on the side of human readability. If it makes your template easier to
54+
read, do it.
55+
- Use cfn-lint to lint your template and make sure it is valid.
56+
- Consider using two-space indents to reduce line wrapping.
5157
- Review IAM resources. If you include IAM resources, follow the standard
5258
security advice of granting least privilege (granting only the permissions
5359
required to do a task).
@@ -56,27 +62,55 @@ help maintain consistency between templates.
5662
before submitting your template. You can use this tool to help you scrub
5763
secrets:
5864
[https://github.com/awslabs/git-secrets](https://github.com/awslabs/git-secrets).
59-
- Add your template to the correct folder so that others can discover it. If
60-
your template demonstrates a particular service, add it to the Services
61-
folder. If it uses multiple services to address a particular use case, add it
62-
to the Solutions folder.
65+
- Add your template to the correct folder so that others can discover it.
66+
- Run the `scripts/test-all.sh` script in the directory where you're working to
67+
make sure the template is valid.
68+
- If you write any lambda function code, put it in a separate file and run
69+
`pylint` or `eslint` to make sure the code is valid.
6370

6471
When your template is ready, submit a pull request. A member of the AWS
65-
organization will review your request and might suggest changes. We review
66-
templates to check for general security issues, but we won't test or maintain
67-
them. If we don't get back to you within a week of your submission, use your
68-
pull request to send us a message.
72+
organization will review your request and might suggest changes.
6973

7074
## Additional Resources
7175

76+
### CloudFormation Linter (cfn-lint)
77+
78+
The [CloudFormation Linter](https://github.com/aws-cloudformation/cfn-lint) is
79+
an indispensable tool for developing your templates. It should be a part of
80+
every developer's workflow, and incorporated into your CI/CD pipelines.
81+
82+
Install cfn-lint with pip:
83+
84+
```sh
85+
pip install cfn-lint
86+
```
87+
88+
### CLoudFormation Rain
89+
90+
[Rain](https://github.com/aws-cloudformation/rain) is a command line interface
91+
(CLI) for CloudFormation that greatly improves the experience for authoring and
92+
deploying templates. It has many features, such as creating starter templates
93+
for various use cases, interactive deployments, modules, and more.
94+
95+
Rain can be installed with Brew:
96+
97+
```sh
98+
brew install rain
99+
```
100+
101+
or if you are a Go user, you can install it like this:
102+
103+
```sh
104+
go install github.com/aws-cloudformation/rain/cmd/rain@latest
105+
```
106+
107+
72108
In the *AWS CloudFormation User Guide*, you can view more information about the
73109
following topics:
74110

75-
- Learn how to use templates to create AWS CloudFormation stacks using the [AWS
76-
Management
77-
Console](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-create-stack.html)
78-
or [AWS Command Line Interface (AWS
79-
CLI)](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-cli-creating-stack.html).
111+
- Learn how to use templates to create AWS CloudFormation stacks using the
112+
[AWS Management Console](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-create-stack.html)
113+
or
114+
[AWS Command Line Interface (AWS CLI)](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-cli-creating-stack.html).
80115
- To view all the supported AWS resources and their properties, see the
81-
[Template
82-
Reference](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-reference.html).
116+
[Template Reference](http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-reference.html).

0 commit comments

Comments
 (0)