Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

feat(pc): add assumeRoleARN to providerConfig like "native" provider-aws #160

Merged

Conversation

haarchri
Copy link
Member

@haarchri haarchri commented Feb 6, 2022

Signed-off-by: haarchri [email protected]

Description of your changes

  • bumped dependency pro provider-aws ("native" provider-aws) to v0.23.0
  • added assumeRoleARN to providerConfig like "native" provider-aws

Fixes #155

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

  • created more examples for providerConfig
  • tested implementation with vpc resources
NAME                                                 READY   SYNCED   EXTERNAL-NAME           AGE
vpc.ec2.aws.jet.crossplane.io/sample-vpc             True    True     vpc-0bb9c4f22bdd776c0   51m
vpc.ec2.aws.jet.crossplane.io/sample-vpc-account-b   True    True     vpc-00471f9f33edc62b7   61m

account-a Owner Id: 255932642927

kubectl describe vpc.ec2.aws.jet.crossplane.io/sample-vpc 
Name:         sample-vpc
Namespace:    
Labels:       <none>
Annotations:  crossplane.io/external-create-pending: 2022-02-06T15:41:08+01:00
              crossplane.io/external-create-succeeded: 2022-02-06T15:41:22+01:00
              crossplane.io/external-name: vpc-0bb9c4f22bdd776c0
              terrajet.crossplane.io/provider-meta: {"schema_version":"1"}
API Version:  ec2.aws.jet.crossplane.io/v1alpha2
Kind:         VPC
Metadata:
  Creation Timestamp:  2022-02-06T14:32:20Z
  Finalizers:
    finalizer.managedresource.crossplane.io
  Generation:  3
    Manager:         provider
    Operation:       Update
    Time:            2022-02-06T14:41:46Z
  Resource Version:  1757467
  UID:               79581aab-1908-4752-8533-031a891e0e5a
Spec:
  Deletion Policy:  Delete
  For Provider:
    Cidr Block:          172.16.0.0/16
    Enable Dns Support:  true
    Instance Tenancy:    default
    Region:              us-west-1
    Tags:
      Name:                         DemoVpc
      Crossplane - Kind:            vpc.ec2.aws.jet.crossplane.io
      Crossplane - Name:            sample-vpc
      Crossplane - Providerconfig:  default
  Provider Config Ref:
    Name:  default
Status:
  At Provider:
    Arn:                        arn:aws:ec2:us-west-1:255932642927:vpc/vpc-0bb9c4f22bdd776c0
    Default Network Acl Id:     acl-0b6622090ce512dda
    Default Route Table Id:     rtb-0e27241fc822f3f17
    Default Security Group Id:  sg-05e34ee414fc79173
    Dhcp Options Id:            dopt-02d501b1ca2f363d2
    Id:                         vpc-0bb9c4f22bdd776c0
    ipv6AssociationId:          
    ipv6CidrBlock:              
    Main Route Table Id:        rtb-0e27241fc822f3f17
    Owner Id:                   255932642927
    Tags All:
      Name:                         DemoVpc
      Crossplane - Kind:            vpc.ec2.aws.jet.crossplane.io
      Crossplane - Name:            sample-vpc
      Crossplane - Providerconfig:  default
  Conditions:
    Last Transition Time:  2022-02-06T14:41:22Z
    Reason:                ReconcileSuccess
    Status:                True
    Type:                  Synced
    Last Transition Time:  2022-02-06T14:41:32Z
    Reason:                Available
    Status:                True
    Type:                  Ready
    Last Transition Time:  2022-02-06T14:41:32Z
    Reason:                Finished
    Status:                True
    Type:                  AsyncOperation

account-b Owner Id: 436715084175

 kubectl describe vpc.ec2.aws.jet.crossplane.io/sample-vpc-account-b 
Name:         sample-vpc-account-b
Namespace:    
Labels:       <none>
Annotations:  crossplane.io/external-create-pending: 2022-02-06T16:22:30+01:00
              crossplane.io/external-create-succeeded: 2022-02-06T16:22:45+01:00
              crossplane.io/external-name: vpc-00471f9f33edc62b7
              terrajet.crossplane.io/provider-meta: {"schema_version":"1"}
API Version:  ec2.aws.jet.crossplane.io/v1alpha2
Kind:         VPC
Metadata:
  Creation Timestamp:  2022-02-06T15:22:20Z
  Finalizers:
    finalizer.managedresource.crossplane.io
  Generation:  3
  Resource Version:  1762395
  UID:               15dc7dd5-3199-482b-a24c-624b5ae077c2
Spec:
  Deletion Policy:  Delete
  For Provider:
    Cidr Block:          172.16.0.0/16
    Enable Dns Support:  true
    Instance Tenancy:    default
    Region:              us-west-1
    Tags:
      Name:                         AccountB
      Crossplane - Kind:            vpc.ec2.aws.jet.crossplane.io
      Crossplane - Name:            sample-vpc-account-b
      Crossplane - Providerconfig:  aws-jet-provider-account-b
  Provider Config Ref:
    Name:  aws-jet-provider-account-b
Status:
  At Provider:
    Arn:                        arn:aws:ec2:us-west-1:436715084175:vpc/vpc-00471f9f33edc62b7
    Default Network Acl Id:     acl-0853ab9703095eb5e
    Default Route Table Id:     rtb-050468ab8ecdb5518
    Default Security Group Id:  sg-0eb8334c20c86e856
    Dhcp Options Id:            dopt-f5ea3393
    Id:                         vpc-00471f9f33edc62b7
    ipv6AssociationId:          
    ipv6CidrBlock:              
    Main Route Table Id:        rtb-050468ab8ecdb5518
    Owner Id:                   436715084175
    Tags All:
      Name:                         AccountB
      Crossplane - Kind:            vpc.ec2.aws.jet.crossplane.io
      Crossplane - Name:            sample-vpc-account-b
      Crossplane - Providerconfig:  aws-jet-provider-account-b
  Conditions:
    Last Transition Time:  2022-02-06T15:22:56Z
    Reason:                Available
    Status:                True
    Type:                  Ready
    Last Transition Time:  2022-02-06T15:22:45Z
    Reason:                ReconcileSuccess
    Status:                True
    Type:                  Synced
    Last Transition Time:  2022-02-06T15:22:56Z
    Reason:                Finished
    Status:                True
    Type:                  AsyncOperation
Events:
  Type    Reason                   Age   From                                                  Message
  ----    ------                   ----  ----                                                  -------
  Normal  CreatedExternalResource  58s   managed/ec2.aws.jet.crossplane.io/v1alpha2, kind=vpc  Successfully requested creation of external resource

@@ -0,0 +1,24 @@
## How can assumeRoleARN be used with provider-jet-aws ?
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to just redirect people to https://github.com/crossplane/provider-aws/blob/master/AUTHENTICATION.md ? I think we fully cover all methods now, right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes could be also one option externalID is missing since we will add this with v0.24 ;) but then yes

Copy link
Member Author

Choose a reason for hiding this comment

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

@muvaf so i can remove the md and add a link in readme ?

Choose a reason for hiding this comment

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

Just to avoid confusion, I think it's better to have this doc in this repo instead of redirecting the users to different repo.

Copy link
Member

Choose a reason for hiding this comment

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

@vara-bonthu Good point. We can possibly copy the doc from there and change all provider-aws references to provider-jet-aws because it's more extensive and covers more cases.

@bobh66
Copy link

bobh66 commented Feb 21, 2022

@muvaf I need this capability too - is there anything I can do to help get this merged? Thanks

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.

Thanks @haarchri !

@haarchri
Copy link
Member Author

@muvaf can we get this in and cut a new release the days ? then we can start using jet provider

@muvaf muvaf merged commit 333b9cc into crossplane-contrib:main Feb 28, 2022
@paul-benetis
Copy link

Why do I not see assumeRoleARN as a spec property in the ProviderConfig CRD for this provider? Even the API documentation doesn't list it.

@haarchri
Copy link
Member Author

this PR is not included in any official release - next is v0.5.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is there anyway to use assumeRole?
5 participants