1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Bastion
  5. Session
Oracle Cloud Infrastructure v2.32.0 published on Thursday, Apr 24, 2025 by Pulumi

oci.Bastion.Session

Explore with Pulumi AI

This resource provides the Session resource in Oracle Cloud Infrastructure Bastion service.

Creates a new session in a bastion. A bastion session lets authorized users connect to a target resource for a predetermined amount of time. The Bastion service recognizes two types of sessions, managed SSH sessions and SSH port forwarding sessions. Managed SSH sessions require that the target resource has an OpenSSH server and the Oracle Cloud Agent both running.

Example Usage

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

const testSession = new oci.bastion.Session("test_session", {
    bastionId: testBastion.id,
    keyDetails: {
        publicKeyContent: sessionKeyDetailsPublicKeyContent,
    },
    targetResourceDetails: {
        sessionType: sessionTargetResourceDetailsSessionType,
        targetResourceFqdn: sessionTargetResourceDetailsTargetResourceFqdn,
        targetResourceId: testTargetResource.id,
        targetResourceOperatingSystemUserName: testUser.name,
        targetResourcePort: sessionTargetResourceDetailsTargetResourcePort,
        targetResourcePrivateIpAddress: sessionTargetResourceDetailsTargetResourcePrivateIpAddress,
    },
    displayName: sessionDisplayName,
    keyType: sessionKeyType,
    sessionTtlInSeconds: sessionSessionTtlInSeconds,
});
Copy
import pulumi
import pulumi_oci as oci

test_session = oci.bastion.Session("test_session",
    bastion_id=test_bastion["id"],
    key_details={
        "public_key_content": session_key_details_public_key_content,
    },
    target_resource_details={
        "session_type": session_target_resource_details_session_type,
        "target_resource_fqdn": session_target_resource_details_target_resource_fqdn,
        "target_resource_id": test_target_resource["id"],
        "target_resource_operating_system_user_name": test_user["name"],
        "target_resource_port": session_target_resource_details_target_resource_port,
        "target_resource_private_ip_address": session_target_resource_details_target_resource_private_ip_address,
    },
    display_name=session_display_name,
    key_type=session_key_type,
    session_ttl_in_seconds=session_session_ttl_in_seconds)
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := bastion.NewSession(ctx, "test_session", &bastion.SessionArgs{
			BastionId: pulumi.Any(testBastion.Id),
			KeyDetails: &bastion.SessionKeyDetailsArgs{
				PublicKeyContent: pulumi.Any(sessionKeyDetailsPublicKeyContent),
			},
			TargetResourceDetails: &bastion.SessionTargetResourceDetailsArgs{
				SessionType:                           pulumi.Any(sessionTargetResourceDetailsSessionType),
				TargetResourceFqdn:                    pulumi.Any(sessionTargetResourceDetailsTargetResourceFqdn),
				TargetResourceId:                      pulumi.Any(testTargetResource.Id),
				TargetResourceOperatingSystemUserName: pulumi.Any(testUser.Name),
				TargetResourcePort:                    pulumi.Any(sessionTargetResourceDetailsTargetResourcePort),
				TargetResourcePrivateIpAddress:        pulumi.Any(sessionTargetResourceDetailsTargetResourcePrivateIpAddress),
			},
			DisplayName:         pulumi.Any(sessionDisplayName),
			KeyType:             pulumi.Any(sessionKeyType),
			SessionTtlInSeconds: pulumi.Any(sessionSessionTtlInSeconds),
		})
		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 testSession = new Oci.Bastion.Session("test_session", new()
    {
        BastionId = testBastion.Id,
        KeyDetails = new Oci.Bastion.Inputs.SessionKeyDetailsArgs
        {
            PublicKeyContent = sessionKeyDetailsPublicKeyContent,
        },
        TargetResourceDetails = new Oci.Bastion.Inputs.SessionTargetResourceDetailsArgs
        {
            SessionType = sessionTargetResourceDetailsSessionType,
            TargetResourceFqdn = sessionTargetResourceDetailsTargetResourceFqdn,
            TargetResourceId = testTargetResource.Id,
            TargetResourceOperatingSystemUserName = testUser.Name,
            TargetResourcePort = sessionTargetResourceDetailsTargetResourcePort,
            TargetResourcePrivateIpAddress = sessionTargetResourceDetailsTargetResourcePrivateIpAddress,
        },
        DisplayName = sessionDisplayName,
        KeyType = sessionKeyType,
        SessionTtlInSeconds = sessionSessionTtlInSeconds,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Bastion.Session;
import com.pulumi.oci.Bastion.SessionArgs;
import com.pulumi.oci.Bastion.inputs.SessionKeyDetailsArgs;
import com.pulumi.oci.Bastion.inputs.SessionTargetResourceDetailsArgs;
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 testSession = new Session("testSession", SessionArgs.builder()
            .bastionId(testBastion.id())
            .keyDetails(SessionKeyDetailsArgs.builder()
                .publicKeyContent(sessionKeyDetailsPublicKeyContent)
                .build())
            .targetResourceDetails(SessionTargetResourceDetailsArgs.builder()
                .sessionType(sessionTargetResourceDetailsSessionType)
                .targetResourceFqdn(sessionTargetResourceDetailsTargetResourceFqdn)
                .targetResourceId(testTargetResource.id())
                .targetResourceOperatingSystemUserName(testUser.name())
                .targetResourcePort(sessionTargetResourceDetailsTargetResourcePort)
                .targetResourcePrivateIpAddress(sessionTargetResourceDetailsTargetResourcePrivateIpAddress)
                .build())
            .displayName(sessionDisplayName)
            .keyType(sessionKeyType)
            .sessionTtlInSeconds(sessionSessionTtlInSeconds)
            .build());

    }
}
Copy
resources:
  testSession:
    type: oci:Bastion:Session
    name: test_session
    properties:
      bastionId: ${testBastion.id}
      keyDetails:
        publicKeyContent: ${sessionKeyDetailsPublicKeyContent}
      targetResourceDetails:
        sessionType: ${sessionTargetResourceDetailsSessionType}
        targetResourceFqdn: ${sessionTargetResourceDetailsTargetResourceFqdn}
        targetResourceId: ${testTargetResource.id}
        targetResourceOperatingSystemUserName: ${testUser.name}
        targetResourcePort: ${sessionTargetResourceDetailsTargetResourcePort}
        targetResourcePrivateIpAddress: ${sessionTargetResourceDetailsTargetResourcePrivateIpAddress}
      displayName: ${sessionDisplayName}
      keyType: ${sessionKeyType}
      sessionTtlInSeconds: ${sessionSessionTtlInSeconds}
Copy

Create Session Resource

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

Constructor syntax

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

@overload
def Session(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            bastion_id: Optional[str] = None,
            key_details: Optional[_bastion.SessionKeyDetailsArgs] = None,
            target_resource_details: Optional[_bastion.SessionTargetResourceDetailsArgs] = None,
            display_name: Optional[str] = None,
            key_type: Optional[str] = None,
            session_ttl_in_seconds: Optional[int] = None)
func NewSession(ctx *Context, name string, args SessionArgs, opts ...ResourceOption) (*Session, error)
public Session(string name, SessionArgs args, CustomResourceOptions? opts = null)
public Session(String name, SessionArgs args)
public Session(String name, SessionArgs args, CustomResourceOptions options)
type: oci:Bastion:Session
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. SessionArgs
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. SessionArgs
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. SessionArgs
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. SessionArgs
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. SessionArgs
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 sessionResource = new Oci.Bastion.Session("sessionResource", new()
{
    BastionId = "string",
    KeyDetails = new Oci.Bastion.Inputs.SessionKeyDetailsArgs
    {
        PublicKeyContent = "string",
    },
    TargetResourceDetails = new Oci.Bastion.Inputs.SessionTargetResourceDetailsArgs
    {
        SessionType = "string",
        TargetResourceDisplayName = "string",
        TargetResourceFqdn = "string",
        TargetResourceId = "string",
        TargetResourceOperatingSystemUserName = "string",
        TargetResourcePort = 0,
        TargetResourcePrivateIpAddress = "string",
    },
    DisplayName = "string",
    KeyType = "string",
    SessionTtlInSeconds = 0,
});
Copy
example, err := bastion.NewSession(ctx, "sessionResource", &bastion.SessionArgs{
	BastionId: pulumi.String("string"),
	KeyDetails: &bastion.SessionKeyDetailsArgs{
		PublicKeyContent: pulumi.String("string"),
	},
	TargetResourceDetails: &bastion.SessionTargetResourceDetailsArgs{
		SessionType:                           pulumi.String("string"),
		TargetResourceDisplayName:             pulumi.String("string"),
		TargetResourceFqdn:                    pulumi.String("string"),
		TargetResourceId:                      pulumi.String("string"),
		TargetResourceOperatingSystemUserName: pulumi.String("string"),
		TargetResourcePort:                    pulumi.Int(0),
		TargetResourcePrivateIpAddress:        pulumi.String("string"),
	},
	DisplayName:         pulumi.String("string"),
	KeyType:             pulumi.String("string"),
	SessionTtlInSeconds: pulumi.Int(0),
})
Copy
var sessionResource = new Session("sessionResource", SessionArgs.builder()
    .bastionId("string")
    .keyDetails(SessionKeyDetailsArgs.builder()
        .publicKeyContent("string")
        .build())
    .targetResourceDetails(SessionTargetResourceDetailsArgs.builder()
        .sessionType("string")
        .targetResourceDisplayName("string")
        .targetResourceFqdn("string")
        .targetResourceId("string")
        .targetResourceOperatingSystemUserName("string")
        .targetResourcePort(0)
        .targetResourcePrivateIpAddress("string")
        .build())
    .displayName("string")
    .keyType("string")
    .sessionTtlInSeconds(0)
    .build());
Copy
session_resource = oci.bastion.Session("sessionResource",
    bastion_id="string",
    key_details={
        "public_key_content": "string",
    },
    target_resource_details={
        "session_type": "string",
        "target_resource_display_name": "string",
        "target_resource_fqdn": "string",
        "target_resource_id": "string",
        "target_resource_operating_system_user_name": "string",
        "target_resource_port": 0,
        "target_resource_private_ip_address": "string",
    },
    display_name="string",
    key_type="string",
    session_ttl_in_seconds=0)
Copy
const sessionResource = new oci.bastion.Session("sessionResource", {
    bastionId: "string",
    keyDetails: {
        publicKeyContent: "string",
    },
    targetResourceDetails: {
        sessionType: "string",
        targetResourceDisplayName: "string",
        targetResourceFqdn: "string",
        targetResourceId: "string",
        targetResourceOperatingSystemUserName: "string",
        targetResourcePort: 0,
        targetResourcePrivateIpAddress: "string",
    },
    displayName: "string",
    keyType: "string",
    sessionTtlInSeconds: 0,
});
Copy
type: oci:Bastion:Session
properties:
    bastionId: string
    displayName: string
    keyDetails:
        publicKeyContent: string
    keyType: string
    sessionTtlInSeconds: 0
    targetResourceDetails:
        sessionType: string
        targetResourceDisplayName: string
        targetResourceFqdn: string
        targetResourceId: string
        targetResourceOperatingSystemUserName: string
        targetResourcePort: 0
        targetResourcePrivateIpAddress: string
Copy

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

BastionId
This property is required.
Changes to this property will trigger replacement.
string
The unique identifier (OCID) of the bastion on which to create this session.
KeyDetails
This property is required.
Changes to this property will trigger replacement.
SessionKeyDetails
Public key details for a bastion session.
TargetResourceDetails
This property is required.
Changes to this property will trigger replacement.
SessionTargetResourceDetails
Details about a bastion session's target resource.
DisplayName string
(Updatable) The name of the session.
KeyType Changes to this property will trigger replacement. string
The type of the key used to connect to the session. PUB is a standard public key in OpenSSH format.
SessionTtlInSeconds Changes to this property will trigger replacement. int
The amount of time the session can remain active.
BastionId
This property is required.
Changes to this property will trigger replacement.
string
The unique identifier (OCID) of the bastion on which to create this session.
KeyDetails
This property is required.
Changes to this property will trigger replacement.
SessionKeyDetailsArgs
Public key details for a bastion session.
TargetResourceDetails
This property is required.
Changes to this property will trigger replacement.
SessionTargetResourceDetailsArgs
Details about a bastion session's target resource.
DisplayName string
(Updatable) The name of the session.
KeyType Changes to this property will trigger replacement. string
The type of the key used to connect to the session. PUB is a standard public key in OpenSSH format.
SessionTtlInSeconds Changes to this property will trigger replacement. int
The amount of time the session can remain active.
bastionId
This property is required.
Changes to this property will trigger replacement.
String
The unique identifier (OCID) of the bastion on which to create this session.
keyDetails
This property is required.
Changes to this property will trigger replacement.
SessionKeyDetails
Public key details for a bastion session.
targetResourceDetails
This property is required.
Changes to this property will trigger replacement.
SessionTargetResourceDetails
Details about a bastion session's target resource.
displayName String
(Updatable) The name of the session.
keyType Changes to this property will trigger replacement. String
The type of the key used to connect to the session. PUB is a standard public key in OpenSSH format.
sessionTtlInSeconds Changes to this property will trigger replacement. Integer
The amount of time the session can remain active.
bastionId
This property is required.
Changes to this property will trigger replacement.
string
The unique identifier (OCID) of the bastion on which to create this session.
keyDetails
This property is required.
Changes to this property will trigger replacement.
SessionKeyDetails
Public key details for a bastion session.
targetResourceDetails
This property is required.
Changes to this property will trigger replacement.
SessionTargetResourceDetails
Details about a bastion session's target resource.
displayName string
(Updatable) The name of the session.
keyType Changes to this property will trigger replacement. string
The type of the key used to connect to the session. PUB is a standard public key in OpenSSH format.
sessionTtlInSeconds Changes to this property will trigger replacement. number
The amount of time the session can remain active.
bastion_id
This property is required.
Changes to this property will trigger replacement.
str
The unique identifier (OCID) of the bastion on which to create this session.
key_details
This property is required.
Changes to this property will trigger replacement.
bastion.SessionKeyDetailsArgs
Public key details for a bastion session.
target_resource_details
This property is required.
Changes to this property will trigger replacement.
bastion.SessionTargetResourceDetailsArgs
Details about a bastion session's target resource.
display_name str
(Updatable) The name of the session.
key_type Changes to this property will trigger replacement. str
The type of the key used to connect to the session. PUB is a standard public key in OpenSSH format.
session_ttl_in_seconds Changes to this property will trigger replacement. int
The amount of time the session can remain active.
bastionId
This property is required.
Changes to this property will trigger replacement.
String
The unique identifier (OCID) of the bastion on which to create this session.
keyDetails
This property is required.
Changes to this property will trigger replacement.
Property Map
Public key details for a bastion session.
targetResourceDetails
This property is required.
Changes to this property will trigger replacement.
Property Map
Details about a bastion session's target resource.
displayName String
(Updatable) The name of the session.
keyType Changes to this property will trigger replacement. String
The type of the key used to connect to the session. PUB is a standard public key in OpenSSH format.
sessionTtlInSeconds Changes to this property will trigger replacement. Number
The amount of time the session can remain active.

Outputs

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

BastionName string
The name of the bastion that is hosting this session.
BastionPublicHostKeyInfo string
The public key of the bastion host. You can use this to verify that you're connecting to the correct bastion.
BastionUserName string
The username that the session uses to connect to the target resource.
Id string
The provider-assigned unique ID for this managed resource.
LifecycleDetails string
A message describing the current session state in more detail.
SshMetadata Dictionary<string, string>
The connection message for the session.
State string
The current state of the session.
TimeCreated string
The time the session was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
TimeUpdated string
The time the session was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
BastionName string
The name of the bastion that is hosting this session.
BastionPublicHostKeyInfo string
The public key of the bastion host. You can use this to verify that you're connecting to the correct bastion.
BastionUserName string
The username that the session uses to connect to the target resource.
Id string
The provider-assigned unique ID for this managed resource.
LifecycleDetails string
A message describing the current session state in more detail.
SshMetadata map[string]string
The connection message for the session.
State string
The current state of the session.
TimeCreated string
The time the session was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
TimeUpdated string
The time the session was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
bastionName String
The name of the bastion that is hosting this session.
bastionPublicHostKeyInfo String
The public key of the bastion host. You can use this to verify that you're connecting to the correct bastion.
bastionUserName String
The username that the session uses to connect to the target resource.
id String
The provider-assigned unique ID for this managed resource.
lifecycleDetails String
A message describing the current session state in more detail.
sshMetadata Map<String,String>
The connection message for the session.
state String
The current state of the session.
timeCreated String
The time the session was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
timeUpdated String
The time the session was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
bastionName string
The name of the bastion that is hosting this session.
bastionPublicHostKeyInfo string
The public key of the bastion host. You can use this to verify that you're connecting to the correct bastion.
bastionUserName string
The username that the session uses to connect to the target resource.
id string
The provider-assigned unique ID for this managed resource.
lifecycleDetails string
A message describing the current session state in more detail.
sshMetadata {[key: string]: string}
The connection message for the session.
state string
The current state of the session.
timeCreated string
The time the session was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
timeUpdated string
The time the session was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
bastion_name str
The name of the bastion that is hosting this session.
bastion_public_host_key_info str
The public key of the bastion host. You can use this to verify that you're connecting to the correct bastion.
bastion_user_name str
The username that the session uses to connect to the target resource.
id str
The provider-assigned unique ID for this managed resource.
lifecycle_details str
A message describing the current session state in more detail.
ssh_metadata Mapping[str, str]
The connection message for the session.
state str
The current state of the session.
time_created str
The time the session was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
time_updated str
The time the session was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
bastionName String
The name of the bastion that is hosting this session.
bastionPublicHostKeyInfo String
The public key of the bastion host. You can use this to verify that you're connecting to the correct bastion.
bastionUserName String
The username that the session uses to connect to the target resource.
id String
The provider-assigned unique ID for this managed resource.
lifecycleDetails String
A message describing the current session state in more detail.
sshMetadata Map<String>
The connection message for the session.
state String
The current state of the session.
timeCreated String
The time the session was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
timeUpdated String
The time the session was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

Look up Existing Session Resource

Get an existing Session 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?: SessionState, opts?: CustomResourceOptions): Session
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bastion_id: Optional[str] = None,
        bastion_name: Optional[str] = None,
        bastion_public_host_key_info: Optional[str] = None,
        bastion_user_name: Optional[str] = None,
        display_name: Optional[str] = None,
        key_details: Optional[_bastion.SessionKeyDetailsArgs] = None,
        key_type: Optional[str] = None,
        lifecycle_details: Optional[str] = None,
        session_ttl_in_seconds: Optional[int] = None,
        ssh_metadata: Optional[Mapping[str, str]] = None,
        state: Optional[str] = None,
        target_resource_details: Optional[_bastion.SessionTargetResourceDetailsArgs] = None,
        time_created: Optional[str] = None,
        time_updated: Optional[str] = None) -> Session
func GetSession(ctx *Context, name string, id IDInput, state *SessionState, opts ...ResourceOption) (*Session, error)
public static Session Get(string name, Input<string> id, SessionState? state, CustomResourceOptions? opts = null)
public static Session get(String name, Output<String> id, SessionState state, CustomResourceOptions options)
resources:  _:    type: oci:Bastion:Session    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:
BastionId Changes to this property will trigger replacement. string
The unique identifier (OCID) of the bastion on which to create this session.
BastionName string
The name of the bastion that is hosting this session.
BastionPublicHostKeyInfo string
The public key of the bastion host. You can use this to verify that you're connecting to the correct bastion.
BastionUserName string
The username that the session uses to connect to the target resource.
DisplayName string
(Updatable) The name of the session.
KeyDetails Changes to this property will trigger replacement. SessionKeyDetails
Public key details for a bastion session.
KeyType Changes to this property will trigger replacement. string
The type of the key used to connect to the session. PUB is a standard public key in OpenSSH format.
LifecycleDetails string
A message describing the current session state in more detail.
SessionTtlInSeconds Changes to this property will trigger replacement. int
The amount of time the session can remain active.
SshMetadata Dictionary<string, string>
The connection message for the session.
State string
The current state of the session.
TargetResourceDetails Changes to this property will trigger replacement. SessionTargetResourceDetails
Details about a bastion session's target resource.
TimeCreated string
The time the session was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
TimeUpdated string
The time the session was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
BastionId Changes to this property will trigger replacement. string
The unique identifier (OCID) of the bastion on which to create this session.
BastionName string
The name of the bastion that is hosting this session.
BastionPublicHostKeyInfo string
The public key of the bastion host. You can use this to verify that you're connecting to the correct bastion.
BastionUserName string
The username that the session uses to connect to the target resource.
DisplayName string
(Updatable) The name of the session.
KeyDetails Changes to this property will trigger replacement. SessionKeyDetailsArgs
Public key details for a bastion session.
KeyType Changes to this property will trigger replacement. string
The type of the key used to connect to the session. PUB is a standard public key in OpenSSH format.
LifecycleDetails string
A message describing the current session state in more detail.
SessionTtlInSeconds Changes to this property will trigger replacement. int
The amount of time the session can remain active.
SshMetadata map[string]string
The connection message for the session.
State string
The current state of the session.
TargetResourceDetails Changes to this property will trigger replacement. SessionTargetResourceDetailsArgs
Details about a bastion session's target resource.
TimeCreated string
The time the session was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
TimeUpdated string
The time the session was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
bastionId Changes to this property will trigger replacement. String
The unique identifier (OCID) of the bastion on which to create this session.
bastionName String
The name of the bastion that is hosting this session.
bastionPublicHostKeyInfo String
The public key of the bastion host. You can use this to verify that you're connecting to the correct bastion.
bastionUserName String
The username that the session uses to connect to the target resource.
displayName String
(Updatable) The name of the session.
keyDetails Changes to this property will trigger replacement. SessionKeyDetails
Public key details for a bastion session.
keyType Changes to this property will trigger replacement. String
The type of the key used to connect to the session. PUB is a standard public key in OpenSSH format.
lifecycleDetails String
A message describing the current session state in more detail.
sessionTtlInSeconds Changes to this property will trigger replacement. Integer
The amount of time the session can remain active.
sshMetadata Map<String,String>
The connection message for the session.
state String
The current state of the session.
targetResourceDetails Changes to this property will trigger replacement. SessionTargetResourceDetails
Details about a bastion session's target resource.
timeCreated String
The time the session was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
timeUpdated String
The time the session was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
bastionId Changes to this property will trigger replacement. string
The unique identifier (OCID) of the bastion on which to create this session.
bastionName string
The name of the bastion that is hosting this session.
bastionPublicHostKeyInfo string
The public key of the bastion host. You can use this to verify that you're connecting to the correct bastion.
bastionUserName string
The username that the session uses to connect to the target resource.
displayName string
(Updatable) The name of the session.
keyDetails Changes to this property will trigger replacement. SessionKeyDetails
Public key details for a bastion session.
keyType Changes to this property will trigger replacement. string
The type of the key used to connect to the session. PUB is a standard public key in OpenSSH format.
lifecycleDetails string
A message describing the current session state in more detail.
sessionTtlInSeconds Changes to this property will trigger replacement. number
The amount of time the session can remain active.
sshMetadata {[key: string]: string}
The connection message for the session.
state string
The current state of the session.
targetResourceDetails Changes to this property will trigger replacement. SessionTargetResourceDetails
Details about a bastion session's target resource.
timeCreated string
The time the session was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
timeUpdated string
The time the session was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
bastion_id Changes to this property will trigger replacement. str
The unique identifier (OCID) of the bastion on which to create this session.
bastion_name str
The name of the bastion that is hosting this session.
bastion_public_host_key_info str
The public key of the bastion host. You can use this to verify that you're connecting to the correct bastion.
bastion_user_name str
The username that the session uses to connect to the target resource.
display_name str
(Updatable) The name of the session.
key_details Changes to this property will trigger replacement. bastion.SessionKeyDetailsArgs
Public key details for a bastion session.
key_type Changes to this property will trigger replacement. str
The type of the key used to connect to the session. PUB is a standard public key in OpenSSH format.
lifecycle_details str
A message describing the current session state in more detail.
session_ttl_in_seconds Changes to this property will trigger replacement. int
The amount of time the session can remain active.
ssh_metadata Mapping[str, str]
The connection message for the session.
state str
The current state of the session.
target_resource_details Changes to this property will trigger replacement. bastion.SessionTargetResourceDetailsArgs
Details about a bastion session's target resource.
time_created str
The time the session was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
time_updated str
The time the session was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
bastionId Changes to this property will trigger replacement. String
The unique identifier (OCID) of the bastion on which to create this session.
bastionName String
The name of the bastion that is hosting this session.
bastionPublicHostKeyInfo String
The public key of the bastion host. You can use this to verify that you're connecting to the correct bastion.
bastionUserName String
The username that the session uses to connect to the target resource.
displayName String
(Updatable) The name of the session.
keyDetails Changes to this property will trigger replacement. Property Map
Public key details for a bastion session.
keyType Changes to this property will trigger replacement. String
The type of the key used to connect to the session. PUB is a standard public key in OpenSSH format.
lifecycleDetails String
A message describing the current session state in more detail.
sessionTtlInSeconds Changes to this property will trigger replacement. Number
The amount of time the session can remain active.
sshMetadata Map<String>
The connection message for the session.
state String
The current state of the session.
targetResourceDetails Changes to this property will trigger replacement. Property Map
Details about a bastion session's target resource.
timeCreated String
The time the session was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z
timeUpdated String
The time the session was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

Supporting Types

SessionKeyDetails
, SessionKeyDetailsArgs

PublicKeyContent
This property is required.
Changes to this property will trigger replacement.
string
The public key in OpenSSH format of the SSH key pair for the session. When you connect to the session, you must provide the private key of the same SSH key pair.
PublicKeyContent
This property is required.
Changes to this property will trigger replacement.
string
The public key in OpenSSH format of the SSH key pair for the session. When you connect to the session, you must provide the private key of the same SSH key pair.
publicKeyContent
This property is required.
Changes to this property will trigger replacement.
String
The public key in OpenSSH format of the SSH key pair for the session. When you connect to the session, you must provide the private key of the same SSH key pair.
publicKeyContent
This property is required.
Changes to this property will trigger replacement.
string
The public key in OpenSSH format of the SSH key pair for the session. When you connect to the session, you must provide the private key of the same SSH key pair.
public_key_content
This property is required.
Changes to this property will trigger replacement.
str
The public key in OpenSSH format of the SSH key pair for the session. When you connect to the session, you must provide the private key of the same SSH key pair.
publicKeyContent
This property is required.
Changes to this property will trigger replacement.
String
The public key in OpenSSH format of the SSH key pair for the session. When you connect to the session, you must provide the private key of the same SSH key pair.

SessionTargetResourceDetails
, SessionTargetResourceDetailsArgs

SessionType
This property is required.
Changes to this property will trigger replacement.
string
The session type.
TargetResourceDisplayName string
The display name of the target Compute instance that the session connects to.
TargetResourceFqdn Changes to this property will trigger replacement. string
The Fully Qualified Domain Name of the target resource that the session connects to.
TargetResourceId Changes to this property will trigger replacement. string
The unique identifier (OCID) of the target resource (a Compute instance, for example) that the session connects to.
TargetResourceOperatingSystemUserName Changes to this property will trigger replacement. string
The name of the user on the target resource operating system that the session uses for the connection.
TargetResourcePort Changes to this property will trigger replacement. int
The port number to connect to on the target resource.
TargetResourcePrivateIpAddress Changes to this property will trigger replacement. string

The private IP address of the target resource that the session connects to.

** 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

SessionType
This property is required.
Changes to this property will trigger replacement.
string
The session type.
TargetResourceDisplayName string
The display name of the target Compute instance that the session connects to.
TargetResourceFqdn Changes to this property will trigger replacement. string
The Fully Qualified Domain Name of the target resource that the session connects to.
TargetResourceId Changes to this property will trigger replacement. string
The unique identifier (OCID) of the target resource (a Compute instance, for example) that the session connects to.
TargetResourceOperatingSystemUserName Changes to this property will trigger replacement. string
The name of the user on the target resource operating system that the session uses for the connection.
TargetResourcePort Changes to this property will trigger replacement. int
The port number to connect to on the target resource.
TargetResourcePrivateIpAddress Changes to this property will trigger replacement. string

The private IP address of the target resource that the session connects to.

** 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

sessionType
This property is required.
Changes to this property will trigger replacement.
String
The session type.
targetResourceDisplayName String
The display name of the target Compute instance that the session connects to.
targetResourceFqdn Changes to this property will trigger replacement. String
The Fully Qualified Domain Name of the target resource that the session connects to.
targetResourceId Changes to this property will trigger replacement. String
The unique identifier (OCID) of the target resource (a Compute instance, for example) that the session connects to.
targetResourceOperatingSystemUserName Changes to this property will trigger replacement. String
The name of the user on the target resource operating system that the session uses for the connection.
targetResourcePort Changes to this property will trigger replacement. Integer
The port number to connect to on the target resource.
targetResourcePrivateIpAddress Changes to this property will trigger replacement. String

The private IP address of the target resource that the session connects to.

** 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

sessionType
This property is required.
Changes to this property will trigger replacement.
string
The session type.
targetResourceDisplayName string
The display name of the target Compute instance that the session connects to.
targetResourceFqdn Changes to this property will trigger replacement. string
The Fully Qualified Domain Name of the target resource that the session connects to.
targetResourceId Changes to this property will trigger replacement. string
The unique identifier (OCID) of the target resource (a Compute instance, for example) that the session connects to.
targetResourceOperatingSystemUserName Changes to this property will trigger replacement. string
The name of the user on the target resource operating system that the session uses for the connection.
targetResourcePort Changes to this property will trigger replacement. number
The port number to connect to on the target resource.
targetResourcePrivateIpAddress Changes to this property will trigger replacement. string

The private IP address of the target resource that the session connects to.

** 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

session_type
This property is required.
Changes to this property will trigger replacement.
str
The session type.
target_resource_display_name str
The display name of the target Compute instance that the session connects to.
target_resource_fqdn Changes to this property will trigger replacement. str
The Fully Qualified Domain Name of the target resource that the session connects to.
target_resource_id Changes to this property will trigger replacement. str
The unique identifier (OCID) of the target resource (a Compute instance, for example) that the session connects to.
target_resource_operating_system_user_name Changes to this property will trigger replacement. str
The name of the user on the target resource operating system that the session uses for the connection.
target_resource_port Changes to this property will trigger replacement. int
The port number to connect to on the target resource.
target_resource_private_ip_address Changes to this property will trigger replacement. str

The private IP address of the target resource that the session connects to.

** 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

sessionType
This property is required.
Changes to this property will trigger replacement.
String
The session type.
targetResourceDisplayName String
The display name of the target Compute instance that the session connects to.
targetResourceFqdn Changes to this property will trigger replacement. String
The Fully Qualified Domain Name of the target resource that the session connects to.
targetResourceId Changes to this property will trigger replacement. String
The unique identifier (OCID) of the target resource (a Compute instance, for example) that the session connects to.
targetResourceOperatingSystemUserName Changes to this property will trigger replacement. String
The name of the user on the target resource operating system that the session uses for the connection.
targetResourcePort Changes to this property will trigger replacement. Number
The port number to connect to on the target resource.
targetResourcePrivateIpAddress Changes to this property will trigger replacement. String

The private IP address of the target resource that the session connects to.

** 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

Import

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

$ pulumi import oci:Bastion/session:Session test_session "id"
Copy

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

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.