Skip to content

Commit 77d1971

Browse files
authored
Make region limitation more clear (#50)
* Add warning about valid region * Add rule preventing deployment outside us-east-1 By using a CloudFormation rule, the user can receive feedback more quickly. The error message is also more helpful.
1 parent 524e50a commit 77d1971

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ For more information, see [Mozilla’s web security guidelines](https://infosec.
5353
You must have a registered domain name, such as example.com, and point it to a Route 53 hosted zone in the same AWS account in which you deploy this solution. For more information, see [Configuring Amazon Route 53 as your DNS service](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-configuring.html).
5454

5555
## Deploy the solution
56+
57+
> :⚠️ This template can only be deployed in the `us-east-1` region
58+
5659
To deploy the solution, you use [AWS CloudFormation](https://aws.amazon.com/cloudformation). You can use the CloudFormation console, or download the CloudFormation template to deploy it on your own.
5760

5861
> **Note:** You must have IAM permissions to launch CloudFormation templates that create IAM roles, and to create all the AWS resources in the solution. Also, you are responsible for the cost of the AWS services used while running this solution. For more information about costs, see the pricing pages for each AWS service.
@@ -72,14 +75,14 @@ To deploy the solution, you use [AWS CloudFormation](https://aws.amazon.com/clou
7275

7376
- **SubDomain:** The subdomain for your registered domain name. Viewers use the subdomain to access your website, for example: www.example.com. We recommend using the default value of **www** as the subdomain.
7477
- **DomainName:** Your registered domain name, such as example.com. This domain must be pointed to a Route 53 hosted zone.
75-
- **HostedZoneId** The Route 53 Hosted Zone Id containing the domain being used.
78+
- **HostedZoneId** The Route 53 Hosted Zone Id containing the domain being used.
7679
- **CreateApex:** Optionally create an Alias to the domain apex (example.com) in your CloudFront configuration. Default is [no]
7780

7881
After entering values, choose the **Next** button.
7982
5. On the **Configure stack options** page, you can optionally [add tags and other stack options](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-console-add-tags.html). When finished, choose the **Next** button.
8083
6. On the **Review** page, you must scroll down and check the two boxes in the **Capabilities** section:
8184

82-
- **I acknowledge that AWS CloudFormation might create IAM resources with custom names.**
85+
- **I acknowledge that AWS CloudFormation might create IAM resources with custom names.**
8386
- **I acknowledge that AWS CloudFormation might require the following capability: CAPABILITY_AUTO_EXPAND**
8487

8588
These capabilities allow CloudFormation to create an IAM role that allows access
@@ -104,7 +107,7 @@ To download the CloudFormation template to deploy on your own, for example by [u
104107
https://s3.amazonaws.com/solution-builders-us-east-1/amazon-cloudfront-secure-static-site/latest/main.yaml
105108

106109
## Customizing the Solution
107-
### Update the website content locally
110+
### Update the website content locally
108111

109112
**To customize the website with your own content before deploying the solution**
110113

@@ -141,7 +144,7 @@ https://s3.amazonaws.com/solution-builders-us-east-1/amazon-cloudfront-secure-st
141144
--capabilities CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND \
142145
--parameter-overrides DomainName=<your domain name> SubDomain=<your website subdomain> HostedZoneId=<hosted zone id>
143146
```
144-
147+
145148
8. [Optional] Run the following command to deploy the packaged CloudFormation template to a CloudFormation stack with a domain apex.
146149

147150
```shell
@@ -157,7 +160,7 @@ https://s3.amazonaws.com/solution-builders-us-east-1/amazon-cloudfront-secure-st
157160

158161
To change the Content Security Policy of the site:
159162

160-
1. Make your changes to the header values by editing `source/secured-headers/index.js`.
163+
1. Make your changes to the header values by editing `source/secured-headers/index.js`.
161164
1. Deploy the solution by following the steps in [Update the website content locally](#update-the-website-content-locally)
162165

163166

templates/main.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ Mappings:
1515
Constants:
1616
Version: 'v0.7'
1717

18+
Rules:
19+
OnlyUsEast1:
20+
Assertions:
21+
- Assert:
22+
Fn::Equals:
23+
- !Ref AWS::Region
24+
- us-east-1
25+
AssertDescription: |
26+
This template can only be deployed in the us-east-1 region.
27+
This is because the ACM Certificate must be created in us-east-1
28+
1829
Parameters:
1930
SubDomain:
2031
Description: The part of a website address before your DomainName - e.g. www or img

0 commit comments

Comments
 (0)