1. Packages
  2. Nexus Provider
  3. API Docs
  4. RepositoryAptHosted
nexus 2.5.0 published on Monday, Apr 14, 2025 by datadrivers

nexus.RepositoryAptHosted

Explore with Pulumi AI

Use this resource to create a hosted apt repository.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as nexus from "@pulumi/nexus";

const bullseyeStable = new nexus.RepositoryAptHosted("bullseyeStable", {
    distribution: "bullseye",
    online: true,
    signing: {
        keypair: "keypair",
        passphrase: "passphrase",
    },
    storage: {
        blobStoreName: "default",
        strictContentTypeValidation: true,
        writePolicy: "ALLOW",
    },
});
Copy
import pulumi
import pulumi_nexus as nexus

bullseye_stable = nexus.RepositoryAptHosted("bullseyeStable",
    distribution="bullseye",
    online=True,
    signing={
        "keypair": "keypair",
        "passphrase": "passphrase",
    },
    storage={
        "blob_store_name": "default",
        "strict_content_type_validation": True,
        "write_policy": "ALLOW",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/nexus/v2/nexus"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := nexus.NewRepositoryAptHosted(ctx, "bullseyeStable", &nexus.RepositoryAptHostedArgs{
			Distribution: pulumi.String("bullseye"),
			Online:       pulumi.Bool(true),
			Signing: &nexus.RepositoryAptHostedSigningArgs{
				Keypair:    pulumi.String("keypair"),
				Passphrase: pulumi.String("passphrase"),
			},
			Storage: &nexus.RepositoryAptHostedStorageArgs{
				BlobStoreName:               pulumi.String("default"),
				StrictContentTypeValidation: pulumi.Bool(true),
				WritePolicy:                 pulumi.String("ALLOW"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Nexus = Pulumi.Nexus;

return await Deployment.RunAsync(() => 
{
    var bullseyeStable = new Nexus.RepositoryAptHosted("bullseyeStable", new()
    {
        Distribution = "bullseye",
        Online = true,
        Signing = new Nexus.Inputs.RepositoryAptHostedSigningArgs
        {
            Keypair = "keypair",
            Passphrase = "passphrase",
        },
        Storage = new Nexus.Inputs.RepositoryAptHostedStorageArgs
        {
            BlobStoreName = "default",
            StrictContentTypeValidation = true,
            WritePolicy = "ALLOW",
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.nexus.RepositoryAptHosted;
import com.pulumi.nexus.RepositoryAptHostedArgs;
import com.pulumi.nexus.inputs.RepositoryAptHostedSigningArgs;
import com.pulumi.nexus.inputs.RepositoryAptHostedStorageArgs;
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 bullseyeStable = new RepositoryAptHosted("bullseyeStable", RepositoryAptHostedArgs.builder()
            .distribution("bullseye")
            .online(true)
            .signing(RepositoryAptHostedSigningArgs.builder()
                .keypair("keypair")
                .passphrase("passphrase")
                .build())
            .storage(RepositoryAptHostedStorageArgs.builder()
                .blobStoreName("default")
                .strictContentTypeValidation(true)
                .writePolicy("ALLOW")
                .build())
            .build());

    }
}
Copy
resources:
  bullseyeStable:
    type: nexus:RepositoryAptHosted
    properties:
      distribution: bullseye
      online: true
      signing:
        keypair: keypair
        passphrase: passphrase
      storage:
        blobStoreName: default
        strictContentTypeValidation: true
        writePolicy: ALLOW
Copy

Create RepositoryAptHosted Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new RepositoryAptHosted(name: string, args: RepositoryAptHostedArgs, opts?: CustomResourceOptions);
@overload
def RepositoryAptHosted(resource_name: str,
                        args: RepositoryAptHostedArgs,
                        opts: Optional[ResourceOptions] = None)

@overload
def RepositoryAptHosted(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        distribution: Optional[str] = None,
                        signing: Optional[RepositoryAptHostedSigningArgs] = None,
                        storage: Optional[RepositoryAptHostedStorageArgs] = None,
                        cleanups: Optional[Sequence[RepositoryAptHostedCleanupArgs]] = None,
                        component: Optional[RepositoryAptHostedComponentArgs] = None,
                        name: Optional[str] = None,
                        online: Optional[bool] = None)
func NewRepositoryAptHosted(ctx *Context, name string, args RepositoryAptHostedArgs, opts ...ResourceOption) (*RepositoryAptHosted, error)
public RepositoryAptHosted(string name, RepositoryAptHostedArgs args, CustomResourceOptions? opts = null)
public RepositoryAptHosted(String name, RepositoryAptHostedArgs args)
public RepositoryAptHosted(String name, RepositoryAptHostedArgs args, CustomResourceOptions options)
type: nexus:RepositoryAptHosted
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RepositoryAptHostedArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RepositoryAptHostedArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RepositoryAptHostedArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RepositoryAptHostedArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RepositoryAptHostedArgs
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 repositoryAptHostedResource = new Nexus.RepositoryAptHosted("repositoryAptHostedResource", new()
{
    Distribution = "string",
    Signing = new Nexus.Inputs.RepositoryAptHostedSigningArgs
    {
        Keypair = "string",
        Passphrase = "string",
    },
    Storage = new Nexus.Inputs.RepositoryAptHostedStorageArgs
    {
        BlobStoreName = "string",
        StrictContentTypeValidation = false,
        WritePolicy = "string",
    },
    Cleanups = new[]
    {
        new Nexus.Inputs.RepositoryAptHostedCleanupArgs
        {
            PolicyNames = new[]
            {
                "string",
            },
        },
    },
    Component = new Nexus.Inputs.RepositoryAptHostedComponentArgs
    {
        ProprietaryComponents = false,
    },
    Name = "string",
    Online = false,
});
Copy
example, err := nexus.NewRepositoryAptHosted(ctx, "repositoryAptHostedResource", &nexus.RepositoryAptHostedArgs{
Distribution: pulumi.String("string"),
Signing: &.RepositoryAptHostedSigningArgs{
Keypair: pulumi.String("string"),
Passphrase: pulumi.String("string"),
},
Storage: &.RepositoryAptHostedStorageArgs{
BlobStoreName: pulumi.String("string"),
StrictContentTypeValidation: pulumi.Bool(false),
WritePolicy: pulumi.String("string"),
},
Cleanups: .RepositoryAptHostedCleanupArray{
&.RepositoryAptHostedCleanupArgs{
PolicyNames: pulumi.StringArray{
pulumi.String("string"),
},
},
},
Component: &.RepositoryAptHostedComponentArgs{
ProprietaryComponents: pulumi.Bool(false),
},
Name: pulumi.String("string"),
Online: pulumi.Bool(false),
})
Copy
var repositoryAptHostedResource = new RepositoryAptHosted("repositoryAptHostedResource", RepositoryAptHostedArgs.builder()
    .distribution("string")
    .signing(RepositoryAptHostedSigningArgs.builder()
        .keypair("string")
        .passphrase("string")
        .build())
    .storage(RepositoryAptHostedStorageArgs.builder()
        .blobStoreName("string")
        .strictContentTypeValidation(false)
        .writePolicy("string")
        .build())
    .cleanups(RepositoryAptHostedCleanupArgs.builder()
        .policyNames("string")
        .build())
    .component(RepositoryAptHostedComponentArgs.builder()
        .proprietaryComponents(false)
        .build())
    .name("string")
    .online(false)
    .build());
Copy
repository_apt_hosted_resource = nexus.RepositoryAptHosted("repositoryAptHostedResource",
    distribution="string",
    signing={
        "keypair": "string",
        "passphrase": "string",
    },
    storage={
        "blob_store_name": "string",
        "strict_content_type_validation": False,
        "write_policy": "string",
    },
    cleanups=[{
        "policy_names": ["string"],
    }],
    component={
        "proprietary_components": False,
    },
    name="string",
    online=False)
Copy
const repositoryAptHostedResource = new nexus.RepositoryAptHosted("repositoryAptHostedResource", {
    distribution: "string",
    signing: {
        keypair: "string",
        passphrase: "string",
    },
    storage: {
        blobStoreName: "string",
        strictContentTypeValidation: false,
        writePolicy: "string",
    },
    cleanups: [{
        policyNames: ["string"],
    }],
    component: {
        proprietaryComponents: false,
    },
    name: "string",
    online: false,
});
Copy
type: nexus:RepositoryAptHosted
properties:
    cleanups:
        - policyNames:
            - string
    component:
        proprietaryComponents: false
    distribution: string
    name: string
    online: false
    signing:
        keypair: string
        passphrase: string
    storage:
        blobStoreName: string
        strictContentTypeValidation: false
        writePolicy: string
Copy

RepositoryAptHosted 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 RepositoryAptHosted resource accepts the following input properties:

Distribution This property is required. string
Distribution to fetch
Signing This property is required. RepositoryAptHostedSigning
Signing contains signing data of hosted repositores of format Apt
Storage This property is required. RepositoryAptHostedStorage
The storage configuration of the repository
Cleanups List<RepositoryAptHostedCleanup>
Cleanup policies
Component RepositoryAptHostedComponent
Component configuration for the hosted repository
Name string
A unique identifier for this repository
Online bool
Whether this repository accepts incoming requests
Distribution This property is required. string
Distribution to fetch
Signing This property is required. RepositoryAptHostedSigningArgs
Signing contains signing data of hosted repositores of format Apt
Storage This property is required. RepositoryAptHostedStorageArgs
The storage configuration of the repository
Cleanups []RepositoryAptHostedCleanupArgs
Cleanup policies
Component RepositoryAptHostedComponentArgs
Component configuration for the hosted repository
Name string
A unique identifier for this repository
Online bool
Whether this repository accepts incoming requests
distribution This property is required. String
Distribution to fetch
signing This property is required. RepositoryAptHostedSigning
Signing contains signing data of hosted repositores of format Apt
storage This property is required. RepositoryAptHostedStorage
The storage configuration of the repository
cleanups List<RepositoryAptHostedCleanup>
Cleanup policies
component RepositoryAptHostedComponent
Component configuration for the hosted repository
name String
A unique identifier for this repository
online Boolean
Whether this repository accepts incoming requests
distribution This property is required. string
Distribution to fetch
signing This property is required. RepositoryAptHostedSigning
Signing contains signing data of hosted repositores of format Apt
storage This property is required. RepositoryAptHostedStorage
The storage configuration of the repository
cleanups RepositoryAptHostedCleanup[]
Cleanup policies
component RepositoryAptHostedComponent
Component configuration for the hosted repository
name string
A unique identifier for this repository
online boolean
Whether this repository accepts incoming requests
distribution This property is required. str
Distribution to fetch
signing This property is required. RepositoryAptHostedSigningArgs
Signing contains signing data of hosted repositores of format Apt
storage This property is required. RepositoryAptHostedStorageArgs
The storage configuration of the repository
cleanups Sequence[RepositoryAptHostedCleanupArgs]
Cleanup policies
component RepositoryAptHostedComponentArgs
Component configuration for the hosted repository
name str
A unique identifier for this repository
online bool
Whether this repository accepts incoming requests
distribution This property is required. String
Distribution to fetch
signing This property is required. Property Map
Signing contains signing data of hosted repositores of format Apt
storage This property is required. Property Map
The storage configuration of the repository
cleanups List<Property Map>
Cleanup policies
component Property Map
Component configuration for the hosted repository
name String
A unique identifier for this repository
online Boolean
Whether this repository accepts incoming requests

Outputs

All input properties are implicitly available as output properties. Additionally, the RepositoryAptHosted 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 RepositoryAptHosted Resource

Get an existing RepositoryAptHosted 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?: RepositoryAptHostedState, opts?: CustomResourceOptions): RepositoryAptHosted
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cleanups: Optional[Sequence[RepositoryAptHostedCleanupArgs]] = None,
        component: Optional[RepositoryAptHostedComponentArgs] = None,
        distribution: Optional[str] = None,
        name: Optional[str] = None,
        online: Optional[bool] = None,
        signing: Optional[RepositoryAptHostedSigningArgs] = None,
        storage: Optional[RepositoryAptHostedStorageArgs] = None) -> RepositoryAptHosted
func GetRepositoryAptHosted(ctx *Context, name string, id IDInput, state *RepositoryAptHostedState, opts ...ResourceOption) (*RepositoryAptHosted, error)
public static RepositoryAptHosted Get(string name, Input<string> id, RepositoryAptHostedState? state, CustomResourceOptions? opts = null)
public static RepositoryAptHosted get(String name, Output<String> id, RepositoryAptHostedState state, CustomResourceOptions options)
resources:  _:    type: nexus:RepositoryAptHosted    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Cleanups List<RepositoryAptHostedCleanup>
Cleanup policies
Component RepositoryAptHostedComponent
Component configuration for the hosted repository
Distribution string
Distribution to fetch
Name string
A unique identifier for this repository
Online bool
Whether this repository accepts incoming requests
Signing RepositoryAptHostedSigning
Signing contains signing data of hosted repositores of format Apt
Storage RepositoryAptHostedStorage
The storage configuration of the repository
Cleanups []RepositoryAptHostedCleanupArgs
Cleanup policies
Component RepositoryAptHostedComponentArgs
Component configuration for the hosted repository
Distribution string
Distribution to fetch
Name string
A unique identifier for this repository
Online bool
Whether this repository accepts incoming requests
Signing RepositoryAptHostedSigningArgs
Signing contains signing data of hosted repositores of format Apt
Storage RepositoryAptHostedStorageArgs
The storage configuration of the repository
cleanups List<RepositoryAptHostedCleanup>
Cleanup policies
component RepositoryAptHostedComponent
Component configuration for the hosted repository
distribution String
Distribution to fetch
name String
A unique identifier for this repository
online Boolean
Whether this repository accepts incoming requests
signing RepositoryAptHostedSigning
Signing contains signing data of hosted repositores of format Apt
storage RepositoryAptHostedStorage
The storage configuration of the repository
cleanups RepositoryAptHostedCleanup[]
Cleanup policies
component RepositoryAptHostedComponent
Component configuration for the hosted repository
distribution string
Distribution to fetch
name string
A unique identifier for this repository
online boolean
Whether this repository accepts incoming requests
signing RepositoryAptHostedSigning
Signing contains signing data of hosted repositores of format Apt
storage RepositoryAptHostedStorage
The storage configuration of the repository
cleanups Sequence[RepositoryAptHostedCleanupArgs]
Cleanup policies
component RepositoryAptHostedComponentArgs
Component configuration for the hosted repository
distribution str
Distribution to fetch
name str
A unique identifier for this repository
online bool
Whether this repository accepts incoming requests
signing RepositoryAptHostedSigningArgs
Signing contains signing data of hosted repositores of format Apt
storage RepositoryAptHostedStorageArgs
The storage configuration of the repository
cleanups List<Property Map>
Cleanup policies
component Property Map
Component configuration for the hosted repository
distribution String
Distribution to fetch
name String
A unique identifier for this repository
online Boolean
Whether this repository accepts incoming requests
signing Property Map
Signing contains signing data of hosted repositores of format Apt
storage Property Map
The storage configuration of the repository

Supporting Types

RepositoryAptHostedCleanup
, RepositoryAptHostedCleanupArgs

PolicyNames List<string>
List of policy names
PolicyNames []string
List of policy names
policyNames List<String>
List of policy names
policyNames string[]
List of policy names
policy_names Sequence[str]
List of policy names
policyNames List<String>
List of policy names

RepositoryAptHostedComponent
, RepositoryAptHostedComponentArgs

ProprietaryComponents This property is required. bool
Components in this repository count as proprietary for namespace conflict attacks (requires Sonatype Nexus Firewall)
ProprietaryComponents This property is required. bool
Components in this repository count as proprietary for namespace conflict attacks (requires Sonatype Nexus Firewall)
proprietaryComponents This property is required. Boolean
Components in this repository count as proprietary for namespace conflict attacks (requires Sonatype Nexus Firewall)
proprietaryComponents This property is required. boolean
Components in this repository count as proprietary for namespace conflict attacks (requires Sonatype Nexus Firewall)
proprietary_components This property is required. bool
Components in this repository count as proprietary for namespace conflict attacks (requires Sonatype Nexus Firewall)
proprietaryComponents This property is required. Boolean
Components in this repository count as proprietary for namespace conflict attacks (requires Sonatype Nexus Firewall)

RepositoryAptHostedSigning
, RepositoryAptHostedSigningArgs

Keypair This property is required. string
PGP signing key pair (armored private key e.g. gpg --export-secret-key --armor) If passphrase is unset, the keypair cannot be read from the nexus api. When reading the resource, the keypair will be read from the previous state, so external changes won't be detected in this case.
Passphrase string
Passphrase to access PGP signing key. This value cannot be read from the nexus api. When reading the resource, the value will be read from the previous state, so external changes won't be detected.
Keypair This property is required. string
PGP signing key pair (armored private key e.g. gpg --export-secret-key --armor) If passphrase is unset, the keypair cannot be read from the nexus api. When reading the resource, the keypair will be read from the previous state, so external changes won't be detected in this case.
Passphrase string
Passphrase to access PGP signing key. This value cannot be read from the nexus api. When reading the resource, the value will be read from the previous state, so external changes won't be detected.
keypair This property is required. String
PGP signing key pair (armored private key e.g. gpg --export-secret-key --armor) If passphrase is unset, the keypair cannot be read from the nexus api. When reading the resource, the keypair will be read from the previous state, so external changes won't be detected in this case.
passphrase String
Passphrase to access PGP signing key. This value cannot be read from the nexus api. When reading the resource, the value will be read from the previous state, so external changes won't be detected.
keypair This property is required. string
PGP signing key pair (armored private key e.g. gpg --export-secret-key --armor) If passphrase is unset, the keypair cannot be read from the nexus api. When reading the resource, the keypair will be read from the previous state, so external changes won't be detected in this case.
passphrase string
Passphrase to access PGP signing key. This value cannot be read from the nexus api. When reading the resource, the value will be read from the previous state, so external changes won't be detected.
keypair This property is required. str
PGP signing key pair (armored private key e.g. gpg --export-secret-key --armor) If passphrase is unset, the keypair cannot be read from the nexus api. When reading the resource, the keypair will be read from the previous state, so external changes won't be detected in this case.
passphrase str
Passphrase to access PGP signing key. This value cannot be read from the nexus api. When reading the resource, the value will be read from the previous state, so external changes won't be detected.
keypair This property is required. String
PGP signing key pair (armored private key e.g. gpg --export-secret-key --armor) If passphrase is unset, the keypair cannot be read from the nexus api. When reading the resource, the keypair will be read from the previous state, so external changes won't be detected in this case.
passphrase String
Passphrase to access PGP signing key. This value cannot be read from the nexus api. When reading the resource, the value will be read from the previous state, so external changes won't be detected.

RepositoryAptHostedStorage
, RepositoryAptHostedStorageArgs

BlobStoreName This property is required. string
Blob store used to store repository contents
StrictContentTypeValidation This property is required. bool
Whether to validate uploaded content's MIME type appropriate for the repository format
WritePolicy string
Controls if deployments of and updates to assets are allowed
BlobStoreName This property is required. string
Blob store used to store repository contents
StrictContentTypeValidation This property is required. bool
Whether to validate uploaded content's MIME type appropriate for the repository format
WritePolicy string
Controls if deployments of and updates to assets are allowed
blobStoreName This property is required. String
Blob store used to store repository contents
strictContentTypeValidation This property is required. Boolean
Whether to validate uploaded content's MIME type appropriate for the repository format
writePolicy String
Controls if deployments of and updates to assets are allowed
blobStoreName This property is required. string
Blob store used to store repository contents
strictContentTypeValidation This property is required. boolean
Whether to validate uploaded content's MIME type appropriate for the repository format
writePolicy string
Controls if deployments of and updates to assets are allowed
blob_store_name This property is required. str
Blob store used to store repository contents
strict_content_type_validation This property is required. bool
Whether to validate uploaded content's MIME type appropriate for the repository format
write_policy str
Controls if deployments of and updates to assets are allowed
blobStoreName This property is required. String
Blob store used to store repository contents
strictContentTypeValidation This property is required. Boolean
Whether to validate uploaded content's MIME type appropriate for the repository format
writePolicy String
Controls if deployments of and updates to assets are allowed

Import

import using the name of repository

$ pulumi import nexus:index/repositoryAptHosted:RepositoryAptHosted bullseye_stable bullseye-stable
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
nexus datadrivers/terraform-provider-nexus
License
Notes
This Pulumi package is based on the nexus Terraform Provider.