0

Using troposhphere, I am trying to add CustomOriginConfig to my CloudFront distribution.

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

This fails to build, giving the following error:

CustomOriginConfig(
    ^
SyntaxError: positional argument follows keyword argument 

I have looked at this and this and I think that my syntax is correct.

What do I need to do to fix this?

Jez D
  • 25
  • 8

1 Answers1

0

You need to create a variable, whose value is the CustomOriginConfig object

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