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

add kubernetes_secret datasource #243

Merged

Conversation

Stelminator
Copy link
Contributor

adds data_source_kubernetes_secret

fixes: #241

example use case:

resource "kubernetes_service_account" "example" {
  metadata {
    name = "terraform-example"
  }
}

data "kubernetes_secret" "example" {
  metadata = {
    name      = "${kubernetes_service_account.example.default_secret_name}"
    namespace = "${kubernetes_service_account.example.metadata.0.namespace}"
  }
}

output "token" {
  value = "${lookup(data.kubernetes_secret.example.data, "token", "")}"
}

adds data_source_kubernetes_secret

hashicorp#241

example use case:
```
resource "kubernetes_service_account" "example" {
  metadata {
    name = "terraform-example"
  }
}

data "kubernetes_secret" "example" {
  metadata = {
    name      = "${kubernetes_service_account.example.default_secret_name}"
    namespace = "${kubernetes_service_account.example.metadata.0.namespace}"
  }
}

output "token" {
  value = "${lookup(data.kubernetes_secret.example.data, "token", "")}"
}
```
@ghost ghost added size/M and removed size/S labels Dec 5, 2018
@ghost ghost added the documentation label Dec 5, 2018
@Stelminator
Copy link
Contributor Author

I know the docs commit says "WIP", but after a second pass, I'm not sure there's anything left to change.

Copy link
Member

@alexsomesan alexsomesan left a comment

Choose a reason for hiding this comment

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

LGTM
Thank you

@alexsomesan alexsomesan merged commit 22be064 into hashicorp:master Dec 13, 2018
@Stelminator Stelminator deleted the datasource_kubernetes_secret branch December 13, 2018 17:49
@ghost ghost locked and limited conversation to collaborators Apr 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Service Account secret values
2 participants