1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Identity
  5. getSmtpCredentials
Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

oci.Identity.getSmtpCredentials

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

This data source provides the list of Smtp Credentials in Oracle Cloud Infrastructure Identity service.

Lists the SMTP credentials for the specified user. The returned object contains the credential’s OCID, the SMTP user name but not the SMTP password. The SMTP password is returned only upon creation.

Example Usage

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

const testSmtpCredentials = oci.Identity.getSmtpCredentials({
    userId: testUser.id,
});
Copy
import pulumi
import pulumi_oci as oci

test_smtp_credentials = oci.Identity.get_smtp_credentials(user_id=test_user["id"])
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/identity"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := identity.GetSmtpCredentials(ctx, &identity.GetSmtpCredentialsArgs{
			UserId: testUser.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testSmtpCredentials = Oci.Identity.GetSmtpCredentials.Invoke(new()
    {
        UserId = testUser.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Identity.IdentityFunctions;
import com.pulumi.oci.Identity.inputs.GetSmtpCredentialsArgs;
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) {
        final var testSmtpCredentials = IdentityFunctions.getSmtpCredentials(GetSmtpCredentialsArgs.builder()
            .userId(testUser.id())
            .build());

    }
}
Copy
variables:
  testSmtpCredentials:
    fn::invoke:
      function: oci:Identity:getSmtpCredentials
      arguments:
        userId: ${testUser.id}
Copy

Using getSmtpCredentials

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 getSmtpCredentials(args: GetSmtpCredentialsArgs, opts?: InvokeOptions): Promise<GetSmtpCredentialsResult>
function getSmtpCredentialsOutput(args: GetSmtpCredentialsOutputArgs, opts?: InvokeOptions): Output<GetSmtpCredentialsResult>
Copy
def get_smtp_credentials(filters: Optional[Sequence[_identity.GetSmtpCredentialsFilter]] = None,
                         user_id: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetSmtpCredentialsResult
def get_smtp_credentials_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[_identity.GetSmtpCredentialsFilterArgs]]]] = None,
                         user_id: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetSmtpCredentialsResult]
Copy
func GetSmtpCredentials(ctx *Context, args *GetSmtpCredentialsArgs, opts ...InvokeOption) (*GetSmtpCredentialsResult, error)
func GetSmtpCredentialsOutput(ctx *Context, args *GetSmtpCredentialsOutputArgs, opts ...InvokeOption) GetSmtpCredentialsResultOutput
Copy

> Note: This function is named GetSmtpCredentials in the Go SDK.

public static class GetSmtpCredentials 
{
    public static Task<GetSmtpCredentialsResult> InvokeAsync(GetSmtpCredentialsArgs args, InvokeOptions? opts = null)
    public static Output<GetSmtpCredentialsResult> Invoke(GetSmtpCredentialsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSmtpCredentialsResult> getSmtpCredentials(GetSmtpCredentialsArgs args, InvokeOptions options)
public static Output<GetSmtpCredentialsResult> getSmtpCredentials(GetSmtpCredentialsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:Identity/getSmtpCredentials:getSmtpCredentials
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

UserId This property is required. string
The OCID of the user.
Filters Changes to this property will trigger replacement. List<GetSmtpCredentialsFilter>
UserId This property is required. string
The OCID of the user.
Filters Changes to this property will trigger replacement. []GetSmtpCredentialsFilter
userId This property is required. String
The OCID of the user.
filters Changes to this property will trigger replacement. List<GetSmtpCredentialsFilter>
userId This property is required. string
The OCID of the user.
filters Changes to this property will trigger replacement. GetSmtpCredentialsFilter[]
user_id This property is required. str
The OCID of the user.
filters Changes to this property will trigger replacement. Sequence[identity.GetSmtpCredentialsFilter]
userId This property is required. String
The OCID of the user.
filters Changes to this property will trigger replacement. List<Property Map>

getSmtpCredentials Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
SmtpCredentials List<GetSmtpCredentialsSmtpCredential>
The list of smtp_credentials.
UserId string
The OCID of the user the SMTP credential belongs to.
Filters List<GetSmtpCredentialsFilter>
Id string
The provider-assigned unique ID for this managed resource.
SmtpCredentials []GetSmtpCredentialsSmtpCredential
The list of smtp_credentials.
UserId string
The OCID of the user the SMTP credential belongs to.
Filters []GetSmtpCredentialsFilter
id String
The provider-assigned unique ID for this managed resource.
smtpCredentials List<GetSmtpCredentialsSmtpCredential>
The list of smtp_credentials.
userId String
The OCID of the user the SMTP credential belongs to.
filters List<GetSmtpCredentialsFilter>
id string
The provider-assigned unique ID for this managed resource.
smtpCredentials GetSmtpCredentialsSmtpCredential[]
The list of smtp_credentials.
userId string
The OCID of the user the SMTP credential belongs to.
filters GetSmtpCredentialsFilter[]
id str
The provider-assigned unique ID for this managed resource.
smtp_credentials Sequence[identity.GetSmtpCredentialsSmtpCredential]
The list of smtp_credentials.
user_id str
The OCID of the user the SMTP credential belongs to.
filters Sequence[identity.GetSmtpCredentialsFilter]
id String
The provider-assigned unique ID for this managed resource.
smtpCredentials List<Property Map>
The list of smtp_credentials.
userId String
The OCID of the user the SMTP credential belongs to.
filters List<Property Map>

Supporting Types

GetSmtpCredentialsFilter

Name This property is required. string
Values This property is required. List<string>
Regex bool
Name This property is required. string
Values This property is required. []string
Regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean
name This property is required. string
values This property is required. string[]
regex boolean
name This property is required. str
values This property is required. Sequence[str]
regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean

GetSmtpCredentialsSmtpCredential

Description This property is required. string
The description you assign to the SMTP credential. Does not have to be unique, and it's changeable.
Id This property is required. string
The OCID of the SMTP credential.
InactiveState This property is required. string
The detailed status of INACTIVE lifecycleState.
Password This property is required. string
State This property is required. string
The credential's current state.
TimeCreated This property is required. string
Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
TimeExpires This property is required. string
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
UserId This property is required. string
The OCID of the user.
Username This property is required. string
The SMTP user name.
Description This property is required. string
The description you assign to the SMTP credential. Does not have to be unique, and it's changeable.
Id This property is required. string
The OCID of the SMTP credential.
InactiveState This property is required. string
The detailed status of INACTIVE lifecycleState.
Password This property is required. string
State This property is required. string
The credential's current state.
TimeCreated This property is required. string
Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
TimeExpires This property is required. string
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
UserId This property is required. string
The OCID of the user.
Username This property is required. string
The SMTP user name.
description This property is required. String
The description you assign to the SMTP credential. Does not have to be unique, and it's changeable.
id This property is required. String
The OCID of the SMTP credential.
inactiveState This property is required. String
The detailed status of INACTIVE lifecycleState.
password This property is required. String
state This property is required. String
The credential's current state.
timeCreated This property is required. String
Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
timeExpires This property is required. String
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
userId This property is required. String
The OCID of the user.
username This property is required. String
The SMTP user name.
description This property is required. string
The description you assign to the SMTP credential. Does not have to be unique, and it's changeable.
id This property is required. string
The OCID of the SMTP credential.
inactiveState This property is required. string
The detailed status of INACTIVE lifecycleState.
password This property is required. string
state This property is required. string
The credential's current state.
timeCreated This property is required. string
Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
timeExpires This property is required. string
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
userId This property is required. string
The OCID of the user.
username This property is required. string
The SMTP user name.
description This property is required. str
The description you assign to the SMTP credential. Does not have to be unique, and it's changeable.
id This property is required. str
The OCID of the SMTP credential.
inactive_state This property is required. str
The detailed status of INACTIVE lifecycleState.
password This property is required. str
state This property is required. str
The credential's current state.
time_created This property is required. str
Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
time_expires This property is required. str
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
user_id This property is required. str
The OCID of the user.
username This property is required. str
The SMTP user name.
description This property is required. String
The description you assign to the SMTP credential. Does not have to be unique, and it's changeable.
id This property is required. String
The OCID of the SMTP credential.
inactiveState This property is required. String
The detailed status of INACTIVE lifecycleState.
password This property is required. String
state This property is required. String
The credential's current state.
timeCreated This property is required. String
Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
timeExpires This property is required. String
Date and time when this credential will expire, in the format defined by RFC3339. Null if it never expires. Example: 2016-08-25T21:10:29.600Z
userId This property is required. String
The OCID of the user.
username This property is required. String
The SMTP user name.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi