File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -182,21 +182,26 @@ export class WebServer extends pulumi.ComponentResource {
182182 { parent : this , dependsOn : [ this . lb ] } ,
183183 ) ;
184184
185+ const defaultAction = this . certificate
186+ ? {
187+ type : 'redirect' ,
188+ redirect : {
189+ port : '443' ,
190+ protocol : 'HTTPS' ,
191+ statusCode : 'HTTP_301' ,
192+ } ,
193+ }
194+ : {
195+ type : 'forward' ,
196+ targetGroupArn : lbTargetGroup . arn ,
197+ } ;
198+
185199 const lbHttpListener = new aws . lb . Listener (
186200 `${ this . name } -lb-listener-80` ,
187201 {
188202 loadBalancerArn : lb . arn ,
189203 port : 80 ,
190- defaultActions : [
191- {
192- type : 'redirect' ,
193- redirect : {
194- port : '443' ,
195- protocol : 'HTTPS' ,
196- statusCode : 'HTTP_301' ,
197- } ,
198- } ,
199- ] ,
204+ defaultActions : [ defaultAction ] ,
200205 tags : commonTags ,
201206 } ,
202207 { parent : this } ,
You can’t perform that action at this time.
0 commit comments