Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resource/aws_cloudfront_distribution: Fix active_trusted_signers attribute for Terraform 0.12 #10013

Merged
merged 3 commits into from
Sep 6, 2019

Commits on Sep 5, 2019

  1. resource/aws_cloudfront_distribution: Fix active_trusted_signers at…

    …tribute for Terraform 0.12
    
    Reference: #8902
    
    This attribute implemented a legacy Terraform library (`flatmap`), which does not work with Terraform 0.12's data types and whose only usage was on this single attribute. This was missed during the Terraform 0.12 upgrade since there were no covering acceptance tests and the CloudFront setup itself is fairly esoteric (requires root AWS account login to manage CloudFront Keys).
    
    The attribute now correctly implements (in the closest approximation) the standard Terraform Provider SDK types and methodology for saved nested object data to the Terraform state. The `items` subattribute list is now accessible again in Terraform 0.12. It does, however, unavoidably switch the root `active_trusted_signers` attribute to `TypeList` instead of `TypeMap` (which does not support map elements of different types in the current Terraform Provider SDK), so any potential references to nested attributes will need to be changed in user configurations, e.g.
    
    Previously:
    
    ```
    aws_cloudfront_distribution.example.active_trusted_signers.enabled
    ```
    
    Now:
    
    ```
    aws_cloudfront_distribution.example.active_trusted_signers.0.enabled
    ```
    
    Output from acceptance testing:
    
    ```
    --- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_TrustedSigners (611.33s)
    ```
    bflad committed Sep 5, 2019
    Configuration menu
    Copy the full SHA
    ebdc976 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cad90e6 View commit details
    Browse the repository at this point in the history
  3. resource/aws_cloudfront_distribution: Ensure we are catching d.Set("a…

    …ctive_trusted_signers", ...) error
    
    Output from acceptance testing:
    
    ```
    --- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_TrustedSigners
    ```
    bflad committed Sep 5, 2019
    Configuration menu
    Copy the full SHA
    1c2b6f4 View commit details
    Browse the repository at this point in the history