在对流层中,如何添加CustomOriginConfig对象

时间:2019-07-13 05:49:08

标签: amazon-cloudfront troposphere

在troposhphere,我试图将CustomOriginConfig添加到我的CloudFront发行版中。

.....
Origins = [Origin(
                Id = Join("", ["cloudfront-", Ref("ParamOriginName")]),
                DomainName = Ref("ParamOriginName"),
                CustomOriginConfig(
                    OriginProtocolPolicy = "https-only",
                    OriginSSLProtocols = ["TLSv1.1"]
                )
            )],
.....

这无法建立,并给出以下错误:

CustomOriginConfig(
    ^
SyntaxError: positional argument follows keyword argument 

我看过thisthis,但我认为我的语法是正确的。

该如何解决?

1 个答案:

答案 0 :(得分:0)

您需要创建一个变量,其值为CustomOriginConfig对象

Origins = [Origin(
              Id = Join("", ["cloudfront-", Ref("ParamOriginName")]),
              DomainName = Ref("ParamOriginName"),
              CustomOriginConfig = CustomOriginConfig(
                  OriginProtocolPolicy = "https-only",
                  OriginSSLProtocols = ["TLSv1.1"]
              )
          )],