nexus

package
v1.11.1 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Use this to create a Nexus blobstore.

Example Usage

```hcl

data "nexus_blobstore" "docker" {
	name = "docker"
}

```

Use this data source to work with privileges

Example Usage

```hcl

data "nexus_privileges" "example" {
  domain     = "application"
  format     = "maven2"
  repository = "maven-public"
  type       = "repository-admin"
}

```

Use this data source to get a repository data structure

Example Usage

```hcl

data "nexus_repository" "maven-central" {
  name = "maven-central"
}

```

Use this data source to work with routing rules

Example Usage

```hcl

data "nexus_routing_rule" "stop_leaks" {
  name = "stop-leaks"
}

```

Use this data source to work with LDAP security

Example Usage

```hcl data "nexus_security_ldap" "default" {} ```

Use this data source to work with Realms security

Example Usage

```hcl data "nexus_security_realms" "default" {} ```

Use this data source to get a repository data structure

Example Usage

```hcl

data "nexus_user" "admin" {
  userid = "admin"
}

```

Use this resource to create a Nexus blobstore.

Example Usage

Example Usage for file store

```hcl

resource "nexus_blobstore" "default" {
  name = "blobstore-file"
  type = "File"
  path = "/nexus-data/blobstore-file"

  soft_quota {
    limit = 1024000000
    type  = "spaceRemainingQuota"
  }
}

```

Example Usage with S3 bucket

```hcl

resource "nexus_blobstore" "aws" {
  name = "blobstore-s3"
  type = "S3"

  bucket_configuration {
    bucket {
      name   = "aws-bucket-name"
      region = "us-central-1"
    }

    bucket_security {
      access_key_id = "<your-aws-access-key-id>"
      secret_access_key = "<your-aws-secret-access-key>"
    }
  }

  soft_quota {
    limit = 1024
    type  = "spaceRemainingQuota"
  }
}

```

Use this resource to create a Nexus Content Selector

Example Usage

```hcl

resource "nexus_content_selector" "docker-public" {
  name        = "docker-public"
  description = "A content selector matching public docker images."
  expression  = "path =^ \"/v2/public/\""
}

```

Use this resource to create a Nexus privilege

Example Usage

```hcl

resource "nexus_privilege" "example" {
  name    = "example-privilige"
  actions = "all"
  type    = "repository-admin"
}

```

Use this resource to create a Nexus Repository.

Example Usage

Example Usage - Apt hosted repository

```hcl

resource "nexus_repository" "apt_hosted" {
  name   = "apt-repo"
  format = "apt"
  type   = "hosted"

  apt {
    distribution = "bionic"
  }

  apt_signing {
    keypair    = "<keypair>"
    passphrase = "<passphrase>"
  }

  storage {
    blob_store_name                = "default"
    strict_content_type_validation = true
    write_policy                   = "ALLOW_ONCE"
  }
}

```

Example Usage - Docker group repository

```hcl

resource "nexus_repository" "docker_group" {
  name   = "docker-group"
  format = "docker"
  type   = "group"
  online = true

  group {
    member_names = [
      "docker_releases",
      "docker_hub"
    ]
  }

  docker {
    force_basic_auth = false
    http_port        = 5000
    https_port       = 0
    v1enabled        = false
  }

  storage {
    blob_store_name                = "docker_group_blobstore"
    strict_content_type_validation = true
  }
}

```

Use this resource to create a Nexus Role.

Example Usage

Example Usage - Create a group with roles

```hcl

resource "nexus_role" "nx-admin" {
  roleid      = "nx-admin"
  name        = "nx-admin"
  description = "Administrator role"
  privileges  = ["nx-all"]
  roles       = []
}

```

Example Usage - Create a group with privileges

```hcl

resource "nexus_role" "docker_deploy" {
  description = "Docker deployment role"
  name        = "docker-deploy"
  privileges = [
    "nx-repository-view-docker-*-*",
  ]
  roleid = "docker-deploy"
}

```

Use this resource to create a Nexus Routing Rule.

Example Usage

```hcl

resource "nexus_routing_rule" "stop_leaks" {
  name        = "stop-leaks"
  description = "Prevent requests of internal names"
  mode        = "BLOCK"
  matchers    = [
	"^/com/example/.*",
	"^/org/example/.*",
  ]
}

```

Use this resource to create and execute a custom script.

Example Usage

```hcl

resource "nexus_script" "repo_pypi_internal" {
  name    = "create-repo-pypi-internal"
  type    = "groovy"
  content = "repository.createPyPiHosted('pypi-internal')"
}

```

Use this resource to create a Nexus Security LDAP

Example Usage

```hcl

resource "nexus_security_ldap" "example" {
  auth_password                  = "t0ps3cr3t"
  auth_realm                     = "EXAMPLE"
  auth_schema                    = ""
  auth_username                  = "admin"
  connection_retry_delay_seconds = 1
  connection_timeout_seconds     = 1
  group_base_dn                  = "ou=Group"
  group_id_attribute             = "cn"
  group_member_attribute         = "memberUid"
  group_member_format            = "uid=${username},ou=people,dc=example,dc=com"
  group_object_class             = "example"
  group_subtree                  = true
  host                           = "ldap.example.com"
  ldap_groups_as_roles           = true
  max_incident_count             = 1
  name                           = "example-ldap"
  port                           = 389
  protocol                       = "LDAP"
  search_base                    = "dc=example,dc=com"
  user_base_dn                   = "ou=people"
  user_email_address_attribute   = "mail"
  user_id_attribute              = "uid"
  user_ldap_filter               = "(|(mail=*@example.com)(uid=dom*))"
  user_member_of_attribute       = "memberOf"
  user_object_class              = "posixGroup"
  user_password_attribute        = "exmaple"
  user_real_name_attribute       = "cn"
  user_subtree                   = true
}

```

Use this resource to change the LDAP order.

Example Usage

Set order of LDAP server

```hcl

resource "nexus_security_ldap" "server1" {
  ...
  name = "server1"
}
resource "nexus_security_ldap" "server2" {
  ...
  name = "server2"
}
resource "nexus_security_ldap_order" {
  order = [
    nexus_security_ldap.server1.name,
    nexus_security_ldap.server2.name,
  ]
}

```

Use this resource to activate Nexus Security LDAP and order

Example Usage

```hcl

resource "nexus_security_realms" "example" {
  active = [
	"NexusAuthenticatingRealm",
	"NexusAuthorizingRealm",
  ]
}

```

Use this resource to manage users

Example Usage

```hcl

resource "nexus_user" "admin" {
  userid    = "admin"
  firstname = "Administrator"
  lastname  = "User"
  email     = "nexus@example.com"
  password  = "admin123"
  roles     = ["nx-admin"]
  status    = "active"
}

```

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Provider

func Provider() terraform.ResourceProvider

Provider returns a terraform.ResourceProvider

Types

This section is empty.

Jump to

Keyboard shortcuts

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