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

Dataplex lake iam #692

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Chloe-Carayon
Copy link

@Chloe-Carayon Chloe-Carayon commented Jan 8, 2025

Description of your changes

This PR add new resources for Dataplex Lake IAM: LakeIAMPolicy.

Fixes: #687

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

I run manual tests as we are creating IAM policies for existing users so I commented all upjet.upbound.io/manual-intervention annotations.

Note: all roles used need to be Dataplex Predefined roles.

LakeIAMPolicy

export UPTEST_EXAMPLE_LIST="examples/dataplex/v1beta1/lakeiampolicy.yaml"
make e2e

Results:
Capture d’écran 2025-01-17 à 23 59 25

kubectl create -f examples/dataplex/v1beta1/lakeiampolicy.yaml -n upbound-system
kubectl get managed
Capture d’écran 2025-01-18 à 00 05 51

Notes
Following discussion below, LakeIAMBinding and LakeIAMMember won't be implemented.

Copy link
Collaborator

@turkenf turkenf left a comment

Choose a reason for hiding this comment

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

Hey @Chloe-Carayon,

Congratulations on your first contribution! Your PR description is very clear, and you’ve shared the test results in great detail. Thank you for this thoughtful contribution!

Could you please review the discussion in this thread and update your PR by removing the *_iam_binding, *_iam_member resources?

Copy link
Collaborator

@turkenf turkenf left a comment

Choose a reason for hiding this comment

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

Hi @Chloe-Carayon,

I left a few review comments for you to consider. It would be great if you could test the latest status after making the changes and update the PR description. Thank you!

@@ -426,6 +426,8 @@ var terraformPluginSDKExternalNameConfigs = map[string]config.ExternalName{
//
// Imported by using the following format: projects/{{project}}/locations/{{location}}/lakes/{{name}}
"google_dataplex_lake": config.TemplatedStringAsIdentifier("name", "projects/{{ .setup.configuration.project }}/locations/{{ .parameters.location }}/lakes/{{ .external_name }}"),
// Imported by using the following format: projects/{{project}}/locations/{{location}}/lakes/{{lake}}
"google_dataplex_lake_iam_policy": config.TemplatedStringAsIdentifier("", "projects/{{ .setup.configuration.project }}/locations/{{ .parameters.location }}/lakes/{{ .external_name }}"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

When importing this source we use the format .......... /lakes/{{lake}} and we have the lake parameter, so it would be safer to use the following configuration.

Suggested change
"google_dataplex_lake_iam_policy": config.TemplatedStringAsIdentifier("", "projects/{{ .setup.configuration.project }}/locations/{{ .parameters.location }}/lakes/{{ .external_name }}"),
"google_dataplex_lake_iam_policy": config.TemplatedStringAsIdentifier("", "projects/{{ .setup.configuration.project }}/locations/{{ .parameters.location }}/lakes/{{ .parameters.lake }}"),

Also here the location parameter is optional but since we use this parameter in external name configuration it would be better to mark it as required, example configuration:

r.MarkAsRequired("location")

Copy link
Author

@Chloe-Carayon Chloe-Carayon Jan 17, 2025

Choose a reason for hiding this comment

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

Thank you, I updated the configuration, regenerate the resources and tested e2e.

kind: Lake
metadata:
annotations:
meta.upbound.io/example-id: dataplex/v1beta1/lake
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you please add a manual-intervention annotation here as well?

my-second-lake: exists
location: us-central1
---
apiVersion: dataplex.gcp.upbound.io/v1beta1
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: In our examples' YAML files, we put the main resource at the beginning. Not a blocker, but it would be good.

Copy link
Author

Choose a reason for hiding this comment

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

I update the example thanks :) !

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.

Request for Dataplex Lake IAM
2 participants