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

tests/provider: Replace deleted AWS Managed IAM Policy AmazonEC2SpotFleetRole, use data sources in those tests #10700

Merged
merged 1 commit into from
Nov 1, 2019

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Oct 31, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Release note for CHANGELOG:

NONE

Starting yesterday, October 30th, the AmazonEC2SpotFleetRole AWS managed IAM policy is no longer available, which was causing test failures:

--- FAIL: TestAccAWSAppautoScalingTarget_spotFleetRequest (605.77s)
    testing.go:615: Step 0 error: errors during apply:

        Error: Error attaching policy arn:aws:iam::aws:policy/service-role/AmazonEC2SpotFleetRole to IAM Role terraform-20191031031853283200000001: NoSuchEntity: Policy arn:aws:iam::aws:policy/service-role/AmazonEC2SpotFleetRole does not exist or is not attachable.

Here we switch to the newer AmazonEC2SpotFleetTaggingRole. While adjusting these tests anyways (such as the Batch base configuration), also fixed some other region/partition issues such as:

--- FAIL: TestAccAWSAppautoScalingTarget_emrCluster (64.87s)
    testing.go:615: Step 0 error: errors during apply:

        Error: Error waiting for EMR Cluster state to be "WAITING" or "RUNNING": TERMINATING: VALIDATION_ERROR: The requested instance type m3.xlarge is not supported in the requested availability zone. Learn more at https://docs.aws.amazon.com/console/elasticmapreduce/ERROR_noinstancetype

Output from acceptance testing:

--- PASS: TestAccAWSBatchComputeEnvironment_createSpotWithoutBidPercentage (21.92s)
--- PASS: TestAccAWSBatchComputeEnvironment_createEc2WithoutComputeResources (30.60s)
--- PASS: TestAccAWSBatchComputeEnvironment_createUnmanaged (53.53s)
--- PASS: TestAccAWSBatchComputeEnvironment_createEc2WithTags (53.69s)
--- PASS: TestAccAWSBatchComputeEnvironment_createSpot (58.61s)
--- PASS: TestAccAWSBatchComputeEnvironment_createUnmanagedWithComputeResources (59.71s)
--- PASS: TestAccAWSBatchComputeEnvironment_createEc2 (60.56s)
--- PASS: TestAccAWSAppautoScalingTarget_spotFleetRequest (70.48s)
--- PASS: TestAccAWSBatchComputeEnvironment_launchTemplate (71.45s)
--- PASS: TestAccAWSAppautoscalingScheduledAction_SpotFleet (73.48s)
--- PASS: TestAccAWSBatchComputeEnvironment_updateMaxvCpus (79.34s)
--- PASS: TestAccAWSAppautoScalingPolicy_spotFleetRequest (81.54s)
--- PASS: TestAccAWSBatchComputeEnvironment_updateInstanceType (81.85s)
--- PASS: TestAccAWSBatchComputeEnvironment_updateState (84.27s)
--- PASS: TestAccAWSBatchComputeEnvironment_updateComputeEnvironmentName (93.77s)
--- PASS: TestAccAWSAppautoscalingScheduledAction_EMR (376.28s)
--- PASS: TestAccAWSAppautoScalingTarget_emrCluster (437.48s)

…leetRole, use data sources in those tests

Starting yesterday, October 30th, the `AmazonEC2SpotFleetRole` AWS managed IAM policy is no longer available, which was causing test failures:

```
--- FAIL: TestAccAWSAppautoScalingTarget_spotFleetRequest (605.77s)
    testing.go:615: Step 0 error: errors during apply:

        Error: Error attaching policy arn:aws:iam::aws:policy/service-role/AmazonEC2SpotFleetRole to IAM Role terraform-20191031031853283200000001: NoSuchEntity: Policy arn:aws:iam::aws:policy/service-role/AmazonEC2SpotFleetRole does not exist or is not attachable.
```

Here we switch to the newer `AmazonEC2SpotFleetTaggingRole`. While adjusting these tests anyways (such as the Batch base configuration), also fixed some other region/partition issues such as:

```
--- FAIL: TestAccAWSAppautoScalingTarget_emrCluster (64.87s)
    testing.go:615: Step 0 error: errors during apply:

        Error: Error waiting for EMR Cluster state to be "WAITING" or "RUNNING": TERMINATING: VALIDATION_ERROR: The requested instance type m3.xlarge is not supported in the requested availability zone. Learn more at https://docs.aws.amazon.com/console/elasticmapreduce/ERROR_noinstancetype
```

Output from acceptance testing:

```
--- PASS: TestAccAWSBatchComputeEnvironment_createSpotWithoutBidPercentage (21.92s)
--- PASS: TestAccAWSBatchComputeEnvironment_createEc2WithoutComputeResources (30.60s)
--- PASS: TestAccAWSBatchComputeEnvironment_createUnmanaged (53.53s)
--- PASS: TestAccAWSBatchComputeEnvironment_createEc2WithTags (53.69s)
--- PASS: TestAccAWSBatchComputeEnvironment_createSpot (58.61s)
--- PASS: TestAccAWSBatchComputeEnvironment_createUnmanagedWithComputeResources (59.71s)
--- PASS: TestAccAWSBatchComputeEnvironment_createEc2 (60.56s)
--- PASS: TestAccAWSAppautoScalingTarget_spotFleetRequest (70.48s)
--- PASS: TestAccAWSBatchComputeEnvironment_launchTemplate (71.45s)
--- PASS: TestAccAWSAppautoscalingScheduledAction_SpotFleet (73.48s)
--- PASS: TestAccAWSBatchComputeEnvironment_updateMaxvCpus (79.34s)
--- PASS: TestAccAWSAppautoScalingPolicy_spotFleetRequest (81.54s)
--- PASS: TestAccAWSBatchComputeEnvironment_updateInstanceType (81.85s)
--- PASS: TestAccAWSBatchComputeEnvironment_updateState (84.27s)
--- PASS: TestAccAWSBatchComputeEnvironment_updateComputeEnvironmentName (93.77s)
--- PASS: TestAccAWSAppautoscalingScheduledAction_EMR (376.28s)
--- PASS: TestAccAWSAppautoScalingTarget_emrCluster (437.48s)
```
@bflad bflad requested a review from a team October 31, 2019 20:45
@ghost ghost added size/M Managed by automation to categorize the size of a PR. service/applicationautoscaling service/batch Issues and PRs that pertain to the batch service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Oct 31, 2019
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Oct 31, 2019
Copy link
Contributor

@ryndaniels ryndaniels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay 🚀

Test output:

--- PASS: TestAccAWSBatchComputeEnvironment_createEc2WithoutComputeResources (13.99s)
--- PASS: TestAccAWSBatchComputeEnvironment_createSpotWithoutBidPercentage (17.08s)
--- PASS: TestAccAWSBatchComputeEnvironment_createEc2 (43.06s)
--- PASS: TestAccAWSBatchComputeEnvironment_createUnmanagedWithComputeResources (44.66s)
--- PASS: TestAccAWSBatchComputeEnvironment_createUnmanaged (45.12s)
--- PASS: TestAccAWSBatchComputeEnvironment_launchTemplate (53.06s)
--- PASS: TestAccAWSBatchComputeEnvironment_createEc2WithTags (57.02s)
--- PASS: TestAccAWSBatchComputeEnvironment_updateState (57.35s)
--- PASS: TestAccAWSBatchComputeEnvironment_createSpot (57.56s)
--- PASS: TestAccAWSBatchComputeEnvironment_updateMaxvCpus (59.30s)
--- PASS: TestAccAWSBatchComputeEnvironment_updateComputeEnvironmentName (78.74s)
--- PASS: TestAccAWSBatchComputeEnvironment_updateInstanceType (79.88s)

--- PASS: TestAccAWSAppautoScalingTarget_multipleTargets (18.26s)
--- PASS: TestAccAWSAppautoScalingTarget_optionalRoleArn (20.31s)
--- PASS: TestAccAWSAppautoScalingPolicy_multiplePoliciesSameResource (22.36s)
--- PASS: TestAccAWSAppautoScalingPolicy_dynamoDb (22.64s)
--- PASS: TestAccAWSAppautoScalingPolicy_multiplePoliciesSameName (24.31s)
--- PASS: TestAccAWSAppautoScalingPolicy_disappears (54.33s)
--- PASS: TestAccAWSAppautoScalingTarget_spotFleetRequest (61.78s)
--- PASS: TestAccAWSAppautoScalingPolicy_spotFleetRequest (62.56s)
--- PASS: TestAccAWSAppautoScalingTarget_basic (63.97s)
--- PASS: TestAccAWSAppautoScalingPolicy_basic (67.99s)
--- PASS: TestAccAWSAppautoScalingPolicy_scaleOutAndIn (70.91s)
--- PASS: TestAccAWSAppautoScalingPolicy_ResourceId_ForceNew (78.37s)
--- PASS: TestAccAWSAppautoScalingTarget_emrCluster (448.09s)

@ryndaniels ryndaniels removed the needs-triage Waiting for first response or review from a maintainer. label Nov 1, 2019
@bflad bflad added this to the v2.35.0 milestone Nov 1, 2019
@bflad bflad merged commit f86a941 into master Nov 1, 2019
@bflad bflad deleted the t-AmazonEC2SpotFleetRole-replacement branch November 1, 2019 12:45
@ghost
Copy link

ghost commented Nov 7, 2019

This has been released in version 2.35.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Mar 29, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/batch Issues and PRs that pertain to the batch service. size/M Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants