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
feat: S3_hosting create CF but use existing bucket (#47)
* feat: S3_hosting create CF but use existing bucket
this is useful for multiple CF pointing to one bucket,
user can manually create the s3 bucket policy allowing both CF to view
using their assets acess identity
Copy file name to clipboardExpand all lines: modules/s3_hosting/README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,16 +28,19 @@ Create an S3 bucket and Cloudfront distribution for holding frontend application
28
28
| cf\_lambda\_function\_associations | A config block that triggers a lambda function with specific actions (maximum 4) | <pre>list(object({<br> event_type = string<br> lambda_arn = string<br> include_body = bool<br> }))</pre> |`[]`| no |
29
29
| cf\_signed\_downloads | Enable Cloudfront signed URLs |`bool`|`false`| no |
30
30
| cf\_trusted\_signers | Only available when cf\_signed\_downloads is enabled, a list of trusted signers(self/account\_id) for Cloudfront, used for signing URLs |`list(string)`| <pre>[<br> "self"<br>]</pre> | no |
31
+
| create\_s3\_bucket\_policy | Useful when multiple CF distributions access the same bucket. You would need to create a bucket policy that allows access from multiple distributions |`bool`|`true`| no |
31
32
| domain | Domain to host content for. This will be the name of the bucket |`string`| n/a | yes |
| project | The name of the project, mostly for tagging |`any`| n/a | yes |
34
35
| route53\_zone\_id | ID of the Route53 zone to create a record in |`string`| n/a | yes |
36
+
| use\_existing\_s3\_bucket | Name of existing s3 Bucket to use instead of creating a new one |`string`|`""`| no |
35
37
36
38
## Outputs
37
39
38
40
| Name | Description |
39
41
|------|-------------|
40
42
| bucket\_arn | ARN of the created S3 bucket |
43
+
| cf\_origin\_assets\_access\_identity\_arn | Cloudfront origin assets access identity, useful when multiple CF using the same bucket to manage S3 bucket policies |
41
44
| cf\_signing\_enabled | Does this require signed URL downloads? |
42
45
| cloudfront\_distribution\_id | Identifier of the created cloudfront distribution |
Copy file name to clipboardExpand all lines: modules/s3_hosting/variables.tf
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,19 @@ variable "domain" {
11
11
type=string
12
12
}
13
13
14
+
variable"use_existing_s3_bucket" {
15
+
description="Name of existing s3 Bucket to use instead of creating a new one"
16
+
type=string
17
+
default=""
18
+
}
19
+
20
+
variable"create_s3_bucket_policy" {
21
+
description="Useful when multiple CF distributions access the same bucket. You would need to create a bucket policy that allows access from multiple distributions"
22
+
type=bool
23
+
default=true
24
+
}
25
+
26
+
14
27
variable"aliases" {
15
28
description="Additional domains that this cloudfront distribution will serve traffic for"
0 commit comments