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

feat(tgw): added ec2 tgw & tgw-vpc-attachment #831

Merged
merged 1 commit into from
Dec 14, 2021

Conversation

haarchri
Copy link
Member

@haarchri haarchri commented Sep 13, 2021

Signed-off-by: Christopher Haar chhaar30@googlemail.com

Description of your changes

  • implements ec2 tgw (transitgateway)
  • implements ec2 tgw-vpc-attachment (transitgateway-vpc-attachment)

transitgateway:

 kubectl describe transitgateway.ec2.aws.crossplane.io/tgw  
Name:         tgw
Namespace:    
Labels:       <none>
Annotations:  crossplane.io/external-create-pending: 2021-12-13T21:52:07+01:00
              crossplane.io/external-create-succeeded: 2021-12-13T21:52:07+01:00
              crossplane.io/external-name: tgw-0cf9ff0c1a0e88782
API Version:  ec2.aws.crossplane.io/v1alpha1
Kind:         TransitGateway
Metadata:
  Creation Timestamp:  2021-12-13T20:52:06Z
  Finalizers:
    finalizer.managedresource.crossplane.io
  Generation:  3
  Managed Fields:
    API Version:  ec2.aws.crossplane.io/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .:
          f:kubectl.kubernetes.io/last-applied-configuration:
      f:spec:
        .:
        f:deletionPolicy:
        f:forProvider:
          .:
          f:region:
        f:providerConfigRef:
          .:
          f:name:
    Manager:      kubectl-client-side-apply
    Operation:    Update
    Time:         2021-12-13T20:52:06Z
    API Version:  ec2.aws.crossplane.io/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          f:crossplane.io/external-create-pending:
          f:crossplane.io/external-create-succeeded:
          f:crossplane.io/external-name:
        f:finalizers:
          .:
          v:"finalizer.managedresource.crossplane.io":
      f:spec:
        f:forProvider:
          f:options:
            .:
            f:amazonSideASN:
            f:autoAcceptSharedAttachments:
            f:defaultRouteTableAssociation:
            f:defaultRouteTablePropagation:
            f:dnsSupport:
            f:multicastSupport:
            f:vpnECMPSupport:
          f:tags:
      f:status:
        .:
        f:atProvider:
          .:
          f:creationTime:
          f:ownerID:
          f:state:
          f:transitGatewayARN:
          f:transitGatewayID:
        f:conditions:
    Manager:         provider
    Operation:       Update
    Time:            2021-12-13T20:52:07Z
  Resource Version:  1607723
  UID:               a7f67c80-87be-4e5f-a2c9-ba8e83cf52e7
Spec:
  Deletion Policy:  Delete
  For Provider:
    Options:
      Amazon Side ASN:                  64512
      Auto Accept Shared Attachments:   disable
      Default Route Table Association:  enable
      Default Route Table Propagation:  enable
      Dns Support:                      enable
      Multicast Support:                disable
      Vpn ECMP Support:                 enable
    Region:                             us-east-1
    Tags:
      Key:    crossplane-kind
      Value:  transitgateway.ec2.aws.crossplane.io
      Key:    crossplane-name
      Value:  tgw
      Key:    crossplane-providerconfig
      Value:  example
  Provider Config Ref:
    Name:  example
Status:
  At Provider:
    Creation Time:        2021-12-13T20:52:07Z
    Owner ID:             255932642927
    State:                available
    Transit Gateway ARN:  arn:aws:ec2:us-east-1:255932642927:transit-gateway/tgw-0cf9ff0c1a0e88782
    Transit Gateway ID:   tgw-0cf9ff0c1a0e88782
  Conditions:
    Last Transition Time:  2021-12-13T20:54:09Z
    Reason:                Available
    Status:                True
    Type:                  Ready
    Last Transition Time:  2021-12-13T20:52:07Z
    Reason:                ReconcileSuccess
    Status:                True
    Type:                  Synced
Events:

transitgateway-vpc-attachment:

kubectl describe transitgatewayvpcattachment.ec2.aws.crossplane.io/tgw-vpc-attach 
Name:         tgw-vpc-attach
Namespace:    
Labels:       <none>
Annotations:  crossplane.io/external-create-pending: 2021-12-13T21:55:06+01:00
              crossplane.io/external-create-succeeded: 2021-12-13T21:55:08+01:00
              crossplane.io/external-name: tgw-attach-03fb604eaeeaef23e
API Version:  ec2.aws.crossplane.io/v1alpha1
Kind:         TransitGatewayVPCAttachment
Metadata:
  Creation Timestamp:  2021-12-13T20:55:06Z
  Finalizers:
    finalizer.managedresource.crossplane.io
  Generation:  3
  Managed Fields:
    API Version:  ec2.aws.crossplane.io/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .:
          f:kubectl.kubernetes.io/last-applied-configuration:
      f:spec:
        .:
        f:deletionPolicy:
        f:forProvider:
          .:
          f:region:
          f:subnetIdsRefs:
          f:transitGatewayIdRef:
            .:
            f:name:
          f:vpcIdRef:
            .:
            f:name:
        f:providerConfigRef:
          .:
          f:name:
    Manager:      kubectl-client-side-apply
    Operation:    Update
    Time:         2021-12-13T20:55:06Z
    API Version:  ec2.aws.crossplane.io/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          f:crossplane.io/external-create-pending:
          f:crossplane.io/external-create-succeeded:
          f:crossplane.io/external-name:
        f:finalizers:
          .:
          v:"finalizer.managedresource.crossplane.io":
      f:spec:
        f:forProvider:
          f:subnetIds:
          f:tags:
          f:transitGatewayId:
          f:vpcId:
      f:status:
        .:
        f:atProvider:
          .:
          f:creationTime:
          f:state:
          f:subnetIDs:
          f:transitGatewayAttachmentID:
          f:transitGatewayID:
          f:vpcID:
          f:vpcOwnerID:
        f:conditions:
    Manager:         provider
    Operation:       Update
    Time:            2021-12-13T20:55:08Z
  Resource Version:  1608221
  UID:               1f8aef5a-2676-4215-9fc8-8f6d94809426
Spec:
  Deletion Policy:  Delete
  For Provider:
    Region:  us-east-1
    Subnet Ids:
      subnet-0bea8bdb2151f4fbe
      subnet-04be0211e759fb076
    Subnet Ids Refs:
      Name:  sample-subnet1
      Name:  sample-subnet2
    Tags:
      Key:               crossplane-kind
      Value:             transitgatewayvpcattachment.ec2.aws.crossplane.io
      Key:               crossplane-name
      Value:             tgw-vpc-attach
      Key:               crossplane-providerconfig
      Value:             example
    Transit Gateway Id:  tgw-0cf9ff0c1a0e88782
    Transit Gateway Id Ref:
      Name:  tgw
    Vpc Id:  vpc-0557e8b3073ddddad
    Vpc Id Ref:
      Name:  sample-vpc
  Provider Config Ref:
    Name:  example
Status:
  At Provider:
    Creation Time:  2021-12-13T20:55:08Z
    State:          available
    Subnet I Ds:
      subnet-0bea8bdb2151f4fbe
      subnet-04be0211e759fb076
    Transit Gateway Attachment ID:  tgw-attach-03fb604eaeeaef23e
    Transit Gateway ID:             tgw-0cf9ff0c1a0e88782
    Vpc ID:                         vpc-0557e8b3073ddddad
    Vpc Owner ID:                   255932642927
  Conditions:
    Last Transition Time:  2021-12-13T20:57:09Z
    Reason:                Available
    Status:                True
    Type:                  Ready
    Last Transition Time:  2021-12-13T20:55:08Z
    Reason:                ReconcileSuccess
    Status:                True
    Type:                  Synced

Fixes #363 #750

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

@AaronME
Copy link
Collaborator

AaronME commented Sep 24, 2021

@haarchri Is this still WIP or ready for review?

@AaronME AaronME self-assigned this Sep 24, 2021
@haarchri haarchri changed the title WIP: feat(tgw): added ec2 tgw & tgw-vpc-attachment feat(tgw): added ec2 tgw & tgw-vpc-attachment Sep 24, 2021
@haarchri
Copy link
Member Author

@AaronME ready for review - thanks for the hint in the topic description

@haarchri
Copy link
Member Author

still blocked by #920

@haarchri haarchri force-pushed the ec2-transitgateway branch 4 times, most recently from 2162f08 to 66bc94e Compare December 10, 2021 13:56
@haarchri
Copy link
Member Author

rebased & tested again after #920 was merged

NAME                                       READY   SYNCED   EXTERNAL-NAME
transitgateway.ec2.aws.crossplane.io/tgw   True    True     tgw-0d0013ce6d364d20b

NAME                                                               READY   SYNCED   EXTERNAL-NAME
transitgatewayvpcattachment.ec2.aws.crossplane.io/tgw-vpc-attach   True    True     tgw-attach-0bc3d1f136a3368a3

Copy link
Member

@muvaf muvaf left a comment

Choose a reason for hiding this comment

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

I have a few comments but I think we'll get to merge it before the release.

apis/ec2/v1alpha1/custom_types.go Show resolved Hide resolved
apis/ec2/v1alpha1/custom_types.go Outdated Show resolved Hide resolved
pkg/controller/ec2/transitgateway/setup.go Outdated Show resolved Hide resolved
pkg/controller/ec2/transitgateway/setup.go Outdated Show resolved Hide resolved
pkg/controller/ec2/transitgatewayvpcattachment/setup.go Outdated Show resolved Hide resolved
pkg/controller/ec2/transitgatewayvpcattachment/setup.go Outdated Show resolved Hide resolved
@haarchri
Copy link
Member Author

haarchri commented Dec 13, 2021

@muvaf changed your suggestions
also fir VPCPeeringConnection, added Tagger and changed the fields to lower camel, changed to generated referencers ;)

Copy link
Member

@muvaf muvaf left a comment

Choose a reason for hiding this comment

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

I have a couple of comments but LGTM in general. As synced, having VPCPeeringConnection changes in a separate PR would be better.

apis/ec2/v1alpha1/custom_types.go Outdated Show resolved Hide resolved
apis/ec2/v1alpha1/custom_types.go Outdated Show resolved Hide resolved
apis/ec2/v1alpha1/custom_types.go Outdated Show resolved Hide resolved
examples/ec2/transitgatewayvpcattachment.yaml Outdated Show resolved Hide resolved
pkg/controller/ec2/transitgatewayvpcattachment/setup.go Outdated Show resolved Hide resolved
pkg/controller/ec2/vpcpeeringconnection/setup.go Outdated Show resolved Hide resolved
apis/ec2/v1alpha1/custom_types.go Outdated Show resolved Hide resolved
Signed-off-by: haarchri <chhaar30@googlemail.com>
@haarchri
Copy link
Member Author

i will open fullow up PR for cleanup vpc_peering_connection - thanks for review

@haarchri haarchri merged commit 8e2b6d8 into crossplane-contrib:master Dec 14, 2021
tektondeploy pushed a commit to gtn3010/provider-aws that referenced this pull request Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for AWS TransitGateway and TransitGatewayAttachment
3 participants