HashiCorpVaultConnection

Stores information and configuration for the access to a HashiCorp Vault.

Example. Adds a new Connection that allows TeamCity to connect to a HashiCorpVault using AppRole

project {
// Other Project settings ...
features {
// Other Project Features ...
        hashiCorpVaultConnection {
id = "PROJECT_ID"
name = "HashiCorp Vault"
authMethod = appRole {
endpointPath = "approle"
roleId = "id"
secretId = "credentialsJSON:ee2362ab-33fb-40bd-b49b-e77c4a45e978"
}
}
}
}

Example. Adds a new Connection that allows TeamCity to connect to a HashiCorpVault using AppRole. It defines it own parameter namespace and a respective vault namespace.

project {
// Other Project settings ...
features {
// Other Project Features ...
        hashiCorpVaultConnection {
id = "PROJECT_ID"
name = "HashiCorp Vault"
vaultId = "other-namespace"
vaultNamespace = "other"
authMethod = appRole {
endpointPath = "approle"
roleId = "id"
secretId = "credentialsJSON:ee2362ab-33fb-40bd-b49b-e77c4a45e978"
}
}
}
}

Example. Adds a new Connection that allows TeamCity to connect to a HashiCorpVault using LDAP

project {
// Other Project settings ...
features {
// Other Project Features ...
        hashiCorpVaultConnection {
id = "PROJECT_ID"
name = "HashiCorp Vault"
authMethod = ldap {
path = "path"
username = "username"
password = "credentialsJSON:636e34b4-d02e-4f27-9d12-141f75e8832b"
}
}
}
}

Example. Adds a new Connection that allows TeamCity to connect to a HashiCorpVault using GCP IAM, relying on default GCP credentials and the default Vault path

project {
// Other Project settings ...
features {
// Other Project Features ...
        hashiCorpVaultConnection {
id = "PROJECT_ID"
name = "HashiCorp Vault"
authMethod = gcpIam {
gcpVaultRole = "role"
}
}
}
}

Example. Adds a new Connection that allows TeamCity to connect to a HashiCorpVault using GCP IAM, using a service account and a custom mount path

project {
// Other Project settings ...
features {
// Other Project Features ...
        hashiCorpVaultConnection {
id = "PROJECT_ID"
name = "HashiCorp Vault"
authMethod = gcpIam {
gcpVaultRole = "role"
gcpServiceAccount = "gcpSericeAccount"
gcpEndpointPath = "customVaultMountPath"
}
}
}
}

See also

Constructors

Link copied to clipboard
constructor(init: HashiCorpVaultConnection.() -> Unit)
constructor()

Types

Link copied to clipboard

Properties

Link copied to clipboard

The way how to obtain credentials (just provide the keys, assume IAM role or other)

Link copied to clipboard

Whether to fail builds in case of parameter resolving error

Link copied to clipboard
var id: String?

Project feature id, if not specified will be generated

Link copied to clipboard
var name: String?

HashiCorp Vault connection display name

Link copied to clipboard

Vault ID. Should be provided in case of multiple vault connections

Link copied to clipboard
Link copied to clipboard

Project feature type

Link copied to clipboard
var url: String?

Vault URL

Link copied to clipboard

Vault ID. Should be provided in case of multiple vault connections

Link copied to clipboard

HashiCorp Vault namespace that the auth method and secrets engines are housed under.

Functions

Link copied to clipboard
fun booleanParameter(customName: String? = null, trueValue: String? = "true", falseValue: String? = "false"): DelegateProvider<Boolean?>
Link copied to clipboard
fun clear()
Link copied to clipboard
fun <T : CompoundParam<T>> compoundParameter(customName: String? = null): DelegateProvider<T>
Link copied to clipboard
fun <T : Parametrized> copyParamsTo(target: T): T

Copies parameters of this object to the specified target

Link copied to clipboard

Creates an instance of this project feature via reflection using a no argument constructor, used during copying. Throws an error if this class doesn't have a default constructor. Subclasses can override it to create an instance without using a default constructor.

Link copied to clipboard
fun doubleParameter(customName: String? = null): DelegateProvider<Double>
Link copied to clipboard
fun <E : Enum<E>> enumParameter(customName: String? = null, mapping: Map<E, String?>? = null): DelegateProvider<E>
Link copied to clipboard
fun findRawParam(paramName: String): Parameter?
Link copied to clipboard
fun hasParam(paramName: String): Boolean
Link copied to clipboard
fun intParameter(customName: String? = null): DelegateProvider<Int>
Link copied to clipboard
fun param(name: String, value: String)

Adds parameter with specified name and value

Link copied to clipboard
fun removeRawParam(paramName: String)
Link copied to clipboard
open fun stringParameter(customName: String? = null): DelegateProvider<String>
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun validate(consumer: ErrorConsumer)

Validates this object and reports found errors to the provided consumer