crossplane-contrib / provider-aws

Crossplane AWS Provider
Apache License 2.0
428 stars 367 forks source link

Validation error updating Cloudfront distribution #2007

Closed djimenez-savi closed 4 months ago

djimenez-savi commented 7 months ago

What happened?

Having created successfully a Cloudfront distribution and then trying to update the Distribution I am getting multiple validation errors.

  • missing required field, UpdateDistributionInput.DistributionConfig.Aliases.Quantity.
  • missing required field, UpdateDistributionInput.DistributionConfig.CacheBehaviors.Quantity.
  • missing required field, UpdateDistributionInput.DistributionConfig.CustomErrorResponses.Quantity.
  • missing required field, UpdateDistributionInput.DistributionConfig.DefaultCacheBehavior.ForwardedValues.QueryStringCacheKeys.Quantity.
  • missing required field, UpdateDistributionInput.DistributionConfig.DefaultCacheBehavior.FunctionAssociations.Quantity.
  • missing required field, UpdateDistributionInput.DistributionConfig.DefaultCacheBehavior.LambdaFunctionAssociations.Quantity.
  • missing required field, UpdateDistributionInput.DistributionConfig.DefaultCacheBehavior.TrustedKeyGroups.Quantity.
  • missing required field, UpdateDistributionInput.DistributionConfig.DefaultCacheBehavior.TrustedSigners.Quantity.
  • missing required field, UpdateDistributionInput.DistributionConfig.OriginGroups.Quantity.
  • missing required field, UpdateDistributionInput.DistributionConfig.Origins.Items[1].CustomHeaders.Quantity.
  • missing required field, UpdateDistributionInput.DistributionConfig.Restrictions.GeoRestriction.Quantity.

How can we reproduce it?

Create a Distribution applying the following manifest:

apiVersion: cloudfront.aws.crossplane.io/v1alpha1
kind: Distribution
metadata:
  name: distribution-example
spec:
  deletionPolicy: Delete
  forProvider:
    distributionConfig:
      comment: distribution-example
      defaultCacheBehavior:
        allowedMethods:
          cachedMethods:
            items:
              - GET
              - HEAD
          items:
            - DELETE
            - GET
            - POST
            - HEAD
            - OPTIONS
            - PATCH
            - PUT
        compress: false
        defaultTTL: 86400
        fieldLevelEncryptionID: ""
        forwardedValues:
          cookies:
            forward: all
          queryString: true
        maxTTL: 31536000
        minTTL: 0
        smoothStreaming: false
        targetOriginID: S3-coupon-templates
        viewerProtocolPolicy: redirect-to-https
      defaultRootObject: ""
      enabled: true
      httpVersion: http2
      isIPV6Enabled: true
      logging:
        bucket: ""
        enabled: false
        includeCookies: false
        prefix: ""
      origins:
        items:
          - connectionAttempts: 3
            connectionTimeout: 10
            domainName: valassis-sandbox-coupon-templates.s3.eu-west-1.amazonaws.com
            id: S3-coupon-templates
            originPath: ""
            originShield:
              enabled: false
            s3OriginConfig:
              originAccessIdentity: ""
      priceClass: PriceClass_All
      viewerCertificate:
        certificateSource: cloudfront
        cloudFrontDefaultCertificate: true
        minimumProtocolVersion: TLSv1
        sslSupportMethod: vip
      webACLID: ""
    region: eu-west-1
  providerConfigRef:
    name: default

Then modify any field, for example the comments field, reapply the manifest and see that the CR is not Synced and the errors are shown in the events.

What environment did it happen in?

github-actions[bot] commented 4 months ago

Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as stale because it has had no activity in the last 90 days. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

B1T3X commented 3 months ago

I have the same issue. After creating the distribution, you can no longer update it. Specifying a 0 quantity as written in the documentation does not work.

B1T3X commented 3 months ago

/fresh