You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -117,6 +118,19 @@ For a full list of options see the [API.md](https://github.com/rehanvdm/serverle
117
118
118
119
You can see an example implementation of the demo site [here](https://github.com/rehanvdm/serverless-website-analytics-test)
119
120
121
+
#### Certificate Requirements
122
+
When specifying a domain, the certificate must be in `us-east-1` but your stack can be in ANY region. This is because
123
+
CloudFront requires the certificate to be in `us-east-1`.
124
+
125
+
You have one of two choices:
126
+
- Create the certificate in `us-east-1` manually (Click Ops) and import it from the Cert ARN as in the [demo example](https://github.com/rehanvdm/serverless-website-analytics-test/blob/main/lib/app.ts#L16).
127
+
- Create a `us-east-1` stack that your main stack (that contains this construct) depends. This main stack can be in any region.
128
+
Create the Certificate in the `us-east-1` stack and export the cert ARN. Then import the cert ARN in your main stack.
129
+
Ensure that you have the [crossRegionReferences](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Stack.html#crossregionreferences) flag set
130
+
on both stacks so that the CDK can export and import the Cert ARN via SSM. This is necessary because CloudFormation
131
+
can not export and import values across regions. Alternatively you can DIY it, here is a blog from [AWS](https://aws.amazon.com/blogs/infrastructure-and-automation/read-parameters-across-aws-regions-with-aws-cloudformation-custom-resources/)
132
+
and a quick example from [SO](https://stackoverflow.com/questions/59774627/cloudformation-cross-region-reference).
@@ -117,6 +118,19 @@ For a full list of options see the [API.md](https://github.com/rehanvdm/serverle
117
118
118
119
You can see an example implementation of the demo site [here](https://github.com/rehanvdm/serverless-website-analytics-test)
119
120
121
+
#### Certificate Requirements
122
+
When specifying a domain, the certificate must be in `us-east-1` but your stack can be in ANY region. This is because
123
+
CloudFront requires the certificate to be in `us-east-1`.
124
+
125
+
You have one of two choices:
126
+
- Create the certificate in `us-east-1` manually (Click Ops) and import it from the Cert ARN as in the [demo example](https://github.com/rehanvdm/serverless-website-analytics-test/blob/main/lib/app.ts#L16).
127
+
- Create a `us-east-1` stack that your main stack (that contains this construct) depends. This main stack can be in any region.
128
+
Create the Certificate in the `us-east-1` stack and export the cert ARN. Then import the cert ARN in your main stack.
129
+
Ensure that you have the [crossRegionReferences](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Stack.html#crossregionreferences) flag set
130
+
on both stacks so that the CDK can export and import the Cert ARN via SSM. This is necessary because CloudFormation
131
+
can not export and import values across regions. Alternatively you can DIY it, here is a blog from [AWS](https://aws.amazon.com/blogs/infrastructure-and-automation/read-parameters-across-aws-regions-with-aws-cloudformation-custom-resources/)
132
+
and a quick example from [SO](https://stackoverflow.com/questions/59774627/cloudformation-cross-region-reference).
| <code><ahref="#serverless-website-analytics.Domain.property.certificate">certificate</a></code> | <code>aws-cdk-lib.aws_certificatemanager.ICertificate</code> | The certificate to use for the domain. |
557
570
| <code><ahref="#serverless-website-analytics.Domain.property.name">name</a></code> | <code>string</code> | Name of the domain to use for the site, example: `serverless-website-analytics.com`. |
571
+
| <code><ahref="#serverless-website-analytics.Domain.property.certificate">certificate</a></code> | <code>aws-cdk-lib.aws_certificatemanager.ICertificate</code> | The certificate to use for the domain. |
558
572
| <code><ahref="#serverless-website-analytics.Domain.property.hostedZone">hostedZone</a></code> | <code>aws-cdk-lib.aws_route53.IHostedZone</code> | Optional, if not specified then no DNS records will be created. |
559
573
| <code><ahref="#serverless-website-analytics.Domain.property.trackOwnDomain">trackOwnDomain</a></code> | <code>boolean</code> | Optional, if specified, it adds tracking to the dashboard. |
574
+
| <code><ahref="#serverless-website-analytics.Domain.property.usEast1Certificate">usEast1Certificate</a></code> | <code>aws-cdk-lib.aws_certificatemanager.ICertificate</code> | The certificate to use for the domain. |
0 commit comments