1. Packages
  2. Artifactory Provider
  3. API Docs
  4. VaultConfiguration
artifactory v8.4.0 published on Tuesday, Nov 19, 2024 by Pulumi

artifactory.VaultConfiguration

Explore with Pulumi AI

artifactory logo
artifactory v8.4.0 published on Tuesday, Nov 19, 2024 by Pulumi

    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 VaultConfigurationConfig
    Name string
    Name of the Vault configuration
    Config VaultConfigurationConfigArgs
    Name string
    Name of the Vault configuration
    config VaultConfigurationConfig
    name String
    Name of the Vault configuration
    config VaultConfigurationConfig
    name string
    Name of the Vault configuration
    config VaultConfigurationConfigArgs
    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.
    The following state arguments are supported:
    Config VaultConfigurationConfig
    Name string
    Name of the Vault configuration
    Config VaultConfigurationConfigArgs
    Name string
    Name of the Vault configuration
    config VaultConfigurationConfig
    name String
    Name of the Vault configuration
    config VaultConfigurationConfig
    name string
    Name of the Vault configuration
    config VaultConfigurationConfigArgs
    name str
    Name of the Vault configuration
    config Property Map
    name String
    Name of the Vault configuration

    Supporting Types

    VaultConfigurationConfig, VaultConfigurationConfigArgs

    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.
    CertificateKey string
    Private key (in PEM format) for Certificate type.
    RoleId string
    Role ID for AppRole type
    SecretId string
    Secret ID for AppRole type
    Type string
    Certificate string
    Client certificate (in PEM format) for Certificate type.
    CertificateKey string
    Private key (in PEM format) for Certificate type.
    RoleId string
    Role ID for AppRole type
    SecretId string
    Secret ID for AppRole type
    type String
    certificate String
    Client certificate (in PEM format) for Certificate type.
    certificateKey String
    Private key (in PEM format) for Certificate type.
    roleId String
    Role ID for AppRole type
    secretId String
    Secret ID for AppRole type
    type string
    certificate string
    Client certificate (in PEM format) for Certificate type.
    certificateKey string
    Private key (in PEM format) for Certificate type.
    roleId string
    Role ID for AppRole type
    secretId 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.
    certificateKey String
    Private key (in PEM format) for Certificate type.
    roleId String
    Role ID for AppRole type
    secretId String
    Secret ID for AppRole type

    VaultConfigurationConfigMount, VaultConfigurationConfigMountArgs

    Path string
    Vault secret engine path
    Type string
    Vault supports several secret engines, each one has different capabilities. The supported secret engine types are: KV1 and KV2.
    Path string
    Vault secret engine path
    Type string
    Vault supports several secret engines, each one has different capabilities. The supported secret engine types are: KV1 and KV2.
    path String
    Vault secret engine path
    type String
    Vault supports several secret engines, each one has different capabilities. The supported secret engine types are: KV1 and KV2.
    path string
    Vault secret engine path
    type string
    Vault supports several secret engines, each one has different capabilities. The supported secret engine types are: KV1 and KV2.
    path str
    Vault secret engine path
    type str
    Vault supports several secret engines, each one has different capabilities. The supported secret engine types are: KV1 and KV2.
    path String
    Vault secret engine path
    type String
    Vault supports several secret engines, each one has different capabilities. The supported secret engine types are: KV1 and KV2.

    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.
    artifactory logo
    artifactory v8.4.0 published on Tuesday, Nov 19, 2024 by Pulumi