secret-manager
Allow to create or read secret from GCP secret manager
Installation
dagger install github.com/Dudesons/daggerverse/secret-manager@v0.2.0
Entrypoint
Return Type
SecretManager
Example
dagger -m github.com/Dudesons/daggerverse/secret-manager@5a0943df5ceca43ab24309e5331f0bac26208a58 call \
func (m *myModule) example() *SecretManager {
return dag.
SecretManager()
}
@function
def example() -> dag.SecretManager:
return (
dag.secret_manager()
)
@func()
example(): SecretManager {
return dag
.secretManager()
}
Types
SecretManager 🔗
gcp() 🔗
Return Type
SecretManagerGcpSecretManager !
Example
dagger -m github.com/Dudesons/daggerverse/secret-manager@5a0943df5ceca43ab24309e5331f0bac26208a58 call \
gcp
func (m *myModule) example() *SecretManagerGcpSecretManager {
return dag.
SecretManager().
Gcp()
}
@function
def example() -> dag.SecretManagerGcpSecretManager:
return (
dag.secret_manager()
.gcp()
)
@func()
example(): SecretManagerGcpSecretManager {
return dag
.secretManager()
.gcp()
}
SecretManagerGcpSecretManager 🔗
getSecret() 🔗
Read a secret from secret manager
Return Type
Secret !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | The secret name to read |
project | String ! | - | The GCP project where the secret is stored |
version | String | "latest" | The version of the secret to read |
filePath | File | - | The path to a credentials json file |
gcloudFolder | Directory | - | The path to the gcloud folder |
Example
dagger -m github.com/Dudesons/daggerverse/secret-manager@5a0943df5ceca43ab24309e5331f0bac26208a58 call \
gcp \
get-secret --name string --project string
func (m *myModule) example(name string, project string) *Secret {
return dag.
SecretManager().
Gcp().
GetSecret(name, project)
}
@function
def example(name: str, project: str) -> dagger.Secret:
return (
dag.secret_manager()
.gcp()
.get_secret(name, project)
)
@func()
example(name: string, project: string): Secret {
return dag
.secretManager()
.gcp()
.getSecret(name, project)
}
setSecret() 🔗
Create or update a secret value
Return Type
String !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
name | String ! | - | The secret name to read |
value | String ! | - | The value to set to the secret |
project | String ! | - | The GCP project where the secret is stored |
filePath | File | - | The path to a credentials json file |
gcloudFolder | Directory | - | The path to the gcloud folder |
Example
dagger -m github.com/Dudesons/daggerverse/secret-manager@5a0943df5ceca43ab24309e5331f0bac26208a58 call \
gcp \
set-secret --name string --value string --project string
func (m *myModule) example(ctx context.Context, name string, value string, project string) string {
return dag.
SecretManager().
Gcp().
SetSecret(ctx, name, value, project)
}
@function
async def example(name: str, value: str, project: str) -> str:
return await (
dag.secret_manager()
.gcp()
.set_secret(name, value, project)
)
@func()
async example(name: string, value: string, project: string): Promise<string> {
return dag
.secretManager()
.gcp()
.setSecret(name, value, project)
}