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_iam_policy: Ensure description is properly read during creation #5884

Merged
merged 1 commit into from
Sep 14, 2018

Commits on Sep 14, 2018

  1. resource/aws_iam_policy: Ensure description is properly read during c…

    …reation
    
    This resource was previously not following best practices of calling the read function after creation. Now it will read back information from the API, which tangentally fixes the description not being available in the CreatePolicy response.
    
    Changes:
    * Create separate acceptance tests for all arguments
    * Call read function after create and update functions
    * Create `testAccCheckResourceAttrGlobalARN` for checking global ARN attributes
    * Remove extraneous aws/import_aws_iam_policy_test.go
    
    Previously (before code updates):
    
    ```
    === RUN   TestAccAWSIAMPolicy_basic
    --- PASS: TestAccAWSIAMPolicy_basic (10.15s)
    === RUN   TestAccAWSIAMPolicy_description
    --- FAIL: TestAccAWSIAMPolicy_description (5.06s)
        testing.go:527: Step 0 error: Check failed: Check 2/2 error: aws_iam_policy.test: Attribute 'description' expected "description1", got ""
    === RUN   TestAccAWSIAMPolicy_namePrefix
    --- PASS: TestAccAWSIAMPolicy_namePrefix (9.72s)
    === RUN   TestAccAWSIAMPolicy_path
    --- PASS: TestAccAWSIAMPolicy_path (9.85s)
    === RUN   TestAccAWSIAMPolicy_policy
    --- PASS: TestAccAWSIAMPolicy_policy (13.49s)
    ```
    
    Now:
    
    ```
    === RUN   TestAccAWSIAMPolicy_basic
    --- PASS: TestAccAWSIAMPolicy_basic (10.29s)
    === RUN   TestAccAWSIAMPolicy_description
    --- PASS: TestAccAWSIAMPolicy_description (8.00s)
    === RUN   TestAccAWSIAMPolicy_namePrefix
    --- PASS: TestAccAWSIAMPolicy_namePrefix (9.15s)
    === RUN   TestAccAWSIAMPolicy_path
    --- PASS: TestAccAWSIAMPolicy_path (9.25s)
    === RUN   TestAccAWSIAMPolicy_policy
    --- PASS: TestAccAWSIAMPolicy_policy (15.21s)
    ```
    bflad committed Sep 14, 2018
    Configuration menu
    Copy the full SHA
    d149602 View commit details
    Browse the repository at this point in the history