argocd.RepositoryCredentials
Explore with Pulumi AI
Manages repository credentials within ArgoCD.
Note: due to restrictions in the ArgoCD API the provider is unable to track drift in this resource to fields other than username. I.e. the provider is unable to detect changes to repository credentials that are made outside of Pulumi (e.g. manual updates to the underlying Kubernetes Secrets).
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as argocd from "@three14/pulumi-argocd";
const _private = new argocd.RepositoryCredentials("private", {
    url: "git@private-git-repository.local",
    username: "git",
    sshPrivateKey: `-----BEGIN OPENSSH PRIVATE KEY-----
foo
bar
-----END OPENSSH PRIVATE KEY-----`,
});
import pulumi
import pulumi_argocd as argocd
private = argocd.RepositoryCredentials("private",
    url="git@private-git-repository.local",
    username="git",
    ssh_private_key="""-----BEGIN OPENSSH PRIVATE KEY-----
foo
bar
-----END OPENSSH PRIVATE KEY-----""")
package main
import (
	"github.com/Three141/pulumi-argocd/sdk/go/argocd"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := argocd.NewRepositoryCredentials(ctx, "private", &argocd.RepositoryCredentialsArgs{
			Url:           pulumi.String("git@private-git-repository.local"),
			Username:      pulumi.String("git"),
			SshPrivateKey: pulumi.String("-----BEGIN OPENSSH PRIVATE KEY-----\nfoo\nbar\n-----END OPENSSH PRIVATE KEY-----"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Argocd = Three14.Argocd;
return await Deployment.RunAsync(() => 
{
    var @private = new Argocd.RepositoryCredentials("private", new()
    {
        Url = "git@private-git-repository.local",
        Username = "git",
        SshPrivateKey = @"-----BEGIN OPENSSH PRIVATE KEY-----
foo
bar
-----END OPENSSH PRIVATE KEY-----",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.argocd.RepositoryCredentials;
import com.pulumi.argocd.RepositoryCredentialsArgs;
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 private_ = new RepositoryCredentials("private", RepositoryCredentialsArgs.builder()
            .url("git@private-git-repository.local")
            .username("git")
            .sshPrivateKey("""
-----BEGIN OPENSSH PRIVATE KEY-----
foo
bar
-----END OPENSSH PRIVATE KEY-----            """)
            .build());
    }
}
resources:
  private:
    type: argocd:RepositoryCredentials
    properties:
      url: git@private-git-repository.local
      username: git
      sshPrivateKey: |-
        -----BEGIN OPENSSH PRIVATE KEY-----
        foo
        bar
        -----END OPENSSH PRIVATE KEY-----        
Create RepositoryCredentials Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RepositoryCredentials(name: string, args: RepositoryCredentialsArgs, opts?: CustomResourceOptions);@overload
def RepositoryCredentials(resource_name: str,
                          args: RepositoryCredentialsArgs,
                          opts: Optional[ResourceOptions] = None)
@overload
def RepositoryCredentials(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          url: Optional[str] = None,
                          enable_oci: Optional[bool] = None,
                          githubapp_enterprise_base_url: Optional[str] = None,
                          githubapp_id: Optional[str] = None,
                          githubapp_installation_id: Optional[str] = None,
                          githubapp_private_key: Optional[str] = None,
                          password: Optional[str] = None,
                          ssh_private_key: Optional[str] = None,
                          tls_client_cert_data: Optional[str] = None,
                          tls_client_cert_key: Optional[str] = None,
                          username: Optional[str] = None)func NewRepositoryCredentials(ctx *Context, name string, args RepositoryCredentialsArgs, opts ...ResourceOption) (*RepositoryCredentials, error)public RepositoryCredentials(string name, RepositoryCredentialsArgs args, CustomResourceOptions? opts = null)
public RepositoryCredentials(String name, RepositoryCredentialsArgs args)
public RepositoryCredentials(String name, RepositoryCredentialsArgs args, CustomResourceOptions options)
type: argocd:RepositoryCredentials
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 RepositoryCredentialsArgs
- 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 RepositoryCredentialsArgs
- 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 RepositoryCredentialsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RepositoryCredentialsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RepositoryCredentialsArgs
- 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 repositoryCredentialsResource = new Argocd.RepositoryCredentials("repositoryCredentialsResource", new()
{
    Url = "string",
    EnableOci = false,
    GithubappEnterpriseBaseUrl = "string",
    GithubappId = "string",
    GithubappInstallationId = "string",
    GithubappPrivateKey = "string",
    Password = "string",
    SshPrivateKey = "string",
    TlsClientCertData = "string",
    TlsClientCertKey = "string",
    Username = "string",
});
example, err := argocd.NewRepositoryCredentials(ctx, "repositoryCredentialsResource", &argocd.RepositoryCredentialsArgs{
	Url:                        pulumi.String("string"),
	EnableOci:                  pulumi.Bool(false),
	GithubappEnterpriseBaseUrl: pulumi.String("string"),
	GithubappId:                pulumi.String("string"),
	GithubappInstallationId:    pulumi.String("string"),
	GithubappPrivateKey:        pulumi.String("string"),
	Password:                   pulumi.String("string"),
	SshPrivateKey:              pulumi.String("string"),
	TlsClientCertData:          pulumi.String("string"),
	TlsClientCertKey:           pulumi.String("string"),
	Username:                   pulumi.String("string"),
})
var repositoryCredentialsResource = new RepositoryCredentials("repositoryCredentialsResource", RepositoryCredentialsArgs.builder()
    .url("string")
    .enableOci(false)
    .githubappEnterpriseBaseUrl("string")
    .githubappId("string")
    .githubappInstallationId("string")
    .githubappPrivateKey("string")
    .password("string")
    .sshPrivateKey("string")
    .tlsClientCertData("string")
    .tlsClientCertKey("string")
    .username("string")
    .build());
repository_credentials_resource = argocd.RepositoryCredentials("repositoryCredentialsResource",
    url="string",
    enable_oci=False,
    githubapp_enterprise_base_url="string",
    githubapp_id="string",
    githubapp_installation_id="string",
    githubapp_private_key="string",
    password="string",
    ssh_private_key="string",
    tls_client_cert_data="string",
    tls_client_cert_key="string",
    username="string")
const repositoryCredentialsResource = new argocd.RepositoryCredentials("repositoryCredentialsResource", {
    url: "string",
    enableOci: false,
    githubappEnterpriseBaseUrl: "string",
    githubappId: "string",
    githubappInstallationId: "string",
    githubappPrivateKey: "string",
    password: "string",
    sshPrivateKey: "string",
    tlsClientCertData: "string",
    tlsClientCertKey: "string",
    username: "string",
});
type: argocd:RepositoryCredentials
properties:
    enableOci: false
    githubappEnterpriseBaseUrl: string
    githubappId: string
    githubappInstallationId: string
    githubappPrivateKey: string
    password: string
    sshPrivateKey: string
    tlsClientCertData: string
    tlsClientCertKey: string
    url: string
    username: string
RepositoryCredentials 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 RepositoryCredentials resource accepts the following input properties:
- Url string
- URL that these credentials matches to.
- EnableOci bool
- Whether helm-ocisupport should be enabled for this repo.
- GithubappEnterprise stringBase Url 
- GitHub API URL for GitHub app authentication.
- GithubappId string
- Github App ID of the app used to access the repo for GitHub app authentication.
- GithubappInstallation stringId 
- ID of the installed GitHub App for GitHub app authentication.
- GithubappPrivate stringKey 
- Private key data (PEM) for authentication via GitHub app.
- Password string
- Password for authenticating at the repo server.
- SshPrivate stringKey 
- Private key data for authenticating at the repo server using SSH (only Git repos).
- TlsClient stringCert Data 
- TLS client cert data for authenticating at the repo server.
- TlsClient stringCert Key 
- TLS client cert key for authenticating at the repo server.
- Username string
- Username for authenticating at the repo server.
- Url string
- URL that these credentials matches to.
- EnableOci bool
- Whether helm-ocisupport should be enabled for this repo.
- GithubappEnterprise stringBase Url 
- GitHub API URL for GitHub app authentication.
- GithubappId string
- Github App ID of the app used to access the repo for GitHub app authentication.
- GithubappInstallation stringId 
- ID of the installed GitHub App for GitHub app authentication.
- GithubappPrivate stringKey 
- Private key data (PEM) for authentication via GitHub app.
- Password string
- Password for authenticating at the repo server.
- SshPrivate stringKey 
- Private key data for authenticating at the repo server using SSH (only Git repos).
- TlsClient stringCert Data 
- TLS client cert data for authenticating at the repo server.
- TlsClient stringCert Key 
- TLS client cert key for authenticating at the repo server.
- Username string
- Username for authenticating at the repo server.
- url String
- URL that these credentials matches to.
- enableOci Boolean
- Whether helm-ocisupport should be enabled for this repo.
- githubappEnterprise StringBase Url 
- GitHub API URL for GitHub app authentication.
- githubappId String
- Github App ID of the app used to access the repo for GitHub app authentication.
- githubappInstallation StringId 
- ID of the installed GitHub App for GitHub app authentication.
- githubappPrivate StringKey 
- Private key data (PEM) for authentication via GitHub app.
- password String
- Password for authenticating at the repo server.
- sshPrivate StringKey 
- Private key data for authenticating at the repo server using SSH (only Git repos).
- tlsClient StringCert Data 
- TLS client cert data for authenticating at the repo server.
- tlsClient StringCert Key 
- TLS client cert key for authenticating at the repo server.
- username String
- Username for authenticating at the repo server.
- url string
- URL that these credentials matches to.
- enableOci boolean
- Whether helm-ocisupport should be enabled for this repo.
- githubappEnterprise stringBase Url 
- GitHub API URL for GitHub app authentication.
- githubappId string
- Github App ID of the app used to access the repo for GitHub app authentication.
- githubappInstallation stringId 
- ID of the installed GitHub App for GitHub app authentication.
- githubappPrivate stringKey 
- Private key data (PEM) for authentication via GitHub app.
- password string
- Password for authenticating at the repo server.
- sshPrivate stringKey 
- Private key data for authenticating at the repo server using SSH (only Git repos).
- tlsClient stringCert Data 
- TLS client cert data for authenticating at the repo server.
- tlsClient stringCert Key 
- TLS client cert key for authenticating at the repo server.
- username string
- Username for authenticating at the repo server.
- url str
- URL that these credentials matches to.
- enable_oci bool
- Whether helm-ocisupport should be enabled for this repo.
- githubapp_enterprise_ strbase_ url 
- GitHub API URL for GitHub app authentication.
- githubapp_id str
- Github App ID of the app used to access the repo for GitHub app authentication.
- githubapp_installation_ strid 
- ID of the installed GitHub App for GitHub app authentication.
- githubapp_private_ strkey 
- Private key data (PEM) for authentication via GitHub app.
- password str
- Password for authenticating at the repo server.
- ssh_private_ strkey 
- Private key data for authenticating at the repo server using SSH (only Git repos).
- tls_client_ strcert_ data 
- TLS client cert data for authenticating at the repo server.
- tls_client_ strcert_ key 
- TLS client cert key for authenticating at the repo server.
- username str
- Username for authenticating at the repo server.
- url String
- URL that these credentials matches to.
- enableOci Boolean
- Whether helm-ocisupport should be enabled for this repo.
- githubappEnterprise StringBase Url 
- GitHub API URL for GitHub app authentication.
- githubappId String
- Github App ID of the app used to access the repo for GitHub app authentication.
- githubappInstallation StringId 
- ID of the installed GitHub App for GitHub app authentication.
- githubappPrivate StringKey 
- Private key data (PEM) for authentication via GitHub app.
- password String
- Password for authenticating at the repo server.
- sshPrivate StringKey 
- Private key data for authenticating at the repo server using SSH (only Git repos).
- tlsClient StringCert Data 
- TLS client cert data for authenticating at the repo server.
- tlsClient StringCert Key 
- TLS client cert key for authenticating at the repo server.
- username String
- Username for authenticating at the repo server.
Outputs
All input properties are implicitly available as output properties. Additionally, the RepositoryCredentials 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 RepositoryCredentials Resource
Get an existing RepositoryCredentials 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?: RepositoryCredentialsState, opts?: CustomResourceOptions): RepositoryCredentials@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        enable_oci: Optional[bool] = None,
        githubapp_enterprise_base_url: Optional[str] = None,
        githubapp_id: Optional[str] = None,
        githubapp_installation_id: Optional[str] = None,
        githubapp_private_key: Optional[str] = None,
        password: Optional[str] = None,
        ssh_private_key: Optional[str] = None,
        tls_client_cert_data: Optional[str] = None,
        tls_client_cert_key: Optional[str] = None,
        url: Optional[str] = None,
        username: Optional[str] = None) -> RepositoryCredentialsfunc GetRepositoryCredentials(ctx *Context, name string, id IDInput, state *RepositoryCredentialsState, opts ...ResourceOption) (*RepositoryCredentials, error)public static RepositoryCredentials Get(string name, Input<string> id, RepositoryCredentialsState? state, CustomResourceOptions? opts = null)public static RepositoryCredentials get(String name, Output<String> id, RepositoryCredentialsState state, CustomResourceOptions options)resources:  _:    type: argocd:RepositoryCredentials    get:      id: ${id}- 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.
- EnableOci bool
- Whether helm-ocisupport should be enabled for this repo.
- GithubappEnterprise stringBase Url 
- GitHub API URL for GitHub app authentication.
- GithubappId string
- Github App ID of the app used to access the repo for GitHub app authentication.
- GithubappInstallation stringId 
- ID of the installed GitHub App for GitHub app authentication.
- GithubappPrivate stringKey 
- Private key data (PEM) for authentication via GitHub app.
- Password string
- Password for authenticating at the repo server.
- SshPrivate stringKey 
- Private key data for authenticating at the repo server using SSH (only Git repos).
- TlsClient stringCert Data 
- TLS client cert data for authenticating at the repo server.
- TlsClient stringCert Key 
- TLS client cert key for authenticating at the repo server.
- Url string
- URL that these credentials matches to.
- Username string
- Username for authenticating at the repo server.
- EnableOci bool
- Whether helm-ocisupport should be enabled for this repo.
- GithubappEnterprise stringBase Url 
- GitHub API URL for GitHub app authentication.
- GithubappId string
- Github App ID of the app used to access the repo for GitHub app authentication.
- GithubappInstallation stringId 
- ID of the installed GitHub App for GitHub app authentication.
- GithubappPrivate stringKey 
- Private key data (PEM) for authentication via GitHub app.
- Password string
- Password for authenticating at the repo server.
- SshPrivate stringKey 
- Private key data for authenticating at the repo server using SSH (only Git repos).
- TlsClient stringCert Data 
- TLS client cert data for authenticating at the repo server.
- TlsClient stringCert Key 
- TLS client cert key for authenticating at the repo server.
- Url string
- URL that these credentials matches to.
- Username string
- Username for authenticating at the repo server.
- enableOci Boolean
- Whether helm-ocisupport should be enabled for this repo.
- githubappEnterprise StringBase Url 
- GitHub API URL for GitHub app authentication.
- githubappId String
- Github App ID of the app used to access the repo for GitHub app authentication.
- githubappInstallation StringId 
- ID of the installed GitHub App for GitHub app authentication.
- githubappPrivate StringKey 
- Private key data (PEM) for authentication via GitHub app.
- password String
- Password for authenticating at the repo server.
- sshPrivate StringKey 
- Private key data for authenticating at the repo server using SSH (only Git repos).
- tlsClient StringCert Data 
- TLS client cert data for authenticating at the repo server.
- tlsClient StringCert Key 
- TLS client cert key for authenticating at the repo server.
- url String
- URL that these credentials matches to.
- username String
- Username for authenticating at the repo server.
- enableOci boolean
- Whether helm-ocisupport should be enabled for this repo.
- githubappEnterprise stringBase Url 
- GitHub API URL for GitHub app authentication.
- githubappId string
- Github App ID of the app used to access the repo for GitHub app authentication.
- githubappInstallation stringId 
- ID of the installed GitHub App for GitHub app authentication.
- githubappPrivate stringKey 
- Private key data (PEM) for authentication via GitHub app.
- password string
- Password for authenticating at the repo server.
- sshPrivate stringKey 
- Private key data for authenticating at the repo server using SSH (only Git repos).
- tlsClient stringCert Data 
- TLS client cert data for authenticating at the repo server.
- tlsClient stringCert Key 
- TLS client cert key for authenticating at the repo server.
- url string
- URL that these credentials matches to.
- username string
- Username for authenticating at the repo server.
- enable_oci bool
- Whether helm-ocisupport should be enabled for this repo.
- githubapp_enterprise_ strbase_ url 
- GitHub API URL for GitHub app authentication.
- githubapp_id str
- Github App ID of the app used to access the repo for GitHub app authentication.
- githubapp_installation_ strid 
- ID of the installed GitHub App for GitHub app authentication.
- githubapp_private_ strkey 
- Private key data (PEM) for authentication via GitHub app.
- password str
- Password for authenticating at the repo server.
- ssh_private_ strkey 
- Private key data for authenticating at the repo server using SSH (only Git repos).
- tls_client_ strcert_ data 
- TLS client cert data for authenticating at the repo server.
- tls_client_ strcert_ key 
- TLS client cert key for authenticating at the repo server.
- url str
- URL that these credentials matches to.
- username str
- Username for authenticating at the repo server.
- enableOci Boolean
- Whether helm-ocisupport should be enabled for this repo.
- githubappEnterprise StringBase Url 
- GitHub API URL for GitHub app authentication.
- githubappId String
- Github App ID of the app used to access the repo for GitHub app authentication.
- githubappInstallation StringId 
- ID of the installed GitHub App for GitHub app authentication.
- githubappPrivate StringKey 
- Private key data (PEM) for authentication via GitHub app.
- password String
- Password for authenticating at the repo server.
- sshPrivate StringKey 
- Private key data for authenticating at the repo server using SSH (only Git repos).
- tlsClient StringCert Data 
- TLS client cert data for authenticating at the repo server.
- tlsClient StringCert Key 
- TLS client cert key for authenticating at the repo server.
- url String
- URL that these credentials matches to.
- username String
- Username for authenticating at the repo server.
Import
Repository credentials can be imported using the repository URL.
Note: as the ArgoCD API does not return any sensitive information, a
subsequent pulumi up should be executed to make the password,
ssh_private_key and tls_client_cert_key attributes converge to their
expected values defined within the plan.
Example:
$ pulumi import argocd:index/repositoryCredentials:RepositoryCredentials myrepocreds git@private-git-repository.local:somerepo.git
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- argocd Three141/pulumi-argocd
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the argocdTerraform Provider.
