Skip to content

Commit e882361

Browse files
Use acm module instead of awscli (#145)
* Use acm module instead of awscli * Auto Format * Update README.yaml * Auto Format Co-authored-by: cloudpossebot <[email protected]>
1 parent bf9ec67 commit e882361

File tree

2 files changed

+80
-2
lines changed

2 files changed

+80
-2
lines changed

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,46 @@ module "cdn" {
133133

134134
### Generating ACM Certificate
135135

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)
136+
```hcl
137+
# For cloudfront, the acm has to be created in us-east-1 or it will not work
138+
provider "aws" {
139+
region = "us-east-1"
140+
alias = "aws.us-east-1"
141+
}
142+
143+
# create acm and explicitly set it to us-east-1 provider
144+
module "acm_request_certificate" {
145+
source = "cloudposse/acm-request-certificate/aws"
146+
providers = {
147+
aws = aws.us-east-1
148+
}
149+
150+
# Cloud Posse recommends pinning every module to a specific version
151+
# version = "x.x.x"
152+
domain_name = "example.com"
153+
subject_alternative_names = ["a.example.com", "b.example.com", "*.c.example.com"]
154+
process_domain_validation_options = true
155+
ttl = "300"
156+
}
157+
158+
module "cdn" {
159+
source = "cloudposse/cloudfront-s3-cdn/aws"
160+
# Cloud Posse recommends pinning every module to a specific version
161+
# version = "x.x.x"
162+
namespace = "eg"
163+
stage = "prod"
164+
name = "app"
165+
aliases = ["assets.cloudposse.com"]
166+
dns_alias_enabled = true
167+
parent_zone_name = "cloudposse.com"
168+
169+
acm_certificate_arn = module.acm_request_certificate.arn
170+
171+
depends_on = [module.acm_request_certificate]
172+
}
173+
```
174+
175+
Or use the AWS cli to [request new ACM certifiates](http://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request.html) (requires email validation)
137176
```
138177
aws acm request-certificate --domain-name example.com --subject-alternative-names a.example.com b.example.com *.c.example.com
139178
```

README.yaml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,46 @@ usage: |-
9595
9696
### Generating ACM Certificate
9797
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)
98+
```hcl
99+
# For cloudfront, the acm has to be created in us-east-1 or it will not work
100+
provider "aws" {
101+
region = "us-east-1"
102+
alias = "aws.us-east-1"
103+
}
104+
105+
# create acm and explicitly set it to us-east-1 provider
106+
module "acm_request_certificate" {
107+
source = "cloudposse/acm-request-certificate/aws"
108+
providers = {
109+
aws = aws.us-east-1
110+
}
111+
112+
# Cloud Posse recommends pinning every module to a specific version
113+
# version = "x.x.x"
114+
domain_name = "example.com"
115+
subject_alternative_names = ["a.example.com", "b.example.com", "*.c.example.com"]
116+
process_domain_validation_options = true
117+
ttl = "300"
118+
}
119+
120+
module "cdn" {
121+
source = "cloudposse/cloudfront-s3-cdn/aws"
122+
# Cloud Posse recommends pinning every module to a specific version
123+
# version = "x.x.x"
124+
namespace = "eg"
125+
stage = "prod"
126+
name = "app"
127+
aliases = ["assets.cloudposse.com"]
128+
dns_alias_enabled = true
129+
parent_zone_name = "cloudposse.com"
130+
131+
acm_certificate_arn = module.acm_request_certificate.arn
132+
133+
depends_on = [module.acm_request_certificate]
134+
}
135+
```
136+
137+
Or use the AWS cli to [request new ACM certifiates](http://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request.html) (requires email validation)
99138
```
100139
aws acm request-certificate --domain-name example.com --subject-alternative-names a.example.com b.example.com *.c.example.com
101140
```

0 commit comments

Comments
 (0)