Okta v5.2.0 published on Thursday, Sep 4, 2025 by Pulumi
okta.getEmailSmtpServer
Explore with Pulumi AI
Get existing SMTP email server configuration.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as okta from "@pulumi/okta";
const smtpServer = new okta.EmailSmtpServer("smtp_server", {
alias: "CustomServer",
host: "192.168.160.1",
port: 8086,
username: "aUser",
password: "abcd",
});
const serverConfig = okta.getEmailSmtpServer({
id: "id-of-your-smtp-server",
});
import pulumi
import pulumi_okta as okta
smtp_server = okta.EmailSmtpServer("smtp_server",
alias="CustomServer",
host="192.168.160.1",
port=8086,
username="aUser",
password="abcd")
server_config = okta.get_email_smtp_server(id="id-of-your-smtp-server")
package main
import (
"github.com/pulumi/pulumi-okta/sdk/v5/go/okta"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := okta.NewEmailSmtpServer(ctx, "smtp_server", &okta.EmailSmtpServerArgs{
Alias: pulumi.String("CustomServer"),
Host: pulumi.String("192.168.160.1"),
Port: pulumi.Int(8086),
Username: pulumi.String("aUser"),
Password: pulumi.String("abcd"),
})
if err != nil {
return err
}
_, err = okta.LookupEmailSmtpServer(ctx, &okta.LookupEmailSmtpServerArgs{
Id: "id-of-your-smtp-server",
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Okta = Pulumi.Okta;
return await Deployment.RunAsync(() =>
{
var smtpServer = new Okta.EmailSmtpServer("smtp_server", new()
{
Alias = "CustomServer",
Host = "192.168.160.1",
Port = 8086,
Username = "aUser",
Password = "abcd",
});
var serverConfig = Okta.GetEmailSmtpServer.Invoke(new()
{
Id = "id-of-your-smtp-server",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.okta.EmailSmtpServer;
import com.pulumi.okta.EmailSmtpServerArgs;
import com.pulumi.okta.OktaFunctions;
import com.pulumi.okta.inputs.GetEmailSmtpServerArgs;
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 smtpServer = new EmailSmtpServer("smtpServer", EmailSmtpServerArgs.builder()
.alias("CustomServer")
.host("192.168.160.1")
.port(8086)
.username("aUser")
.password("abcd")
.build());
final var serverConfig = OktaFunctions.getEmailSmtpServer(GetEmailSmtpServerArgs.builder()
.id("id-of-your-smtp-server")
.build());
}
}
resources:
smtpServer:
type: okta:EmailSmtpServer
name: smtp_server
properties:
alias: CustomServer
host: 192.168.160.1
port: 8086
username: aUser
password: abcd
variables:
serverConfig:
fn::invoke:
function: okta:getEmailSmtpServer
arguments:
id: id-of-your-smtp-server
Using getEmailSmtpServer
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getEmailSmtpServer(args: GetEmailSmtpServerArgs, opts?: InvokeOptions): Promise<GetEmailSmtpServerResult>
function getEmailSmtpServerOutput(args: GetEmailSmtpServerOutputArgs, opts?: InvokeOptions): Output<GetEmailSmtpServerResult>
def get_email_smtp_server(id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetEmailSmtpServerResult
def get_email_smtp_server_output(id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetEmailSmtpServerResult]
func LookupEmailSmtpServer(ctx *Context, args *LookupEmailSmtpServerArgs, opts ...InvokeOption) (*LookupEmailSmtpServerResult, error)
func LookupEmailSmtpServerOutput(ctx *Context, args *LookupEmailSmtpServerOutputArgs, opts ...InvokeOption) LookupEmailSmtpServerResultOutput
> Note: This function is named LookupEmailSmtpServer
in the Go SDK.
public static class GetEmailSmtpServer
{
public static Task<GetEmailSmtpServerResult> InvokeAsync(GetEmailSmtpServerArgs args, InvokeOptions? opts = null)
public static Output<GetEmailSmtpServerResult> Invoke(GetEmailSmtpServerInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetEmailSmtpServerResult> getEmailSmtpServer(GetEmailSmtpServerArgs args, InvokeOptions options)
public static Output<GetEmailSmtpServerResult> getEmailSmtpServer(GetEmailSmtpServerArgs args, InvokeOptions options)
fn::invoke:
function: okta:index/getEmailSmtpServer:getEmailSmtpServer
arguments:
# arguments dictionary
The following arguments are supported:
- Id string
- ID of your SMTP server
- Id string
- ID of your SMTP server
- id String
- ID of your SMTP server
- id string
- ID of your SMTP server
- id str
- ID of your SMTP server
- id String
- ID of your SMTP server
getEmailSmtpServer Result
The following output properties are available:
- alias String
- Human-readable name for SMTP server
- enabled Boolean
- If true, routes all email traffic through the SMTP server.
- host String
- Hostname or IP address of the SMTP server
- id String
- ID of your SMTP server
- port Integer
- The port number of the SMTP server
- username String
- Username used to access the SMTP server
- alias string
- Human-readable name for SMTP server
- enabled boolean
- If true, routes all email traffic through the SMTP server.
- host string
- Hostname or IP address of the SMTP server
- id string
- ID of your SMTP server
- port number
- The port number of the SMTP server
- username string
- Username used to access the SMTP server
- alias String
- Human-readable name for SMTP server
- enabled Boolean
- If true, routes all email traffic through the SMTP server.
- host String
- Hostname or IP address of the SMTP server
- id String
- ID of your SMTP server
- port Number
- The port number of the SMTP server
- username String
- Username used to access the SMTP server
Package Details
- Repository
- Okta pulumi/pulumi-okta
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
okta
Terraform Provider.