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

1063: Write IAM Role ARN to connection secret if secret ref is given #1776

Conversation

stevenhammerton
Copy link

Description of your changes

Adds the ARN for a Role to ConnectionDetails in external observations so that it gets published if a connection secret is requested.

Fixes #1063

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

Unit test amended

Tested on local development environment using the following role and confirmed the connection secret contained the correct arn.

apiVersion: iam.aws.crossplane.io/v1beta1
kind: Role
metadata:
  name: "test-role"
spec:
  forProvider:
    description: Test Role Desc
    assumeRolePolicyDocument: |
      {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Principal": {
                    "Service": [
                        "ec2.amazonaws.com"
                    ]
                },
                "Action": [
                    "sts:AssumeRole"
                ]
            }
        ]
      }
    tags:
      - key: ManagedBy
        value: crossplane/provider-aws
  writeConnectionSecretToRef:
    name: "test-role-connection"
    namespace: "default"
kubectl get secret test-role-connection -o jsonpath='{.data.arn}' | base64 --decode
arn:aws:iam::xxxxxxxxxxxx:role/test-role

Copy link
Collaborator

@MisterMX MisterMX left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks a lot @stevenhammerton.

@MisterMX MisterMX merged commit 49f83fd into crossplane-contrib:master Jun 15, 2023
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.

IAM CRDs not saving values to Secrets (writeConnectionSecretToRef)
3 participants