artifactory.VaultConfiguration
Explore with Pulumi AI
This resource enables you to configure an external vault connector to use as a centralized secret management tool for the keys used to sign packages. For more information, see JFrog documentation. This feature is supported with Enterprise X and Enterprise+ licenses.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as artifactory from "@pulumi/artifactory";
import * as std from "@pulumi/std";
const my_vault_config_app_role = new artifactory.VaultConfiguration("my-vault-config-app-role", {
name: "my-vault-config-app-role",
config: {
url: "http://127.0.0.1:8200",
auth: {
type: "AppRole",
roleId: "1b62ff05...",
secretId: "acbd6657...",
},
mounts: [{
path: "secret",
type: "KV2",
}],
},
});
const my_vault_config_cert = new artifactory.VaultConfiguration("my-vault-config-cert", {
name: "my-vault-config-cert",
config: {
url: "http://127.0.0.1:8200",
auth: {
type: "Certificate",
certificate: std.file({
input: "samples/public.pem",
}).then(invoke => invoke.result),
certificateKey: std.file({
input: "samples/private.pem",
}).then(invoke => invoke.result),
},
mounts: [{
path: "secret",
type: "KV2",
}],
},
});
import pulumi
import pulumi_artifactory as artifactory
import pulumi_std as std
my_vault_config_app_role = artifactory.VaultConfiguration("my-vault-config-app-role",
name="my-vault-config-app-role",
config={
"url": "http://127.0.0.1:8200",
"auth": {
"type": "AppRole",
"role_id": "1b62ff05...",
"secret_id": "acbd6657...",
},
"mounts": [{
"path": "secret",
"type": "KV2",
}],
})
my_vault_config_cert = artifactory.VaultConfiguration("my-vault-config-cert",
name="my-vault-config-cert",
config={
"url": "http://127.0.0.1:8200",
"auth": {
"type": "Certificate",
"certificate": std.file(input="samples/public.pem").result,
"certificate_key": std.file(input="samples/private.pem").result,
},
"mounts": [{
"path": "secret",
"type": "KV2",
}],
})
package main
import (
"github.com/pulumi/pulumi-artifactory/sdk/v8/go/artifactory"
"github.com/pulumi/pulumi-std/sdk/go/std"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := artifactory.NewVaultConfiguration(ctx, "my-vault-config-app-role", &artifactory.VaultConfigurationArgs{
Name: pulumi.String("my-vault-config-app-role"),
Config: &artifactory.VaultConfigurationConfigArgs{
Url: pulumi.String("http://127.0.0.1:8200"),
Auth: &artifactory.VaultConfigurationConfigAuthArgs{
Type: pulumi.String("AppRole"),
RoleId: pulumi.String("1b62ff05..."),
SecretId: pulumi.String("acbd6657..."),
},
Mounts: artifactory.VaultConfigurationConfigMountArray{
&artifactory.VaultConfigurationConfigMountArgs{
Path: pulumi.String("secret"),
Type: pulumi.String("KV2"),
},
},
},
})
if err != nil {
return err
}
invokeFile, err := std.File(ctx, &std.FileArgs{
Input: "samples/public.pem",
}, nil)
if err != nil {
return err
}
invokeFile1, err := std.File(ctx, &std.FileArgs{
Input: "samples/private.pem",
}, nil)
if err != nil {
return err
}
_, err = artifactory.NewVaultConfiguration(ctx, "my-vault-config-cert", &artifactory.VaultConfigurationArgs{
Name: pulumi.String("my-vault-config-cert"),
Config: &artifactory.VaultConfigurationConfigArgs{
Url: pulumi.String("http://127.0.0.1:8200"),
Auth: &artifactory.VaultConfigurationConfigAuthArgs{
Type: pulumi.String("Certificate"),
Certificate: pulumi.String(invokeFile.Result),
CertificateKey: pulumi.String(invokeFile1.Result),
},
Mounts: artifactory.VaultConfigurationConfigMountArray{
&artifactory.VaultConfigurationConfigMountArgs{
Path: pulumi.String("secret"),
Type: pulumi.String("KV2"),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Artifactory = Pulumi.Artifactory;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var my_vault_config_app_role = new Artifactory.VaultConfiguration("my-vault-config-app-role", new()
{
Name = "my-vault-config-app-role",
Config = new Artifactory.Inputs.VaultConfigurationConfigArgs
{
Url = "http://127.0.0.1:8200",
Auth = new Artifactory.Inputs.VaultConfigurationConfigAuthArgs
{
Type = "AppRole",
RoleId = "1b62ff05...",
SecretId = "acbd6657...",
},
Mounts = new[]
{
new Artifactory.Inputs.VaultConfigurationConfigMountArgs
{
Path = "secret",
Type = "KV2",
},
},
},
});
var my_vault_config_cert = new Artifactory.VaultConfiguration("my-vault-config-cert", new()
{
Name = "my-vault-config-cert",
Config = new Artifactory.Inputs.VaultConfigurationConfigArgs
{
Url = "http://127.0.0.1:8200",
Auth = new Artifactory.Inputs.VaultConfigurationConfigAuthArgs
{
Type = "Certificate",
Certificate = Std.File.Invoke(new()
{
Input = "samples/public.pem",
}).Apply(invoke => invoke.Result),
CertificateKey = Std.File.Invoke(new()
{
Input = "samples/private.pem",
}).Apply(invoke => invoke.Result),
},
Mounts = new[]
{
new Artifactory.Inputs.VaultConfigurationConfigMountArgs
{
Path = "secret",
Type = "KV2",
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.artifactory.VaultConfiguration;
import com.pulumi.artifactory.VaultConfigurationArgs;
import com.pulumi.artifactory.inputs.VaultConfigurationConfigArgs;
import com.pulumi.artifactory.inputs.VaultConfigurationConfigAuthArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var my_vault_config_app_role = new VaultConfiguration("my-vault-config-app-role", VaultConfigurationArgs.builder()
.name("my-vault-config-app-role")
.config(VaultConfigurationConfigArgs.builder()
.url("http://127.0.0.1:8200")
.auth(VaultConfigurationConfigAuthArgs.builder()
.type("AppRole")
.roleId("1b62ff05...")
.secretId("acbd6657...")
.build())
.mounts(VaultConfigurationConfigMountArgs.builder()
.path("secret")
.type("KV2")
.build())
.build())
.build());
var my_vault_config_cert = new VaultConfiguration("my-vault-config-cert", VaultConfigurationArgs.builder()
.name("my-vault-config-cert")
.config(VaultConfigurationConfigArgs.builder()
.url("http://127.0.0.1:8200")
.auth(VaultConfigurationConfigAuthArgs.builder()
.type("Certificate")
.certificate(StdFunctions.file(FileArgs.builder()
.input("samples/public.pem")
.build()).result())
.certificateKey(StdFunctions.file(FileArgs.builder()
.input("samples/private.pem")
.build()).result())
.build())
.mounts(VaultConfigurationConfigMountArgs.builder()
.path("secret")
.type("KV2")
.build())
.build())
.build());
}
}
resources:
my-vault-config-app-role:
type: artifactory:VaultConfiguration
properties:
name: my-vault-config-app-role
config:
url: http://127.0.0.1:8200
auth:
type: AppRole
roleId: 1b62ff05...
secretId: acbd6657...
mounts:
- path: secret
type: KV2
my-vault-config-cert:
type: artifactory:VaultConfiguration
properties:
name: my-vault-config-cert
config:
url: http://127.0.0.1:8200
auth:
type: Certificate
certificate:
fn::invoke:
Function: std:file
Arguments:
input: samples/public.pem
Return: result
certificateKey:
fn::invoke:
Function: std:file
Arguments:
input: samples/private.pem
Return: result
mounts:
- path: secret
type: KV2
Create VaultConfiguration Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VaultConfiguration(name: string, args: VaultConfigurationArgs, opts?: CustomResourceOptions);
@overload
def VaultConfiguration(resource_name: str,
args: VaultConfigurationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VaultConfiguration(resource_name: str,
opts: Optional[ResourceOptions] = None,
config: Optional[VaultConfigurationConfigArgs] = None,
name: Optional[str] = None)
func NewVaultConfiguration(ctx *Context, name string, args VaultConfigurationArgs, opts ...ResourceOption) (*VaultConfiguration, error)
public VaultConfiguration(string name, VaultConfigurationArgs args, CustomResourceOptions? opts = null)
public VaultConfiguration(String name, VaultConfigurationArgs args)
public VaultConfiguration(String name, VaultConfigurationArgs args, CustomResourceOptions options)
type: artifactory:VaultConfiguration
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args VaultConfigurationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args VaultConfigurationArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VaultConfigurationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VaultConfigurationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VaultConfigurationArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var vaultConfigurationResource = new Artifactory.VaultConfiguration("vaultConfigurationResource", new()
{
Config = new Artifactory.Inputs.VaultConfigurationConfigArgs
{
Auth = new Artifactory.Inputs.VaultConfigurationConfigAuthArgs
{
Type = "string",
Certificate = "string",
CertificateKey = "string",
RoleId = "string",
SecretId = "string",
},
Mounts = new[]
{
new Artifactory.Inputs.VaultConfigurationConfigMountArgs
{
Path = "string",
Type = "string",
},
},
Url = "string",
},
Name = "string",
});
example, err := artifactory.NewVaultConfiguration(ctx, "vaultConfigurationResource", &artifactory.VaultConfigurationArgs{
Config: &artifactory.VaultConfigurationConfigArgs{
Auth: &artifactory.VaultConfigurationConfigAuthArgs{
Type: pulumi.String("string"),
Certificate: pulumi.String("string"),
CertificateKey: pulumi.String("string"),
RoleId: pulumi.String("string"),
SecretId: pulumi.String("string"),
},
Mounts: artifactory.VaultConfigurationConfigMountArray{
&artifactory.VaultConfigurationConfigMountArgs{
Path: pulumi.String("string"),
Type: pulumi.String("string"),
},
},
Url: pulumi.String("string"),
},
Name: pulumi.String("string"),
})
var vaultConfigurationResource = new VaultConfiguration("vaultConfigurationResource", VaultConfigurationArgs.builder()
.config(VaultConfigurationConfigArgs.builder()
.auth(VaultConfigurationConfigAuthArgs.builder()
.type("string")
.certificate("string")
.certificateKey("string")
.roleId("string")
.secretId("string")
.build())
.mounts(VaultConfigurationConfigMountArgs.builder()
.path("string")
.type("string")
.build())
.url("string")
.build())
.name("string")
.build());
vault_configuration_resource = artifactory.VaultConfiguration("vaultConfigurationResource",
config={
"auth": {
"type": "string",
"certificate": "string",
"certificate_key": "string",
"role_id": "string",
"secret_id": "string",
},
"mounts": [{
"path": "string",
"type": "string",
}],
"url": "string",
},
name="string")
const vaultConfigurationResource = new artifactory.VaultConfiguration("vaultConfigurationResource", {
config: {
auth: {
type: "string",
certificate: "string",
certificateKey: "string",
roleId: "string",
secretId: "string",
},
mounts: [{
path: "string",
type: "string",
}],
url: "string",
},
name: "string",
});
type: artifactory:VaultConfiguration
properties:
config:
auth:
certificate: string
certificateKey: string
roleId: string
secretId: string
type: string
mounts:
- path: string
type: string
url: string
name: string
VaultConfiguration Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The VaultConfiguration resource accepts the following input properties:
- Config
Vault
Configuration Config - Name string
- Name of the Vault configuration
- Config
Vault
Configuration Config Args - Name string
- Name of the Vault configuration
- config
Vault
Configuration Config - name String
- Name of the Vault configuration
- config
Vault
Configuration Config - name string
- Name of the Vault configuration
- config
Vault
Configuration Config Args - name str
- Name of the Vault configuration
- config Property Map
- name String
- Name of the Vault configuration
Outputs
All input properties are implicitly available as output properties. Additionally, the VaultConfiguration resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing VaultConfiguration Resource
Get an existing VaultConfiguration resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: VaultConfigurationState, opts?: CustomResourceOptions): VaultConfiguration
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
config: Optional[VaultConfigurationConfigArgs] = None,
name: Optional[str] = None) -> VaultConfiguration
func GetVaultConfiguration(ctx *Context, name string, id IDInput, state *VaultConfigurationState, opts ...ResourceOption) (*VaultConfiguration, error)
public static VaultConfiguration Get(string name, Input<string> id, VaultConfigurationState? state, CustomResourceOptions? opts = null)
public static VaultConfiguration get(String name, Output<String> id, VaultConfigurationState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Config
Vault
Configuration Config - Name string
- Name of the Vault configuration
- Config
Vault
Configuration Config Args - Name string
- Name of the Vault configuration
- config
Vault
Configuration Config - name String
- Name of the Vault configuration
- config
Vault
Configuration Config - name string
- Name of the Vault configuration
- config
Vault
Configuration Config Args - name str
- Name of the Vault configuration
- config Property Map
- name String
- Name of the Vault configuration
Supporting Types
VaultConfigurationConfig, VaultConfigurationConfigArgs
- Auth
Vault
Configuration Config Auth - Mounts
List<Vault
Configuration Config Mount> - Url string
- The base URL of the Vault server.
- Auth
Vault
Configuration Config Auth - Mounts
[]Vault
Configuration Config Mount - Url string
- The base URL of the Vault server.
- auth
Vault
Configuration Config Auth - mounts
List<Vault
Configuration Config Mount> - url String
- The base URL of the Vault server.
- auth
Vault
Configuration Config Auth - mounts
Vault
Configuration Config Mount[] - url string
- The base URL of the Vault server.
- auth
Vault
Configuration Config Auth - mounts
Sequence[Vault
Configuration Config Mount] - url str
- The base URL of the Vault server.
- auth Property Map
- mounts List<Property Map>
- url String
- The base URL of the Vault server.
VaultConfigurationConfigAuth, VaultConfigurationConfigAuthArgs
- Type string
- Certificate string
- Client certificate (in PEM format) for
Certificate
type. - Certificate
Key string - Private key (in PEM format) for
Certificate
type. - Role
Id string - Role ID for
AppRole
type - Secret
Id string - Secret ID for
AppRole
type
- Type string
- Certificate string
- Client certificate (in PEM format) for
Certificate
type. - Certificate
Key string - Private key (in PEM format) for
Certificate
type. - Role
Id string - Role ID for
AppRole
type - Secret
Id string - Secret ID for
AppRole
type
- type String
- certificate String
- Client certificate (in PEM format) for
Certificate
type. - certificate
Key String - Private key (in PEM format) for
Certificate
type. - role
Id String - Role ID for
AppRole
type - secret
Id String - Secret ID for
AppRole
type
- type string
- certificate string
- Client certificate (in PEM format) for
Certificate
type. - certificate
Key string - Private key (in PEM format) for
Certificate
type. - role
Id string - Role ID for
AppRole
type - secret
Id string - Secret ID for
AppRole
type
- type str
- certificate str
- Client certificate (in PEM format) for
Certificate
type. - certificate_
key str - Private key (in PEM format) for
Certificate
type. - role_
id str - Role ID for
AppRole
type - secret_
id str - Secret ID for
AppRole
type
- type String
- certificate String
- Client certificate (in PEM format) for
Certificate
type. - certificate
Key String - Private key (in PEM format) for
Certificate
type. - role
Id String - Role ID for
AppRole
type - secret
Id String - Secret ID for
AppRole
type
VaultConfigurationConfigMount, VaultConfigurationConfigMountArgs
Import
$ pulumi import artifactory:index/vaultConfiguration:VaultConfiguration my-vault-config my-vault-config
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- artifactory pulumi/pulumi-artifactory
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
artifactory
Terraform Provider.