oci_bastion_session

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

resource "oci_bastion_session" "test_session" {
	#Required
	bastion_id = oci_bastion_bastion.test_bastion.id
	key_details {
		#Required
		public_key_content = var.session_key_details_public_key_content
	}
	target_resource_details {
		#Required
		session_type = var.session_target_resource_details_session_type

		#Optional
		target_resource_fqdn = var.session_target_resource_details_target_resource_fqdn
		target_resource_id = oci_bastion_target_resource.test_target_resource.id
		target_resource_operating_system_user_name = oci_identity_user.test_user.name
		target_resource_port = var.session_target_resource_details_target_resource_port
		target_resource_private_ip_address = var.session_target_resource_details_target_resource_private_ip_address
	}

	#Optional
	display_name = var.session_display_name
	key_type = var.session_key_type
	session_ttl_in_seconds = var.session_session_ttl_in_seconds
}

Argument Reference

The following arguments are supported:

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

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain operations: * create - (Defaults to 20 minutes), when creating the Session * update - (Defaults to 20 minutes), when updating the Session * delete - (Defaults to 20 minutes), when destroying the Session

Import

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

$ terraform import oci_bastion_session.test_session "id"