virtual

package
v6.37.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const AlpinePackageType = "alpine"
View Source
const BowerPackageType = "bower"
View Source
const DebianPackageType = "debian"
View Source
const DockerPackageType = "docker"
View Source
const GoPackageType = "go"
View Source
const HelmPackageType = "helm"
View Source
const NpmPackageType = "npm"
View Source
const NugetPackageType = "nuget"
View Source
const Rclass = "virtual"
View Source
const RpmPackageType = "rpm"

Variables

View Source
var AlpineVirtualSchema = util.MergeMaps(
	BaseVirtualRepoSchema,
	RetrievalCachePeriodSecondsSchema,
	map[string]*schema.Schema{
		"primary_keypair_ref": {
			Type:             schema.TypeString,
			Optional:         true,
			ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotEmpty),
			Description:      "Primary keypair used to sign artifacts. Default value is empty.",
		},
	},
	repository.RepoLayoutRefSchema(Rclass, AlpinePackageType))
View Source
var BaseVirtualRepoSchema = map[string]*schema.Schema{
	"key": {
		Type:        schema.TypeString,
		Required:    true,
		ForceNew:    true,
		Description: "The Repository Key. A mandatory identifier for the repository and must be unique. It cannot begin with a number or contain spaces or special characters. For local repositories, we recommend using a '-local' suffix (e.g. 'libs-release-local').",
	},
	"project_key": {
		Type:             schema.TypeString,
		Optional:         true,
		ValidateDiagFunc: validator.ProjectKey,
		Description:      "Project key for assigning this repository to. Must be 2 - 20 lowercase alphanumeric and hyphen characters. When assigning repository to a project, repository key must be prefixed with project key, separated by a dash.",
	},
	"project_environments": {
		Type:     schema.TypeSet,
		Elem:     &schema.Schema{Type: schema.TypeString},
		MaxItems: 2,
		Set:      schema.HashString,
		Optional: true,
		Computed: true,
		Description: "Project environment for assigning this repository to. Allow values: \"DEV\" or \"PROD\". " +
			"The attribute should only be used if the repository is already assigned to the existing project. If not, " +
			"the attribute will be ignored by Artifactory, but will remain in the Terraform state, which will create " +
			"state drift during the update.",
	},
	"package_type": {
		Type:        schema.TypeString,
		Required:    false,
		Computed:    true,
		ForceNew:    true,
		Description: "The Package Type. This must be specified when the repository is created, and once set, cannot be changed.",
	},
	"description": {
		Type:     schema.TypeString,
		Optional: true,
		Description: "A free text field that describes the content and purpose of the repository. " +
			"If you choose to insert a link into this field, clicking the link will prompt the user to confirm that " +
			"they might be redirected to a new domain.",
	},
	"notes": {
		Type:        schema.TypeString,
		Optional:    true,
		Description: "A free text field to add additional notes about the repository. These are only visible to the administrator.",
	},
	"includes_pattern": {
		Type:     schema.TypeString,
		Optional: true,
		Default:  "**/*",
		Description: "List of comma-separated artifact patterns to include when evaluating artifact requests in the form of x/y/**/z/*. " +
			"When used, only artifacts matching one of the include patterns are served. By default, all artifacts are included (**/*).",
	},
	"excludes_pattern": {
		Type:     schema.TypeString,
		Optional: true,
		Description: "List of artifact patterns to exclude when evaluating artifact requests, in the form of x/y/**/z/*." +
			"By default no artifacts are excluded.",
	},
	"repo_layout_ref": {
		Type:             schema.TypeString,
		Optional:         true,
		ValidateDiagFunc: repository.ValidateRepoLayoutRefSchemaOverride,
		Description:      "Sets the layout that the repository should use for storing and identifying modules. A recommended layout that corresponds to the package type defined is suggested, and index packages uploaded and calculate metadata accordingly.",
	},
	"repositories": {
		Type:        schema.TypeList,
		Elem:        &schema.Schema{Type: schema.TypeString},
		Optional:    true,
		Description: "The effective list of actual repositories included in this virtual repository.",
	},

	"artifactory_requests_can_retrieve_remote_artifacts": {
		Type:        schema.TypeBool,
		Optional:    true,
		Default:     false,
		Description: "Whether the virtual repository should search through remote repositories when trying to resolve an artifact requested by another Artifactory instance.",
	},
	"default_deployment_repo": {
		Type:        schema.TypeString,
		Optional:    true,
		Description: "Default repository to deploy artifacts.",
	},
}
View Source
var BowerVirtualSchema = util.MergeMaps(
	BaseVirtualRepoSchema,
	externalDependenciesSchema,
	repository.RepoLayoutRefSchema(Rclass, BowerPackageType),
)
View Source
var DebianVirtualSchema = util.MergeMaps(
	BaseVirtualRepoSchema,
	RetrievalCachePeriodSecondsSchema,
	map[string]*schema.Schema{
		"primary_keypair_ref": {
			Type:             schema.TypeString,
			Optional:         true,
			ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotEmpty),
			Description:      "Primary keypair used to sign artifacts. Default is empty.",
		},
		"secondary_keypair_ref": {
			Type:             schema.TypeString,
			Optional:         true,
			ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotEmpty),
			Description:      "Secondary keypair used to sign artifacts. Default is empty.",
		},
		"optional_index_compression_formats": {
			Type:     schema.TypeSet,
			Optional: true,
			MinItems: 0,
			Computed: true,
			Elem: &schema.Schema{
				Type:         schema.TypeString,
				ValidateFunc: validation.StringInSlice([]string{"bz2", "lzma", "xz"}, false),
			},
			Description: `Index file formats you would like to create in addition to the default Gzip (.gzip extension). Supported values are 'bz2','lzma' and 'xz'. Default value is 'bz2'.`,
		},
		"debian_default_architectures": {
			Type:             schema.TypeString,
			Optional:         true,
			Default:          "amd64,i386",
			ValidateDiagFunc: validation.ToDiagFunc(validation.All(validation.StringIsNotEmpty, validation.StringMatch(regexp.MustCompile(`.+(?:,.+)*`), "must be comma separated string"))),
			StateFunc:        util.FormatCommaSeparatedString,
			Description:      `Specifying  architectures will speed up Artifactory's initial metadata indexing process. The default architecture values are amd64 and i386.`,
		},
	}, repository.RepoLayoutRefSchema(Rclass, DebianPackageType))
View Source
var DockerVirtualSchema = util.MergeMaps(BaseVirtualRepoSchema, map[string]*schema.Schema{
	"resolve_docker_tags_by_timestamp": {
		Type:        schema.TypeBool,
		Optional:    true,
		Default:     false,
		Description: "When enabled, in cases where the same Docker tag exists in two or more of the aggregated repositories, Artifactory will return the tag that has the latest timestamp.",
	},
}, repository.RepoLayoutRefSchema(Rclass, DockerPackageType))
View Source
var GoVirtualSchema = util.MergeMaps(BaseVirtualRepoSchema, map[string]*schema.Schema{

	"external_dependencies_enabled": {
		Type:        schema.TypeBool,
		Default:     true,
		Optional:    true,
		Description: "When set (default), Artifactory will automatically follow remote VCS roots in 'go-import' meta tags to download remote modules.",
	},
	"external_dependencies_patterns": {
		Type:     schema.TypeList,
		Optional: true,
		ForceNew: true,
		Elem: &schema.Schema{
			Type: schema.TypeString,
		},
		RequiredWith: []string{"external_dependencies_enabled"},
		Description: "An allow list of Ant-style path patterns that determine which remote VCS roots Artifactory will " +
			"follow to download remote modules from, when presented with 'go-import' meta tags in the remote repository response.",
	},
}, repository.RepoLayoutRefSchema(Rclass, GoPackageType))
View Source
var HelmVirtualSchema = util.MergeMaps(
	BaseVirtualRepoSchema,
	RetrievalCachePeriodSecondsSchema,
	map[string]*schema.Schema{
		"use_namespaces": {
			Type:        schema.TypeBool,
			Optional:    true,
			Default:     false,
			Description: "From Artifactory 7.24.1 (SaaS Version), you can explicitly state a specific aggregated local or remote repository to fetch from a virtual by assigning namespaces to local and remote repositories\nSee https://www.jfrog.com/confluence/display/JFROG/Kubernetes+Helm+Chart+Repositories#KubernetesHelmChartRepositories-NamespaceSupportforHelmVirtualRepositories. Default to 'false'",
		},
	},
	repository.RepoLayoutRefSchema(Rclass, HelmPackageType))
View Source
var JavaVirtualSchema = map[string]*schema.Schema{
	"force_maven_authentication": {
		Type:        schema.TypeBool,
		Computed:    true,
		Optional:    true,
		Description: "User authentication is required when accessing the repository. An anonymous request will display an HTTP 401 error. This is also enforced when aggregated repositories support anonymous requests.",
	},
	"pom_repository_references_cleanup_policy": {
		Type:     schema.TypeString,
		Optional: true,
		Computed: true,
		ValidateFunc: validation.StringInSlice(
			[]string{"discard_active_reference", "discard_any_reference", "nothing"}, false,
		),
		Description: "(1: discard_active_reference) Discard Active References - Removes repository elements that are declared directly under project or under a profile in the same POM that is activeByDefault.\n" +
			"(2: discard_any_reference) Discard Any References - Removes all repository elements regardless of whether they are included in an active profile or not.\n" +
			"(3: nothing) Nothing - Does not remove any repository elements declared in the POM.",
	},
	"key_pair": {
		Type:        schema.TypeString,
		Optional:    true,
		Description: "The keypair used to sign artifacts",
	},
}
View Source
var NugetVirtualSchema = util.MergeMaps(BaseVirtualRepoSchema, map[string]*schema.Schema{
	"force_nuget_authentication": {
		Type:        schema.TypeBool,
		Optional:    true,
		Default:     false,
		Description: "If set, user authentication is required when accessing the repository. An anonymous request will display an HTTP 401 error. This is also enforced when aggregated repositories support anonymous requests.",
	},
}, repository.RepoLayoutRefSchema(Rclass, NugetPackageType))
View Source
var PackageTypesLikeGeneric = []string{
	"gems",
	"generic",
	"gitlfs",
	"composer",
	"p2",
	"pub",
	"puppet",
	"pypi",
	"swift",
	"terraform",
}
View Source
var PackageTypesLikeGenericWithRetrievalCachePeriodSecs = []string{
	"chef",
	"conan",
	"conda",
	"cran",
}
View Source
var RetrievalCachePeriodSecondsSchema = map[string]*schema.Schema{
	"retrieval_cache_period_seconds": {
		Type:     schema.TypeInt,
		Optional: true,
		Default:  7200,
		Description: "This value refers to the number of seconds to cache metadata files before checking for newer " +
			"versions on aggregated repositories. A value of 0 indicates no caching.",
		ValidateFunc: validation.IntAtLeast(0),
	},
}
View Source
var RpmVirtualSchema = util.MergeMaps(BaseVirtualRepoSchema, map[string]*schema.Schema{
	"primary_keypair_ref": {
		Type:             schema.TypeString,
		Optional:         true,
		ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotEmpty),
		Description:      "Primary keypair used to sign artifacts.",
	},
	"secondary_keypair_ref": {
		Type:             schema.TypeString,
		Optional:         true,
		ValidateDiagFunc: validation.ToDiagFunc(validation.StringIsNotEmpty),
		Description:      "Secondary keypair used to sign artifacts.",
	},
}, repository.RepoLayoutRefSchema(Rclass, RpmPackageType))

Functions

func ResourceArtifactoryVirtualAlpineRepository

func ResourceArtifactoryVirtualAlpineRepository() *schema.Resource

func ResourceArtifactoryVirtualBowerRepository

func ResourceArtifactoryVirtualBowerRepository() *schema.Resource

func ResourceArtifactoryVirtualDebianRepository

func ResourceArtifactoryVirtualDebianRepository() *schema.Resource

func ResourceArtifactoryVirtualDockerRepository added in v6.19.0

func ResourceArtifactoryVirtualDockerRepository() *schema.Resource

func ResourceArtifactoryVirtualGenericRepository

func ResourceArtifactoryVirtualGenericRepository(pkt string) *schema.Resource

func ResourceArtifactoryVirtualGoRepository

func ResourceArtifactoryVirtualGoRepository() *schema.Resource

func ResourceArtifactoryVirtualHelmRepository

func ResourceArtifactoryVirtualHelmRepository() *schema.Resource

func ResourceArtifactoryVirtualJavaRepository

func ResourceArtifactoryVirtualJavaRepository(repoType string) *schema.Resource

func ResourceArtifactoryVirtualNpmRepository added in v6.9.1

func ResourceArtifactoryVirtualNpmRepository() *schema.Resource

func ResourceArtifactoryVirtualNugetRepository

func ResourceArtifactoryVirtualNugetRepository() *schema.Resource

func ResourceArtifactoryVirtualRepositoryWithRetrievalCachePeriodSecs

func ResourceArtifactoryVirtualRepositoryWithRetrievalCachePeriodSecs(pkt string) *schema.Resource

func ResourceArtifactoryVirtualRpmRepository

func ResourceArtifactoryVirtualRpmRepository() *schema.Resource

Types

type CommonJavaVirtualRepositoryParams

type CommonJavaVirtualRepositoryParams struct {
	ForceMavenAuthentication             bool   `json:"forceMavenAuthentication,omitempty"`
	PomRepositoryReferencesCleanupPolicy string `hcl:"pom_repository_references_cleanup_policy" json:"pomRepositoryReferencesCleanupPolicy,omitempty"`
	KeyPair                              string `hcl:"key_pair" json:"keyPair,omitempty"`
}

type ExternalDependenciesVirtualRepositoryParams added in v6.9.1

type ExternalDependenciesVirtualRepositoryParams struct {
	RepositoryBaseParams
	ExternalDependenciesEnabled    bool     `json:"externalDependenciesEnabled"`
	ExternalDependenciesRemoteRepo string   `json:"externalDependenciesRemoteRepo"`
	ExternalDependenciesPatterns   []string `json:"externalDependenciesPatterns"`
}

type RepositoryBaseParams added in v6.10.0

type RepositoryBaseParams struct {
	Key                                           string   `hcl:"key" json:"key,omitempty"`
	ProjectKey                                    string   `json:"projectKey"`
	ProjectEnvironments                           []string `json:"environments"`
	Rclass                                        string   `json:"rclass"`
	PackageType                                   string   `hcl:"package_type" json:"packageType,omitempty"`
	Description                                   string   `json:"description"`
	Notes                                         string   `json:"notes"`
	IncludesPattern                               string   `json:"includesPattern"`
	ExcludesPattern                               string   `json:"excludesPattern"`
	RepoLayoutRef                                 string   `hcl:"repo_layout_ref" json:"repoLayoutRef,omitempty"`
	Repositories                                  []string `hcl:"repositories" json:"repositories,omitempty"`
	ArtifactoryRequestsCanRetrieveRemoteArtifacts bool     `hcl:"artifactory_requests_can_retrieve_remote_artifacts" json:"artifactoryRequestsCanRetrieveRemoteArtifacts"`
	DefaultDeploymentRepo                         string   `hcl:"default_deployment_repo" json:"defaultDeploymentRepo,omitempty"`
}

func UnpackBaseVirtRepo

func UnpackBaseVirtRepo(s *schema.ResourceData, packageType string) RepositoryBaseParams

func (RepositoryBaseParams) Id added in v6.10.0

func (bp RepositoryBaseParams) Id() string

type RepositoryBaseParamsWithRetrievalCachePeriodSecs added in v6.10.0

type RepositoryBaseParamsWithRetrievalCachePeriodSecs struct {
	RepositoryBaseParams
	VirtualRetrievalCachePeriodSecs int `hcl:"retrieval_cache_period_seconds" json:"virtualRetrievalCachePeriodSecs"`
}

func UnpackBaseVirtRepoWithRetrievalCachePeriodSecs

func UnpackBaseVirtRepoWithRetrievalCachePeriodSecs(s *schema.ResourceData, packageType string) RepositoryBaseParamsWithRetrievalCachePeriodSecs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL