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
Provide better description for var.origin_bucket (#142)
* Provide better description for var.origin_bucket
* Auto Format
* Update based on comments
* Auto Format
* Add example of reusing an s3 bucket
* Auto Format
* Correct naming order
* Auto Format
* Auto Format
Co-authored-by: cloudpossebot <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+23-3Lines changed: 23 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,11 +99,14 @@ For a complete example, see [examples/complete](examples/complete).
99
99
100
100
For automated tests of the complete example using [bats](https://github.com/bats-core/bats-core) and [Terratest](https://github.com/gruntwork-io/terratest) (which tests and deploys the example on AWS), see [test](test).
101
101
102
+
This will create a new s3 bucket `eg-prod-app` for a cloudfront cdn.
103
+
102
104
```hcl
103
105
module "cdn" {
104
106
source = "cloudposse/cloudfront-s3-cdn/aws"
105
107
# Cloud Posse recommends pinning every module to a specific version
106
108
# version = "x.x.x"
109
+
107
110
namespace = "eg"
108
111
stage = "prod"
109
112
name = "app"
@@ -113,6 +116,21 @@ module "cdn" {
113
116
}
114
117
```
115
118
119
+
This will reuse an existing s3 bucket `eg-prod-app` for a cloudfront cdn.
120
+
121
+
```hcl
122
+
module "cdn" {
123
+
source = "cloudposse/cloudfront-s3-cdn/aws"
124
+
# Cloud Posse recommends pinning every module to a specific version
125
+
# version = "x.x.x"
126
+
127
+
origin_bucket = "eg-prod-app"
128
+
aliases = ["assets.cloudposse.com"]
129
+
dns_alias_enabled = true
130
+
parent_zone_name = "cloudposse.com"
131
+
}
132
+
```
133
+
116
134
### Generating ACM Certificate
117
135
118
136
Use the AWS cli to [request new ACM certifiates](http://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request.html) (requires email validation)
@@ -252,7 +270,7 @@ Available targets:
252
270
| <aname="input_name"></a> [name](#input\_name)| Solution name, e.g. 'app' or 'jenkins' |`string`|`null`| no |
253
271
| <aname="input_namespace"></a> [namespace](#input\_namespace)| Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' |`string`|`null`| no |
254
272
| <a name="input_ordered_cache"></a> [ordered\_cache](#input\_ordered\_cache) | An ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.<br>The fields can be described by the other variables in this file. For example, the field 'lambda\_function\_association' in this object has<br>a description in var.lambda\_function\_association variable earlier in this file. The only difference is that fields on this object are in ordered caches, whereas the rest<br>of the vars in this file apply only to the default cache. Put value `""` on field `target_origin_id` to specify default s3 bucket origin. | <pre>list(object({<br> target_origin_id = string<br> path_pattern = string<br><br> allowed_methods = list(string)<br> cached_methods = list(string)<br> compress = bool<br><br> viewer_protocol_policy = string<br> min_ttl = number<br> default_ttl = number<br> max_ttl = number<br><br> forward_query_string = bool<br> forward_header_values = list(string)<br> forward_cookies = string<br><br> lambda_function_association = list(object({<br> event_type = string<br> include_body = bool<br> lambda_arn = string<br> }))<br> }))</pre> | `[]` | no |
255
-
| <aname="input_origin_bucket"></a> [origin\_bucket](#input\_origin\_bucket)|Origin S3 bucket name |`string`|`null`| no |
273
+
| <aname="input_origin_bucket"></a> [origin\_bucket](#input\_origin\_bucket)|Name of an existing S3 bucket to use as the origin. If this is not provided, it will create a new s3 bucket using `var.name` and other context related inputs|`string`|`null`| no |
256
274
| <aname="input_origin_force_destroy"></a> [origin\_force\_destroy](#input\_origin\_force\_destroy)| Delete all objects from the bucket so that the bucket can be destroyed without error (e.g. `true` or `false`) |`bool`|`false`| no |
257
275
| <aname="input_origin_path"></a> [origin\_path](#input\_origin\_path)| An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. It must begin with a /. Do not add a / at the end of the path. |`string`|`""`| no |
258
276
| <aname="input_origin_ssl_protocols"></a> [origin\_ssl\_protocols](#input\_origin\_ssl\_protocols)| The SSL/TLS protocols that you want CloudFront to use when communicating with your origin over HTTPS. |`list(string)`| <pre>[<br> "TLSv1",<br> "TLSv1.1",<br> "TLSv1.2"<br>]</pre> | no |
@@ -438,8 +456,8 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
Copy file name to clipboardExpand all lines: README.yaml
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -61,11 +61,14 @@ usage: |-
61
61
62
62
For automated tests of the complete example using [bats](https://github.com/bats-core/bats-core) and [Terratest](https://github.com/gruntwork-io/terratest) (which tests and deploys the example on AWS), see [test](test).
63
63
64
+
This will create a new s3 bucket `eg-prod-app` for a cloudfront cdn.
65
+
64
66
```hcl
65
67
module "cdn" {
66
68
source = "cloudposse/cloudfront-s3-cdn/aws"
67
69
# Cloud Posse recommends pinning every module to a specific version
68
70
# version = "x.x.x"
71
+
69
72
namespace = "eg"
70
73
stage = "prod"
71
74
name = "app"
@@ -75,6 +78,21 @@ usage: |-
75
78
}
76
79
```
77
80
81
+
This will reuse an existing s3 bucket `eg-prod-app` for a cloudfront cdn.
82
+
83
+
```hcl
84
+
module "cdn" {
85
+
source = "cloudposse/cloudfront-s3-cdn/aws"
86
+
# Cloud Posse recommends pinning every module to a specific version
87
+
# version = "x.x.x"
88
+
89
+
origin_bucket = "eg-prod-app"
90
+
aliases = ["assets.cloudposse.com"]
91
+
dns_alias_enabled = true
92
+
parent_zone_name = "cloudposse.com"
93
+
}
94
+
```
95
+
78
96
### Generating ACM Certificate
79
97
80
98
Use the AWS cli to [request new ACM certifiates](http://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request.html) (requires email validation)
Copy file name to clipboardExpand all lines: docs/terraform.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,7 +95,7 @@
95
95
| <aname="input_name"></a> [name](#input\_name)| Solution name, e.g. 'app' or 'jenkins' |`string`|`null`| no |
96
96
| <aname="input_namespace"></a> [namespace](#input\_namespace)| Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' |`string`|`null`| no |
97
97
| <a name="input_ordered_cache"></a> [ordered\_cache](#input\_ordered\_cache) | An ordered list of cache behaviors resource for this distribution. List from top to bottom in order of precedence. The topmost cache behavior will have precedence 0.<br>The fields can be described by the other variables in this file. For example, the field 'lambda\_function\_association' in this object has<br>a description in var.lambda\_function\_association variable earlier in this file. The only difference is that fields on this object are in ordered caches, whereas the rest<br>of the vars in this file apply only to the default cache. Put value `""` on field `target_origin_id` to specify default s3 bucket origin. | <pre>list(object({<br> target_origin_id = string<br> path_pattern = string<br><br> allowed_methods = list(string)<br> cached_methods = list(string)<br> compress = bool<br><br> viewer_protocol_policy = string<br> min_ttl = number<br> default_ttl = number<br> max_ttl = number<br><br> forward_query_string = bool<br> forward_header_values = list(string)<br> forward_cookies = string<br><br> lambda_function_association = list(object({<br> event_type = string<br> include_body = bool<br> lambda_arn = string<br> }))<br> }))</pre> | `[]` | no |
98
-
| <aname="input_origin_bucket"></a> [origin\_bucket](#input\_origin\_bucket)|Origin S3 bucket name |`string`|`null`| no |
98
+
| <aname="input_origin_bucket"></a> [origin\_bucket](#input\_origin\_bucket)|Name of an existing S3 bucket to use as the origin. If this is not provided, it will create a new s3 bucket using `var.name` and other context related inputs|`string`|`null`| no |
99
99
| <aname="input_origin_force_destroy"></a> [origin\_force\_destroy](#input\_origin\_force\_destroy)| Delete all objects from the bucket so that the bucket can be destroyed without error (e.g. `true` or `false`) |`bool`|`false`| no |
100
100
| <aname="input_origin_path"></a> [origin\_path](#input\_origin\_path)| An optional element that causes CloudFront to request your content from a directory in your Amazon S3 bucket or your custom origin. It must begin with a /. Do not add a / at the end of the path. |`string`|`""`| no |
101
101
| <aname="input_origin_ssl_protocols"></a> [origin\_ssl\_protocols](#input\_origin\_ssl\_protocols)| The SSL/TLS protocols that you want CloudFront to use when communicating with your origin over HTTPS. |`list(string)`| <pre>[<br> "TLSv1",<br> "TLSv1.1",<br> "TLSv1.2"<br>]</pre> | no |
description="Name of an existing S3 bucket to use as the origin. If this is not provided, it will create a new s3 bucket using `var.name` and other context related inputs"
0 commit comments