-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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_eks_cluster: Add support for PublicAccessCidrs attribute in VpcConfig #11442
Conversation
7e7be47
to
c0780b5
Compare
2de76fb
to
a67f062
Compare
e6fbf01
to
9f365c7
Compare
Rebased on master following merge of #11375, ready for review ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @seddarj 👋 Thank you for submitting this. The implementation looks great, just one testing change to ensure we cover updates of this attribute as well as ensuring the data source will work properly.
Thank you for the very detailed review @bflad. I've tried to accommodate all your remarks. Let me know if anything needs changing. |
f55b444
to
cf8e3cb
Compare
… to test for update case
cf8e3cb
to
45077b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi again 👋 When running the other acceptance tests for this resource, it looks like we need a slight tweak to how we send this parameter to prevent API errors. Hopefully last change needed. 🤞
Hi again @bflad, I've committed the changes regarding the case where the list is empty. Thanks for your patience and guidance! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the continued updates, @seddarj! The latest acceptance testing was still showing failures (noted below). Since this was close to completion and testing is lengthy, we went ahead and made the minor adjustments noted below so we can release this tomorrow. 🚀
Output from acceptance testing (after Computed: true
additions):
--- PASS: TestAccAWSEksCluster_basic (1221.74s)
--- PASS: TestAccAWSEksCluster_Tags (1277.77s)
--- PASS: TestAccAWSEksClusterDataSource_basic (1277.90s)
--- PASS: TestAccAWSEksCluster_Logging (1278.03s)
--- PASS: TestAccAWSEksCluster_VpcConfig_SecurityGroupIds (1295.59s)
--- PASS: TestAccAWSEksCluster_VpcConfig_PublicAccessCidrs (1422.58s)
--- PASS: TestAccAWSEksCluster_VpcConfig_EndpointPublicAccess (1905.76s)
--- PASS: TestAccAWSEksCluster_VpcConfig_EndpointPrivateAccess (2322.50s)
--- PASS: TestAccAWSEksCluster_Version (2450.83s)
@@ -114,6 +114,11 @@ func dataSourceAwsEksCluster() *schema.Resource { | |||
Computed: true, | |||
Elem: &schema.Schema{Type: schema.TypeString}, | |||
}, | |||
"public_access_cidrs": { | |||
Type: schema.TypeSet, | |||
Optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a configurable argument in the data source, so we should use Computed: true
instead.
Optional: true, | |
Computed: true, |
@@ -145,6 +145,14 @@ func resourceAwsEksCluster() *schema.Resource { | |||
MinItems: 1, | |||
Elem: &schema.Schema{Type: schema.TypeString}, | |||
}, | |||
"public_access_cidrs": { | |||
Type: schema.TypeSet, | |||
Optional: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that EKS provides a default 0.0.0.0/0
entry when this argument is not configured:
--- FAIL: TestAccAWSEksCluster_basic (1307.89s)
testing.go:640: Step 0 error: After applying this step, the plan was not empty:
DIFF:
UPDATE: aws_eks_cluster.test
... omitted for clarity ...
vpc_config.0.public_access_cidrs.#: "1" => "0"
vpc_config.0.public_access_cidrs.0: "0.0.0.0/0" => ""
... omitted for clarity ...
Given that the Terraform Plugin SDK currently does not support a way to configure a Default
for TypeList
/TypeSet
, our only recourse here is to add Computed: true
to this for now.
Optional: true, | |
Optional: true, | |
Computed: true, |
Reference: #11397 Reference: #11442 Output from acceptance testing: ``` --- PASS: TestAccAWSEksCluster_basic (1221.74s) --- PASS: TestAccAWSEksCluster_Tags (1277.77s) --- PASS: TestAccAWSEksClusterDataSource_basic (1277.90s) --- PASS: TestAccAWSEksCluster_Logging (1278.03s) --- PASS: TestAccAWSEksCluster_VpcConfig_SecurityGroupIds (1295.59s) --- PASS: TestAccAWSEksCluster_VpcConfig_PublicAccessCidrs (1422.58s) --- PASS: TestAccAWSEksCluster_VpcConfig_EndpointPublicAccess (1905.76s) --- PASS: TestAccAWSEksCluster_VpcConfig_EndpointPrivateAccess (2322.50s) --- PASS: TestAccAWSEksCluster_Version (2450.83s) ```
This has been released in version 2.44.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! |
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! |
Community Note
First time contributing to this project, let me know if anything needs changing.
This will only work once #11375 gets merged.#11375 has been merged, this PR has been rebased on master.Closes #11397
Release note for CHANGELOG:
Output from acceptance testing: