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

Support referencing SA created for roleset in roleset binding definition #112

Open
willdeuschle opened this issue Jun 8, 2021 · 0 comments

Comments

@willdeuschle
Copy link

willdeuschle commented Jun 8, 2021

We would like to apply the roles/iam.serviceAccountTokenCreator role to the service account created for a roleset. This is needed to perform an IAM login against vault, among other things.

This is not possible today because the service account is created after the roleset is created (meaning we have no way to reference it when defining the roleset). Instead, we have to bind the role to our entire project, which is overly permissive. For example:

resource "//cloudresourcemanager.googleapis.com/projects/my-project" {
  roles = [
    "roles/iam.serviceAccountTokenCreator",
  ]
}

The addition I'm proposing would be a special reference to the service account being created for a roleset. For example, the roleset binding could look like:

resource "$ROLESET_SERVICE_ACCOUNT" {
  roles = [
    "roles/iam.serviceAccountTokenCreator",
  ]
}

After creating the service account, while creating the IAM policies, the plugin would substitute the service account resource it just created in place of$ROLESET_SERVICE_ACCOUNT.

Is this a contribution that would be accepted?

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

No branches or pull requests

1 participant