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

service/eks: Fix testing and eks-getting-started example for EKS API change #13323

Merged
merged 2 commits into from
May 19, 2020

Conversation

bflad
Copy link
Contributor

@bflad bflad commented May 14, 2020

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" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request

Closes #13071
Reference: https://aws.amazon.com/blogs/containers/upcoming-changes-to-ip-assignment-for-eks-managed-node-groups/
Reference: awslabs/amazon-eks-ami#423

Release note for CHANGELOG:

NONE

This also switches the ReleaseVersion testing to use the newly available SSM Parameter, so it is no longer hardcoded and stale.

Previously:

--- FAIL: TestAccAWSEksNodeGroup_basic (1278.58s)
testing.go:683: Step 0 error: errors during apply:
Error: error waiting for EKS Node Group (tf-acc-test-8344543808745629148:tf-acc-test-8344543808745629148) creation: Ec2SubnetInvalidConfiguration: One or more Amazon EC2 Subnets of [subnet-09e307c552d8e2396, subnet-09b4b4c79ae9b1c5a] for node group tf-acc-test-8344543808745629148 does not automatically assign public IP addresses to instances launched into it. If you want your instances to be assigned a public IP address, then you need to enable auto-assign public IP address for the subnet. See IP addressing in VPC guide: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html#subnet-public-ip. Resource IDs: [subnet-09e307c552d8e2396 subnet-09b4b4c79ae9b1c5a]

--- FAIL: TestAccAWSEksNodeGroup_ReleaseVersion (1129.51s)
testing.go:683: Step 0 error: errors during apply:
Error: error creating EKS Node Group (tf-acc-test-395161592184105116:tf-acc-test-395161592184105116): InvalidParameterException: releaseVersion 1.14.8-20191213 is invalid

Output from acceptance testing:

--- PASS: TestAccAWSEksNodeGroup_AmiType (1539.44s)
--- PASS: TestAccAWSEksNodeGroup_basic (1485.68s)
--- PASS: TestAccAWSEksNodeGroup_disappears (1425.45s)
--- PASS: TestAccAWSEksNodeGroup_DiskSize (1551.75s)
--- PASS: TestAccAWSEksNodeGroup_InstanceTypes (1545.64s)
--- PASS: TestAccAWSEksNodeGroup_Labels (1647.48s)
--- PASS: TestAccAWSEksNodeGroup_ReleaseVersion (1578.86s)
--- PASS: TestAccAWSEksNodeGroup_RemoteAccess_Ec2SshKey (1566.70s)
--- PASS: TestAccAWSEksNodeGroup_RemoteAccess_SourceSecurityGroupIds (1698.65s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_DesiredSize (1619.70s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_MaxSize (1610.20s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_MinSize (1551.41s)
--- PASS: TestAccAWSEksNodeGroup_Tags (1501.53s)
--- PASS: TestAccAWSEksNodeGroup_Version (1513.24s)

…change

Reference: #13071
Reference: https://aws.amazon.com/blogs/containers/upcoming-changes-to-ip-assignment-for-eks-managed-node-groups/
Reference: awslabs/amazon-eks-ami#423

This also switches the ReleaseVersion testing to use the newly available SSM Parameter, so it is no longer hardcoded and stale.

Previously:

```
--- FAIL: TestAccAWSEksNodeGroup_basic (1278.58s)
testing.go:683: Step 0 error: errors during apply:
Error: error waiting for EKS Node Group (tf-acc-test-8344543808745629148:tf-acc-test-8344543808745629148) creation: Ec2SubnetInvalidConfiguration: One or more Amazon EC2 Subnets of [subnet-09e307c552d8e2396, subnet-09b4b4c79ae9b1c5a] for node group tf-acc-test-8344543808745629148 does not automatically assign public IP addresses to instances launched into it. If you want your instances to be assigned a public IP address, then you need to enable auto-assign public IP address for the subnet. See IP addressing in VPC guide: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html#subnet-public-ip. Resource IDs: [subnet-09e307c552d8e2396 subnet-09b4b4c79ae9b1c5a]

--- FAIL: TestAccAWSEksNodeGroup_ReleaseVersion (1129.51s)
testing.go:683: Step 0 error: errors during apply:
Error: error creating EKS Node Group (tf-acc-test-395161592184105116:tf-acc-test-395161592184105116): InvalidParameterException: releaseVersion 1.14.8-20191213 is invalid
```

Output from acceptance testing:

```
--- PASS: TestAccAWSEksNodeGroup_AmiType (1539.44s)
--- PASS: TestAccAWSEksNodeGroup_basic (1485.68s)
--- PASS: TestAccAWSEksNodeGroup_disappears (1425.45s)
--- PASS: TestAccAWSEksNodeGroup_DiskSize (1551.75s)
--- PASS: TestAccAWSEksNodeGroup_InstanceTypes (1545.64s)
--- PASS: TestAccAWSEksNodeGroup_Labels (1647.48s)
--- PASS: TestAccAWSEksNodeGroup_ReleaseVersion (1578.86s)
--- PASS: TestAccAWSEksNodeGroup_RemoteAccess_Ec2SshKey (1566.70s)
--- PASS: TestAccAWSEksNodeGroup_RemoteAccess_SourceSecurityGroupIds (1698.65s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_DesiredSize (1619.70s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_MaxSize (1610.20s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_MinSize (1551.41s)
--- PASS: TestAccAWSEksNodeGroup_Tags (1501.53s)
--- PASS: TestAccAWSEksNodeGroup_Version (1513.24s)
```
@bflad bflad requested a review from a team May 14, 2020 17:38
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/eks Issues and PRs that pertain to the eks service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels May 14, 2020
@anGie44 anGie44 self-assigned this May 19, 2020
@anGie44
Copy link
Contributor

anGie44 commented May 19, 2020

changes to the tests in question LGTM @bflad 👍
though there seems to still be a test failure in TC for TestAccAWSEksNodeGroup_Version with the error:

Error: error creating EKS Node Group (tf-acc-test-1420558841397012520:tf-acc-test-1420558841397012520): InvalidParameterException: Nodegroup Kubernetes version should be equal to Cluster kubernetes version 1.16 or be behind be 1

is it possible it's another flaky one or a similar change to using an ssm_parameter data_sources's value might be needed since version # is harcoded atm to 1.14? ah nvm the version depends on the eks cluster's (and that's already at the default latest)..hmm I guess depends on the goal of the test then -- if it's just to explicitly provide the param can we pass in the cluster's?

Output of acceptance tests:

--- PASS: TestAccAWSEksNodeGroup_disappears (1519.01s)
--- PASS: TestAccAWSEksNodeGroup_basic (1532.55s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_MaxSize (1547.71s)
--- PASS: TestAccAWSEksNodeGroup_InstanceTypes (1609.66s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_DesiredSize (1621.78s)
--- PASS: TestAccAWSEksNodeGroup_Labels (1658.07s)
--- PASS: TestAccAWSEksNodeGroup_Tags (1663.08s)
--- PASS: TestAccAWSEksNodeGroup_DiskSize (1663.61s)
--- PASS: TestAccAWSEksNodeGroup_RemoteAccess_Ec2SshKey (1709.18s)
--- PASS: TestAccAWSEksNodeGroup_ReleaseVersion (1741.83s)
--- PASS: TestAccAWSEksNodeGroup_RemoteAccess_SourceSecurityGroupIds (1744.18s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_MinSize (1798.05s)
--- PASS: TestAccAWSEksNodeGroup_AmiType (1816.58s)
--- FAIL: TestAccAWSEksNodeGroup_Version (1240.51s)

@bflad
Copy link
Contributor Author

bflad commented May 19, 2020

@anGie44 I'm guessing that failure is new since the release of 1.16 support in EKS. I can try to fix that unrelated test failure as well, just involves more unrelated changes.

Copy link
Contributor

@anGie44 anGie44 left a comment

Choose a reason for hiding this comment

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

ah gotcha, then for the purpose of the changes in this PR, I approve 😄

…om aws_eks_cluster reference

The EKS Cluster would spin up with the latest Kubernetes version while the Node Group could be hardcoded multiple behind. The EKS API unfortunately does not provide a lookup API for versioning yet.

Previously:

```
Error: error creating EKS Node Group (tf-acc-test-1420558841397012520:tf-acc-test-1420558841397012520): InvalidParameterException: Nodegroup Kubernetes version should be equal to Cluster kubernetes version 1.16 or be behind be 1
```

Output from acceptance testing:

```
--- PASS: TestAccAWSEksNodeGroup_Version (1630.32s)
```
@ghost ghost added size/M Managed by automation to categorize the size of a PR. and removed size/XS Managed by automation to categorize the size of a PR. labels May 19, 2020
@bflad
Copy link
Contributor Author

bflad commented May 19, 2020

41d88be fixes the version test 👍

@bflad bflad added this to the v2.63.0 milestone May 19, 2020
@bflad bflad merged commit c7e86a4 into master May 19, 2020
@bflad bflad deleted the t-aws_eks_node_group-public-ip-and-ssm branch May 19, 2020 18:55
@ghost
Copy link

ghost commented May 22, 2020

This has been released in version 2.63.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!

adamdecaf pushed a commit to adamdecaf/terraform-provider-aws that referenced this pull request May 28, 2020
…change (hashicorp#13323)

* service/eks: Fix testing and eks-getting-started example for EKS API change

Reference: hashicorp#13071
Reference: https://aws.amazon.com/blogs/containers/upcoming-changes-to-ip-assignment-for-eks-managed-node-groups/
Reference: awslabs/amazon-eks-ami#423

This also switches the ReleaseVersion testing to use the newly available SSM Parameter, so it is no longer hardcoded and stale.

Previously:

```
--- FAIL: TestAccAWSEksNodeGroup_basic (1278.58s)
testing.go:683: Step 0 error: errors during apply:
Error: error waiting for EKS Node Group (tf-acc-test-8344543808745629148:tf-acc-test-8344543808745629148) creation: Ec2SubnetInvalidConfiguration: One or more Amazon EC2 Subnets of [subnet-09e307c552d8e2396, subnet-09b4b4c79ae9b1c5a] for node group tf-acc-test-8344543808745629148 does not automatically assign public IP addresses to instances launched into it. If you want your instances to be assigned a public IP address, then you need to enable auto-assign public IP address for the subnet. See IP addressing in VPC guide: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-ip-addressing.html#subnet-public-ip. Resource IDs: [subnet-09e307c552d8e2396 subnet-09b4b4c79ae9b1c5a]

--- FAIL: TestAccAWSEksNodeGroup_ReleaseVersion (1129.51s)
testing.go:683: Step 0 error: errors during apply:
Error: error creating EKS Node Group (tf-acc-test-395161592184105116:tf-acc-test-395161592184105116): InvalidParameterException: releaseVersion 1.14.8-20191213 is invalid
```

Output from acceptance testing:

```
--- PASS: TestAccAWSEksNodeGroup_AmiType (1539.44s)
--- PASS: TestAccAWSEksNodeGroup_basic (1485.68s)
--- PASS: TestAccAWSEksNodeGroup_disappears (1425.45s)
--- PASS: TestAccAWSEksNodeGroup_DiskSize (1551.75s)
--- PASS: TestAccAWSEksNodeGroup_InstanceTypes (1545.64s)
--- PASS: TestAccAWSEksNodeGroup_Labels (1647.48s)
--- PASS: TestAccAWSEksNodeGroup_ReleaseVersion (1578.86s)
--- PASS: TestAccAWSEksNodeGroup_RemoteAccess_Ec2SshKey (1566.70s)
--- PASS: TestAccAWSEksNodeGroup_RemoteAccess_SourceSecurityGroupIds (1698.65s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_DesiredSize (1619.70s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_MaxSize (1610.20s)
--- PASS: TestAccAWSEksNodeGroup_ScalingConfig_MinSize (1551.41s)
--- PASS: TestAccAWSEksNodeGroup_Tags (1501.53s)
--- PASS: TestAccAWSEksNodeGroup_Version (1513.24s)
```

* tests/resource/aws_eks_node_group: Fix version test to use version from aws_eks_cluster reference

The EKS Cluster would spin up with the latest Kubernetes version while the Node Group could be hardcoded multiple behind. The EKS API unfortunately does not provide a lookup API for versioning yet.

Previously:

```
Error: error creating EKS Node Group (tf-acc-test-1420558841397012520:tf-acc-test-1420558841397012520): InvalidParameterException: Nodegroup Kubernetes version should be equal to Cluster kubernetes version 1.16 or be behind be 1
```

Output from acceptance testing:

```
--- PASS: TestAccAWSEksNodeGroup_Version (1630.32s)
```
@ghost
Copy link

ghost commented Jun 19, 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 Jun 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/eks Issues and PRs that pertain to the eks 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.

eks-getting-started guide is broken
2 participants