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

awsproviderlint: Enforce kms_key_id as ARN attribute in AWSAT001 check #13996

Merged
merged 1 commit into from
Jun 30, 2020

Commits on Jun 30, 2020

  1. awsproviderlint: Enforce kms_key_id as ARN attribute in AWSAT001 check

    Previously, test failures could include these outside AWS Commercial:
    
    ```
    --- FAIL: TestAccAWSEBSSnapshot_withKms (88.99s)
    testing.go:684: Step 0 error: Check failed: Check 2/2 error: aws_ebs_snapshot.test: Attribute 'kms_key_id' didn't match "^arn:aws:kms:[a-z]{2}-[a-z]+-\\d{1}:[0-9]{12}:key/[a-z0-9-]{36}$", got "arn:aws-us-gov:kms:us-gov-west-1:123456789012:key/59dff49a-68bc-407d-959c-deb91757d55b"
    ```
    
    New AWSAT001 check test failures:
    
    ```
    aws/resource_aws_db_instance_test.go:187:6: AWSAT001: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)
    aws/resource_aws_ebs_snapshot_test.go:127:6: AWSAT001: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)
    aws/resource_aws_fsx_windows_file_system_test.go:92:6: AWSAT001: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)
    aws/resource_aws_rds_cluster_instance_test.go:207:6: AWSAT001: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)
    ```
    
    Output from acceptance testing in AWS Commercial:
    
    ```
    --- PASS: TestAccAWSEBSSnapshot_withKms (41.72s)
    --- PASS: TestAccAWSDBInstance_kmsKey (486.55s)
    --- PASS: TestAccAWSRDSClusterInstance_kmsKey (691.04s)
    ```
    
    Output from acceptance testing in AWS GovCloud (US) (hardcoded AZ and service availability PreCheck test failures will be separately addressed in the future):
    
    ```
    --- PASS: TestAccAWSEBSSnapshot_withKms (60.17s)
    --- PASS: TestAccAWSDBInstance_kmsKey (479.81s)
    
    --- FAIL: TestAccAWSRDSClusterInstance_kmsKey (17.37s)
        TestAccAWSRDSClusterInstance_kmsKey: testing.go:684: Step 0 error: errors during apply:
    
            Error: error creating RDS cluster: InvalidVPCNetworkStateFault: Availability zones '[us-west-2a, us-west-2b, us-west-2c]' are unavailable in this region, please choose another zone set.
    
    --- FAIL: TestAccAWSFsxWindowsFileSystem_basic (1743.81s)
        TestAccAWSFsxWindowsFileSystem_basic: testing.go:684: Step 0 error: errors during apply:
    
            Error: Error creating FSx filesystem: RequestError: send request failed
            caused by: Post "https://fsx.us-gov-west-1.amazonaws.com/": dial tcp: lookup fsx.us-gov-west-1.amazonaws.com: no such host
    ```
    bflad committed Jun 30, 2020
    Configuration menu
    Copy the full SHA
    e09408f View commit details
    Browse the repository at this point in the history