1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Identity
  5. SmtpCredential
Oracle Cloud Infrastructure v1.29.0 published on Thursday, Mar 28, 2024 by Pulumi

oci.Identity.SmtpCredential

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.29.0 published on Thursday, Mar 28, 2024 by Pulumi

    This resource provides the Smtp Credential resource in Oracle Cloud Infrastructure Identity service.

    Creates a new SMTP credential for the specified user. An SMTP credential has an SMTP user name and an SMTP password. You must specify a description for the SMTP credential (although it can be an empty string). It does not have to be unique, and you can change it anytime with UpdateSmtpCredential.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testSmtpCredential = new oci.identity.SmtpCredential("testSmtpCredential", {
        description: _var.smtp_credential_description,
        userId: oci_identity_user.test_user.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_smtp_credential = oci.identity.SmtpCredential("testSmtpCredential",
        description=var["smtp_credential_description"],
        user_id=oci_identity_user["test_user"]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/Identity"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Identity.NewSmtpCredential(ctx, "testSmtpCredential", &Identity.SmtpCredentialArgs{
    			Description: pulumi.Any(_var.Smtp_credential_description),
    			UserId:      pulumi.Any(oci_identity_user.Test_user.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testSmtpCredential = new Oci.Identity.SmtpCredential("testSmtpCredential", new()
        {
            Description = @var.Smtp_credential_description,
            UserId = oci_identity_user.Test_user.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Identity.SmtpCredential;
    import com.pulumi.oci.Identity.SmtpCredentialArgs;
    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 testSmtpCredential = new SmtpCredential("testSmtpCredential", SmtpCredentialArgs.builder()        
                .description(var_.smtp_credential_description())
                .userId(oci_identity_user.test_user().id())
                .build());
    
        }
    }
    
    resources:
      testSmtpCredential:
        type: oci:Identity:SmtpCredential
        properties:
          #Required
          description: ${var.smtp_credential_description}
          userId: ${oci_identity_user.test_user.id}
    

    Create SmtpCredential Resource

    new SmtpCredential(name: string, args: SmtpCredentialArgs, opts?: CustomResourceOptions);
    @overload
    def SmtpCredential(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       description: Optional[str] = None,
                       user_id: Optional[str] = None)
    @overload
    def SmtpCredential(resource_name: str,
                       args: SmtpCredentialArgs,
                       opts: Optional[ResourceOptions] = None)
    func NewSmtpCredential(ctx *Context, name string, args SmtpCredentialArgs, opts ...ResourceOption) (*SmtpCredential, error)
    public SmtpCredential(string name, SmtpCredentialArgs args, CustomResourceOptions? opts = null)
    public SmtpCredential(String name, SmtpCredentialArgs args)
    public SmtpCredential(String name, SmtpCredentialArgs args, CustomResourceOptions options)
    
    type: oci:Identity:SmtpCredential
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args SmtpCredentialArgs
    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 SmtpCredentialArgs
    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 SmtpCredentialArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SmtpCredentialArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SmtpCredentialArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    SmtpCredential Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The SmtpCredential resource accepts the following input properties:

    Description string
    (Updatable) The description you assign to the SMTP credentials during creation. Does not have to be unique, and it's changeable.
    UserId string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Description string
    (Updatable) The description you assign to the SMTP credentials during creation. Does not have to be unique, and it's changeable.
    UserId string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    description String
    (Updatable) The description you assign to the SMTP credentials during creation. Does not have to be unique, and it's changeable.
    userId String

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    description string
    (Updatable) The description you assign to the SMTP credentials during creation. Does not have to be unique, and it's changeable.
    userId string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    description str
    (Updatable) The description you assign to the SMTP credentials during creation. Does not have to be unique, and it's changeable.
    user_id str

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    description String
    (Updatable) The description you assign to the SMTP credentials during creation. Does not have to be unique, and it's changeable.
    userId String

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SmtpCredential resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    InactiveState string
    The detailed status of INACTIVE lifecycleState.
    Password string
    The SMTP password.
    State string
    The credential's current state.
    TimeCreated string
    Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    TimeExpires 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
    Username string
    The SMTP user name.
    Id string
    The provider-assigned unique ID for this managed resource.
    InactiveState string
    The detailed status of INACTIVE lifecycleState.
    Password string
    The SMTP password.
    State string
    The credential's current state.
    TimeCreated string
    Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    TimeExpires 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
    Username string
    The SMTP user name.
    id String
    The provider-assigned unique ID for this managed resource.
    inactiveState String
    The detailed status of INACTIVE lifecycleState.
    password String
    The SMTP password.
    state String
    The credential's current state.
    timeCreated String
    Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeExpires 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
    username String
    The SMTP user name.
    id string
    The provider-assigned unique ID for this managed resource.
    inactiveState string
    The detailed status of INACTIVE lifecycleState.
    password string
    The SMTP password.
    state string
    The credential's current state.
    timeCreated string
    Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeExpires 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
    username string
    The SMTP user name.
    id str
    The provider-assigned unique ID for this managed resource.
    inactive_state str
    The detailed status of INACTIVE lifecycleState.
    password str
    The SMTP password.
    state str
    The credential's current state.
    time_created str
    Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    time_expires 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
    username str
    The SMTP user name.
    id String
    The provider-assigned unique ID for this managed resource.
    inactiveState String
    The detailed status of INACTIVE lifecycleState.
    password String
    The SMTP password.
    state String
    The credential's current state.
    timeCreated String
    Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeExpires 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
    username String
    The SMTP user name.

    Look up Existing SmtpCredential Resource

    Get an existing SmtpCredential 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?: SmtpCredentialState, opts?: CustomResourceOptions): SmtpCredential
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            inactive_state: Optional[str] = None,
            password: Optional[str] = None,
            state: Optional[str] = None,
            time_created: Optional[str] = None,
            time_expires: Optional[str] = None,
            user_id: Optional[str] = None,
            username: Optional[str] = None) -> SmtpCredential
    func GetSmtpCredential(ctx *Context, name string, id IDInput, state *SmtpCredentialState, opts ...ResourceOption) (*SmtpCredential, error)
    public static SmtpCredential Get(string name, Input<string> id, SmtpCredentialState? state, CustomResourceOptions? opts = null)
    public static SmtpCredential get(String name, Output<String> id, SmtpCredentialState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    Description string
    (Updatable) The description you assign to the SMTP credentials during creation. Does not have to be unique, and it's changeable.
    InactiveState string
    The detailed status of INACTIVE lifecycleState.
    Password string
    The SMTP password.
    State string
    The credential's current state.
    TimeCreated string
    Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    TimeExpires 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 string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Username string
    The SMTP user name.
    Description string
    (Updatable) The description you assign to the SMTP credentials during creation. Does not have to be unique, and it's changeable.
    InactiveState string
    The detailed status of INACTIVE lifecycleState.
    Password string
    The SMTP password.
    State string
    The credential's current state.
    TimeCreated string
    Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    TimeExpires 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 string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    Username string
    The SMTP user name.
    description String
    (Updatable) The description you assign to the SMTP credentials during creation. Does not have to be unique, and it's changeable.
    inactiveState String
    The detailed status of INACTIVE lifecycleState.
    password String
    The SMTP password.
    state String
    The credential's current state.
    timeCreated String
    Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeExpires 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 String

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    username String
    The SMTP user name.
    description string
    (Updatable) The description you assign to the SMTP credentials during creation. Does not have to be unique, and it's changeable.
    inactiveState string
    The detailed status of INACTIVE lifecycleState.
    password string
    The SMTP password.
    state string
    The credential's current state.
    timeCreated string
    Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeExpires 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 string

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    username string
    The SMTP user name.
    description str
    (Updatable) The description you assign to the SMTP credentials during creation. Does not have to be unique, and it's changeable.
    inactive_state str
    The detailed status of INACTIVE lifecycleState.
    password str
    The SMTP password.
    state str
    The credential's current state.
    time_created str
    Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    time_expires 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 str

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    username str
    The SMTP user name.
    description String
    (Updatable) The description you assign to the SMTP credentials during creation. Does not have to be unique, and it's changeable.
    inactiveState String
    The detailed status of INACTIVE lifecycleState.
    password String
    The SMTP password.
    state String
    The credential's current state.
    timeCreated String
    Date and time the SmtpCredential object was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeExpires 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 String

    The OCID of the user.

    ** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

    username String
    The SMTP user name.

    Import

    SmtpCredentials can be imported using the id, e.g.

    $ pulumi import oci:Identity/smtpCredential:SmtpCredential test_smtp_credential "users/{userId}/smtpCredentials/{smtpCredentialId}"
    

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.29.0 published on Thursday, Mar 28, 2024 by Pulumi