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

nexus.MailConfig

Explore with Pulumi AI

nexus logo
nexus 2.5.0 published on Monday, Apr 14, 2025 by datadrivers

    Use this resource to configure Nexus’ mailing behaviour

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as nexus from "@pulumi/nexus";
    
    const config = new nexus.MailConfig("config", {
        enabled: true,
        fromAddress: "from@examplehost.org",
        host: "examplehost.org",
        nexusTrustStoreEnabled: true,
        password: "topsecret",
        port: 25,
        sslOnConnectEnabled: true,
        startTlsEnabled: true,
        startTlsRequired: true,
        subjectPrefix: "prefix: ",
        username: "uname",
    });
    
    import pulumi
    import pulumi_nexus as nexus
    
    config = nexus.MailConfig("config",
        enabled=True,
        from_address="from@examplehost.org",
        host="examplehost.org",
        nexus_trust_store_enabled=True,
        password="topsecret",
        port=25,
        ssl_on_connect_enabled=True,
        start_tls_enabled=True,
        start_tls_required=True,
        subject_prefix="prefix: ",
        username="uname")
    
    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.NewMailConfig(ctx, "config", &nexus.MailConfigArgs{
    			Enabled:                pulumi.Bool(true),
    			FromAddress:            pulumi.String("from@examplehost.org"),
    			Host:                   pulumi.String("examplehost.org"),
    			NexusTrustStoreEnabled: pulumi.Bool(true),
    			Password:               pulumi.String("topsecret"),
    			Port:                   pulumi.Float64(25),
    			SslOnConnectEnabled:    pulumi.Bool(true),
    			StartTlsEnabled:        pulumi.Bool(true),
    			StartTlsRequired:       pulumi.Bool(true),
    			SubjectPrefix:          pulumi.String("prefix: "),
    			Username:               pulumi.String("uname"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Nexus = Pulumi.Nexus;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Nexus.MailConfig("config", new()
        {
            Enabled = true,
            FromAddress = "from@examplehost.org",
            Host = "examplehost.org",
            NexusTrustStoreEnabled = true,
            Password = "topsecret",
            Port = 25,
            SslOnConnectEnabled = true,
            StartTlsEnabled = true,
            StartTlsRequired = true,
            SubjectPrefix = "prefix: ",
            Username = "uname",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.nexus.MailConfig;
    import com.pulumi.nexus.MailConfigArgs;
    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 config = new MailConfig("config", MailConfigArgs.builder()
                .enabled(true)
                .fromAddress("from@examplehost.org")
                .host("examplehost.org")
                .nexusTrustStoreEnabled(true)
                .password("topsecret")
                .port(25)
                .sslOnConnectEnabled(true)
                .startTlsEnabled(true)
                .startTlsRequired(true)
                .subjectPrefix("prefix: ")
                .username("uname")
                .build());
    
        }
    }
    
    resources:
      config:
        type: nexus:MailConfig
        properties:
          enabled: true
          fromAddress: from@examplehost.org
          host: examplehost.org
          nexusTrustStoreEnabled: true
          password: topsecret
          port: 25
          sslOnConnectEnabled: true
          startTlsEnabled: true
          startTlsRequired: true
          subjectPrefix: 'prefix: '
          username: uname
    

    Create MailConfig Resource

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

    Constructor syntax

    new MailConfig(name: string, args: MailConfigArgs, opts?: CustomResourceOptions);
    @overload
    def MailConfig(resource_name: str,
                   args: MailConfigArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def MailConfig(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   from_address: Optional[str] = None,
                   host: Optional[str] = None,
                   port: Optional[float] = None,
                   enabled: Optional[bool] = None,
                   nexus_trust_store_enabled: Optional[bool] = None,
                   password: Optional[str] = None,
                   ssl_on_connect_enabled: Optional[bool] = None,
                   ssl_server_identity_check_enabled: Optional[bool] = None,
                   start_tls_enabled: Optional[bool] = None,
                   start_tls_required: Optional[bool] = None,
                   subject_prefix: Optional[str] = None,
                   username: Optional[str] = None)
    func NewMailConfig(ctx *Context, name string, args MailConfigArgs, opts ...ResourceOption) (*MailConfig, error)
    public MailConfig(string name, MailConfigArgs args, CustomResourceOptions? opts = null)
    public MailConfig(String name, MailConfigArgs args)
    public MailConfig(String name, MailConfigArgs args, CustomResourceOptions options)
    
    type: nexus:MailConfig
    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 MailConfigArgs
    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 MailConfigArgs
    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 MailConfigArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args MailConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args MailConfigArgs
    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 mailConfigResource = new Nexus.MailConfig("mailConfigResource", new()
    {
        FromAddress = "string",
        Host = "string",
        Port = 0,
        Enabled = false,
        NexusTrustStoreEnabled = false,
        Password = "string",
        SslOnConnectEnabled = false,
        SslServerIdentityCheckEnabled = false,
        StartTlsEnabled = false,
        StartTlsRequired = false,
        SubjectPrefix = "string",
        Username = "string",
    });
    
    example, err := nexus.NewMailConfig(ctx, "mailConfigResource", &nexus.MailConfigArgs{
    	FromAddress:                   pulumi.String("string"),
    	Host:                          pulumi.String("string"),
    	Port:                          pulumi.Float64(0),
    	Enabled:                       pulumi.Bool(false),
    	NexusTrustStoreEnabled:        pulumi.Bool(false),
    	Password:                      pulumi.String("string"),
    	SslOnConnectEnabled:           pulumi.Bool(false),
    	SslServerIdentityCheckEnabled: pulumi.Bool(false),
    	StartTlsEnabled:               pulumi.Bool(false),
    	StartTlsRequired:              pulumi.Bool(false),
    	SubjectPrefix:                 pulumi.String("string"),
    	Username:                      pulumi.String("string"),
    })
    
    var mailConfigResource = new MailConfig("mailConfigResource", MailConfigArgs.builder()
        .fromAddress("string")
        .host("string")
        .port(0)
        .enabled(false)
        .nexusTrustStoreEnabled(false)
        .password("string")
        .sslOnConnectEnabled(false)
        .sslServerIdentityCheckEnabled(false)
        .startTlsEnabled(false)
        .startTlsRequired(false)
        .subjectPrefix("string")
        .username("string")
        .build());
    
    mail_config_resource = nexus.MailConfig("mailConfigResource",
        from_address="string",
        host="string",
        port=0,
        enabled=False,
        nexus_trust_store_enabled=False,
        password="string",
        ssl_on_connect_enabled=False,
        ssl_server_identity_check_enabled=False,
        start_tls_enabled=False,
        start_tls_required=False,
        subject_prefix="string",
        username="string")
    
    const mailConfigResource = new nexus.MailConfig("mailConfigResource", {
        fromAddress: "string",
        host: "string",
        port: 0,
        enabled: false,
        nexusTrustStoreEnabled: false,
        password: "string",
        sslOnConnectEnabled: false,
        sslServerIdentityCheckEnabled: false,
        startTlsEnabled: false,
        startTlsRequired: false,
        subjectPrefix: "string",
        username: "string",
    });
    
    type: nexus:MailConfig
    properties:
        enabled: false
        fromAddress: string
        host: string
        nexusTrustStoreEnabled: false
        password: string
        port: 0
        sslOnConnectEnabled: false
        sslServerIdentityCheckEnabled: false
        startTlsEnabled: false
        startTlsRequired: false
        subjectPrefix: string
        username: string
    

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

    FromAddress string
    fromAddress
    Host string
    hostname
    Port double
    port
    Enabled bool
    Whether the config is enabled or not
    NexusTrustStoreEnabled bool
    SSL on connect enabled
    Password string
    Password
    SslOnConnectEnabled bool
    SSL on connect enabled
    SslServerIdentityCheckEnabled bool
    SSL on connect enabled
    StartTlsEnabled bool
    Star TLS Enabled
    StartTlsRequired bool
    Star TLS required
    SubjectPrefix string
    Subject prefix
    Username string
    Username
    FromAddress string
    fromAddress
    Host string
    hostname
    Port float64
    port
    Enabled bool
    Whether the config is enabled or not
    NexusTrustStoreEnabled bool
    SSL on connect enabled
    Password string
    Password
    SslOnConnectEnabled bool
    SSL on connect enabled
    SslServerIdentityCheckEnabled bool
    SSL on connect enabled
    StartTlsEnabled bool
    Star TLS Enabled
    StartTlsRequired bool
    Star TLS required
    SubjectPrefix string
    Subject prefix
    Username string
    Username
    fromAddress String
    fromAddress
    host String
    hostname
    port Double
    port
    enabled Boolean
    Whether the config is enabled or not
    nexusTrustStoreEnabled Boolean
    SSL on connect enabled
    password String
    Password
    sslOnConnectEnabled Boolean
    SSL on connect enabled
    sslServerIdentityCheckEnabled Boolean
    SSL on connect enabled
    startTlsEnabled Boolean
    Star TLS Enabled
    startTlsRequired Boolean
    Star TLS required
    subjectPrefix String
    Subject prefix
    username String
    Username
    fromAddress string
    fromAddress
    host string
    hostname
    port number
    port
    enabled boolean
    Whether the config is enabled or not
    nexusTrustStoreEnabled boolean
    SSL on connect enabled
    password string
    Password
    sslOnConnectEnabled boolean
    SSL on connect enabled
    sslServerIdentityCheckEnabled boolean
    SSL on connect enabled
    startTlsEnabled boolean
    Star TLS Enabled
    startTlsRequired boolean
    Star TLS required
    subjectPrefix string
    Subject prefix
    username string
    Username
    from_address str
    fromAddress
    host str
    hostname
    port float
    port
    enabled bool
    Whether the config is enabled or not
    nexus_trust_store_enabled bool
    SSL on connect enabled
    password str
    Password
    ssl_on_connect_enabled bool
    SSL on connect enabled
    ssl_server_identity_check_enabled bool
    SSL on connect enabled
    start_tls_enabled bool
    Star TLS Enabled
    start_tls_required bool
    Star TLS required
    subject_prefix str
    Subject prefix
    username str
    Username
    fromAddress String
    fromAddress
    host String
    hostname
    port Number
    port
    enabled Boolean
    Whether the config is enabled or not
    nexusTrustStoreEnabled Boolean
    SSL on connect enabled
    password String
    Password
    sslOnConnectEnabled Boolean
    SSL on connect enabled
    sslServerIdentityCheckEnabled Boolean
    SSL on connect enabled
    startTlsEnabled Boolean
    Star TLS Enabled
    startTlsRequired Boolean
    Star TLS required
    subjectPrefix String
    Subject prefix
    username String
    Username

    Outputs

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

    Get an existing MailConfig 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?: MailConfigState, opts?: CustomResourceOptions): MailConfig
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            enabled: Optional[bool] = None,
            from_address: Optional[str] = None,
            host: Optional[str] = None,
            nexus_trust_store_enabled: Optional[bool] = None,
            password: Optional[str] = None,
            port: Optional[float] = None,
            ssl_on_connect_enabled: Optional[bool] = None,
            ssl_server_identity_check_enabled: Optional[bool] = None,
            start_tls_enabled: Optional[bool] = None,
            start_tls_required: Optional[bool] = None,
            subject_prefix: Optional[str] = None,
            username: Optional[str] = None) -> MailConfig
    func GetMailConfig(ctx *Context, name string, id IDInput, state *MailConfigState, opts ...ResourceOption) (*MailConfig, error)
    public static MailConfig Get(string name, Input<string> id, MailConfigState? state, CustomResourceOptions? opts = null)
    public static MailConfig get(String name, Output<String> id, MailConfigState state, CustomResourceOptions options)
    resources:  _:    type: nexus:MailConfig    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.
    The following state arguments are supported:
    Enabled bool
    Whether the config is enabled or not
    FromAddress string
    fromAddress
    Host string
    hostname
    NexusTrustStoreEnabled bool
    SSL on connect enabled
    Password string
    Password
    Port double
    port
    SslOnConnectEnabled bool
    SSL on connect enabled
    SslServerIdentityCheckEnabled bool
    SSL on connect enabled
    StartTlsEnabled bool
    Star TLS Enabled
    StartTlsRequired bool
    Star TLS required
    SubjectPrefix string
    Subject prefix
    Username string
    Username
    Enabled bool
    Whether the config is enabled or not
    FromAddress string
    fromAddress
    Host string
    hostname
    NexusTrustStoreEnabled bool
    SSL on connect enabled
    Password string
    Password
    Port float64
    port
    SslOnConnectEnabled bool
    SSL on connect enabled
    SslServerIdentityCheckEnabled bool
    SSL on connect enabled
    StartTlsEnabled bool
    Star TLS Enabled
    StartTlsRequired bool
    Star TLS required
    SubjectPrefix string
    Subject prefix
    Username string
    Username
    enabled Boolean
    Whether the config is enabled or not
    fromAddress String
    fromAddress
    host String
    hostname
    nexusTrustStoreEnabled Boolean
    SSL on connect enabled
    password String
    Password
    port Double
    port
    sslOnConnectEnabled Boolean
    SSL on connect enabled
    sslServerIdentityCheckEnabled Boolean
    SSL on connect enabled
    startTlsEnabled Boolean
    Star TLS Enabled
    startTlsRequired Boolean
    Star TLS required
    subjectPrefix String
    Subject prefix
    username String
    Username
    enabled boolean
    Whether the config is enabled or not
    fromAddress string
    fromAddress
    host string
    hostname
    nexusTrustStoreEnabled boolean
    SSL on connect enabled
    password string
    Password
    port number
    port
    sslOnConnectEnabled boolean
    SSL on connect enabled
    sslServerIdentityCheckEnabled boolean
    SSL on connect enabled
    startTlsEnabled boolean
    Star TLS Enabled
    startTlsRequired boolean
    Star TLS required
    subjectPrefix string
    Subject prefix
    username string
    Username
    enabled bool
    Whether the config is enabled or not
    from_address str
    fromAddress
    host str
    hostname
    nexus_trust_store_enabled bool
    SSL on connect enabled
    password str
    Password
    port float
    port
    ssl_on_connect_enabled bool
    SSL on connect enabled
    ssl_server_identity_check_enabled bool
    SSL on connect enabled
    start_tls_enabled bool
    Star TLS Enabled
    start_tls_required bool
    Star TLS required
    subject_prefix str
    Subject prefix
    username str
    Username
    enabled Boolean
    Whether the config is enabled or not
    fromAddress String
    fromAddress
    host String
    hostname
    nexusTrustStoreEnabled Boolean
    SSL on connect enabled
    password String
    Password
    port Number
    port
    sslOnConnectEnabled Boolean
    SSL on connect enabled
    sslServerIdentityCheckEnabled Boolean
    SSL on connect enabled
    startTlsEnabled Boolean
    Star TLS Enabled
    startTlsRequired Boolean
    Star TLS required
    subjectPrefix String
    Subject prefix
    username String
    Username

    Import

    import using the userid of the user

    $ pulumi import nexus:index/mailConfig:MailConfig config cfg
    

    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.
    nexus logo
    nexus 2.5.0 published on Monday, Apr 14, 2025 by datadrivers