Dagger
Search

secret-manager

Allow to create or read secret from GCP secret manager

Installation

dagger install github.com/Dudesons/daggerverse/secret-manager@v0.1.0

Entrypoint

Return Type
SecretManager
Example
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@41e1f414c163b6676acd03c184d37e3ec8a64b2b call \
 gcp \
 get-secret --name string --project string
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
NameTypeDefault ValueDescription
nameString !-The secret name to read
projectString !-The GCP project where the secret is stored
versionString "latest"The version of the secret to read
filePathFile -The path to a credentials json file
gcloudFolderDirectory -The path to the gcloud folder
Example
dagger -m github.com/Dudesons/daggerverse/secret-manager@41e1f414c163b6676acd03c184d37e3ec8a64b2b 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
NameTypeDefault ValueDescription
nameString !-The secret name to read
valueString !-The value to set to the secret
projectString !-The GCP project where the secret is stored
filePathFile -The path to a credentials json file
gcloudFolderDirectory -The path to the gcloud folder
Example
dagger -m github.com/Dudesons/daggerverse/secret-manager@41e1f414c163b6676acd03c184d37e3ec8a64b2b 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)
}