Skip to content

Bug: CloudFront distribution generation fails with None is not implemented for ResourceValue::Object #921

Open
@fibert

Description

@fibert

When trying to use cdk migrate on a CloudFormation template with a CloudFront distribution I get the following error:

 ❌  Migrate failed for `cloudfront`: CloudfrontStack could not be generated because None is not implemented for ResourceValue::Object
CloudfrontStack could not be generated because None is not implemented for ResourceValue::Object

I was not able to make it work no matter what attribute I deleted/changed.


My CloudFormation template was generate by CloudFormation IaC Generator, and contains the following:

Metadata:
  AWSToolsMetrics:
    IaC_Generator: "arn:aws:cloudformation:us-west-2:603049414067:generatedTemplate/1030d35e-5d21-4893-aa10-d89fb80c02f0"
Resources:
  CloudFrontDistribution:
    UpdateReplacePolicy: "Retain"
    Type: "AWS::CloudFront::Distribution"
    DeletionPolicy: "Retain"
    Properties:
      DistributionConfig:
        Logging:
          IncludeCookies: false
          Bucket: ""
          Prefix: ""
        Comment: "Resume website distribution"
        DefaultRootObject: "index.html"
        Origins:
        - ConnectionTimeout: 10
          OriginAccessControlId: "E1IZQ4O9MJQ4JU"
          ConnectionAttempts: 3
          OriginCustomHeaders: []
          DomainName: "resume-site-dev.s3.us-west-2.amazonaws.com"
          OriginShield:
            Enabled: false
          S3OriginConfig:
            OriginAccessIdentity: ""
          OriginPath: ""
          Id: "S3-resume-site-dev"
        - ConnectionTimeout: 10
          OriginAccessControlId: ""
          ConnectionAttempts: 3
          OriginCustomHeaders: []
          DomainName: "9n1ze3gbx0.execute-api.us-west-2.amazonaws.com"
          OriginShield:
            Enabled: false
          OriginPath: ""
          Id: "ApiGateway"
          CustomOriginConfig:
            OriginKeepaliveTimeout: 5
            OriginReadTimeout: 30
            OriginSSLProtocols:
            - "TLSv1.2"
            HTTPSPort: 443
            HTTPPort: 80
            OriginProtocolPolicy: "https-only"
        ViewerCertificate:
          MinimumProtocolVersion: "TLSv1"
          SslSupportMethod: "vip"
          CloudFrontDefaultCertificate: true
        PriceClass: "PriceClass_100"
        DefaultCacheBehavior:
          Compress: true
          FunctionAssociations: []
          LambdaFunctionAssociations: []
          TargetOriginId: "S3-resume-site-dev"
          ViewerProtocolPolicy: "redirect-to-https"
          GrpcConfig:
            Enabled: false
          TrustedSigners: []
          DefaultTTL: 3600
          FieldLevelEncryptionId: ""
          TrustedKeyGroups: []
          AllowedMethods:
          - "HEAD"
          - "GET"
          - "OPTIONS"
          CachedMethods:
          - "HEAD"
          - "GET"
          - "OPTIONS"
          SmoothStreaming: false
          ForwardedValues:
            QueryStringCacheKeys: []
            Cookies:
              Forward: "none"
            Headers: []
            QueryString: false
          MinTTL: 0
          MaxTTL: 86400
        Staging: false
        CustomErrorResponses:
        - ErrorCachingMinTTL: 10
          ResponseCode: 200
          ErrorCode: 404
          ResponsePagePath: "/index.html"
        ContinuousDeploymentPolicyId: ""
        OriginGroups:
          Quantity: 0
          Items: []
        Enabled: true
        Aliases: []
        IPV6Enabled: true
        WebACLId: ""
        HttpVersion: "http2"
        Restrictions:
          GeoRestriction:
            Locations: []
            RestrictionType: "none"
        CacheBehaviors:
        - Compress: false
          FunctionAssociations: []
          LambdaFunctionAssociations: []
          TargetOriginId: "ApiGateway"
          ViewerProtocolPolicy: "redirect-to-https"
          GrpcConfig:
            Enabled: false
          TrustedSigners: []
          DefaultTTL: 0
          FieldLevelEncryptionId: ""
          TrustedKeyGroups: []
          AllowedMethods:
          - "HEAD"
          - "GET"
          - "OPTIONS"
          PathPattern: "/api/*"
          CachedMethods:
          - "HEAD"
          - "GET"
          - "OPTIONS"
          SmoothStreaming: false
          ForwardedValues:
            QueryStringCacheKeys: []
            Cookies:
              Forward: "none"
            Headers:
            - "Origin"
            - "Access-Control-Request-Method"
            - "Access-Control-Request-Headers"
            QueryString: true
          MinTTL: 0
          MaxTTL: 0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions