Skip to content

feat(VPCPeeringConnection): add support for custom resource and additional fields for Modify OP and auto-accepting #158

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

Merged
merged 161 commits into from
Dec 6, 2023

Conversation

marcdavoli
Copy link
Contributor

@marcdavoli marcdavoli commented Nov 23, 2023

Changes

This PR adds the vpcpeeringconnections custom resource via the standard code-generator output, but with a few custom additions:

  • Adds the possibility to use an ACK VPC resource as a Reference for the fields spec.vpcRef (instead of spec.vpcId) and spec.peerVpcRef (instead of spec.peerVpcId).
  • Adds the spec.accepterPeeringConnectionOptions and spec.requesterPeeringConnectionOptions fields, which come from the ModifyVpcPeeringConnectionOptions API call, to allow the use of the allowDnsResolutionFromRemoteVpc, AllowEgressFromLocalVpcToRemoteClassicLink and AllowEgressFromLocalClassicLinkToRemoteVpc sub-fields.
  • Adds the spec.acceptRequest (boolean) which will allow the VPC Peering Connection Request to automatically switch from status pending-acceptance to active without manual intervention. (Inspired by Crossplane's implementation (Ref))
  • Adds the field spec.routes.vpcPeeringConnectionRef to the Route Table CR

Note: In a separate PR, we add the fields spec.acceptVPCPeeringRequestsFromVPCID and spec.acceptVPCPeeringRequestsFromVPCRefs to the VPC CRD, to allow you to add a list of VPC's from which you'd like to automatically accept incoming VPC Peering requests from.

References

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ack-prow ack-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 23, 2023
Copy link

ack-prow bot commented Nov 23, 2023

Hi @marcdavoli. Thanks for your PR.

I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@a-hilaly
Copy link
Member

/ok-to-test

@ack-prow ack-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 23, 2023
@marcdavoli marcdavoli changed the title WIP: feat(vpcPeeringConnection): add custom resource with CRUD operations WIP: feat(vpcPeeringConnection): add custom resource with additional operations Nov 23, 2023
@marcdavoli marcdavoli changed the title WIP: feat(vpcPeeringConnection): add custom resource with additional operations WIP: feat(vpcPeeringConnection): add custom resource with additional fields Nov 23, 2023
Comment on lines +187 to +190
ModifyVpcPeeringConnectionOptions:
operation_type:
- Update
resource_name: VpcPeeringConnection
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixes the code-generator mapping of the sdkUpdate function to use ModifyVpcPeeringConnectionOptions (Ref) instead of UpdateVpcPeeringConnection (which doesn't exist)

Comment on lines +804 to +811
AccepterPeeringConnectionOptions:
from:
operation: ModifyVpcPeeringConnectionOptions
path: AccepterPeeringConnectionOptions
RequesterPeeringConnectionOptions:
from:
operation: ModifyVpcPeeringConnectionOptions
path: RequesterPeeringConnectionOptions
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These two fields are used by the ModifyVpcPeeringConnectionOptions API call, not the CreateVpcPeeringConnection call, but are represented as being natively part of the ACK resource.

Comment on lines 812 to 814
hooks:
sdk_update_post_build_request:
template_path: hooks/vpc_peering_connection/sdk_update_post_build_request.go.tpl
Copy link
Contributor Author

@marcdavoli marcdavoli Nov 23, 2023

Choose a reason for hiding this comment

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

This hook wires up 2 fields that exist in the resource's Spec to include them into the Update operation payload

  • AccepterPeeringConnectionOptions
  • RequesterPeeringConnectionOptions

Copy link
Member

@a-hilaly a-hilaly left a comment

Choose a reason for hiding this comment

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

Allez, cette fois, c'est la bonne!
Mercy buckets!!
/lgtm
/approve

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Dec 6, 2023
Copy link

ack-prow bot commented Dec 6, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a-hilaly, marcdavoli

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-prow ack-prow bot merged commit 0ab38d5 into aws-controllers-k8s:main Dec 6, 2023
ack-prow bot pushed a commit that referenced this pull request Dec 6, 2023
Issue #, if available:
- aws-controllers-k8s/community#1943

Description of changes:
This PR creates a release v1.1.0 for ec2-controller, following the merge of PR
- #158

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants