Oracle Cloud Infrastructure

v0.5.0 published on Monday, Sep 12, 2022 by Pulumi

getBastions

This data source provides the list of Bastions in Oracle Cloud Infrastructure Bastion service.

Retrieves a list of BastionSummary objects in a compartment. Bastions provide secured, public access to target resources in the cloud that you cannot otherwise reach from the internet.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testBastions = Oci.Bastion.GetBastions.Invoke(new()
    {
        CompartmentId = @var.Compartment_id,
        BastionId = oci_bastion_bastion.Test_bastion.Id,
        BastionLifecycleState = @var.Bastion_bastion_lifecycle_state,
        Name = @var.Bastion_name,
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Bastion.GetBastions(ctx, &bastion.GetBastionsArgs{
			CompartmentId:         _var.Compartment_id,
			BastionId:             pulumi.StringRef(oci_bastion_bastion.Test_bastion.Id),
			BastionLifecycleState: pulumi.StringRef(_var.Bastion_bastion_lifecycle_state),
			Name:                  pulumi.StringRef(_var.Bastion_name),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Bastion.BastionFunctions;
import com.pulumi.oci.Bastion.inputs.GetBastionsArgs;
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 testBastions = BastionFunctions.getBastions(GetBastionsArgs.builder()
            .compartmentId(var_.compartment_id())
            .bastionId(oci_bastion_bastion.test_bastion().id())
            .bastionLifecycleState(var_.bastion_bastion_lifecycle_state())
            .name(var_.bastion_name())
            .build());

    }
}
import pulumi
import pulumi_oci as oci

test_bastions = oci.Bastion.get_bastions(compartment_id=var["compartment_id"],
    bastion_id=oci_bastion_bastion["test_bastion"]["id"],
    bastion_lifecycle_state=var["bastion_bastion_lifecycle_state"],
    name=var["bastion_name"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testBastions = oci.Bastion.getBastions({
    compartmentId: _var.compartment_id,
    bastionId: oci_bastion_bastion.test_bastion.id,
    bastionLifecycleState: _var.bastion_bastion_lifecycle_state,
    name: _var.bastion_name,
});
variables:
  testBastions:
    Fn::Invoke:
      Function: oci:Bastion:getBastions
      Arguments:
        compartmentId: ${var.compartment_id}
        bastionId: ${oci_bastion_bastion.test_bastion.id}
        bastionLifecycleState: ${var.bastion_bastion_lifecycle_state}
        name: ${var.bastion_name}

Using getBastions

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 getBastions(args: GetBastionsArgs, opts?: InvokeOptions): Promise<GetBastionsResult>
function getBastionsOutput(args: GetBastionsOutputArgs, opts?: InvokeOptions): Output<GetBastionsResult>
def get_bastions(bastion_id: Optional[str] = None,
                 bastion_lifecycle_state: Optional[str] = None,
                 compartment_id: Optional[str] = None,
                 filters: Optional[Sequence[_bastion.GetBastionsFilter]] = None,
                 name: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetBastionsResult
def get_bastions_output(bastion_id: Optional[pulumi.Input[str]] = None,
                 bastion_lifecycle_state: Optional[pulumi.Input[str]] = None,
                 compartment_id: Optional[pulumi.Input[str]] = None,
                 filters: Optional[pulumi.Input[Sequence[pulumi.Input[_bastion.GetBastionsFilterArgs]]]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetBastionsResult]
func GetBastions(ctx *Context, args *GetBastionsArgs, opts ...InvokeOption) (*GetBastionsResult, error)
func GetBastionsOutput(ctx *Context, args *GetBastionsOutputArgs, opts ...InvokeOption) GetBastionsResultOutput

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

public static class GetBastions 
{
    public static Task<GetBastionsResult> InvokeAsync(GetBastionsArgs args, InvokeOptions? opts = null)
    public static Output<GetBastionsResult> Invoke(GetBastionsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetBastionsResult> getBastions(GetBastionsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: oci:Bastion/getBastions:getBastions
  arguments:
    # arguments dictionary

The following arguments are supported:

CompartmentId string

The unique identifier (OCID) of the compartment in which to list resources.

BastionId string

The unique identifier (OCID) of the bastion in which to list resources.

BastionLifecycleState string

A filter to return only resources their lifecycleState matches the given lifecycleState.

Filters List<GetBastionsFilter>
Name string

A filter to return only resources that match the entire name given.

CompartmentId string

The unique identifier (OCID) of the compartment in which to list resources.

BastionId string

The unique identifier (OCID) of the bastion in which to list resources.

BastionLifecycleState string

A filter to return only resources their lifecycleState matches the given lifecycleState.

Filters []GetBastionsFilter
Name string

A filter to return only resources that match the entire name given.

compartmentId String

The unique identifier (OCID) of the compartment in which to list resources.

bastionId String

The unique identifier (OCID) of the bastion in which to list resources.

bastionLifecycleState String

A filter to return only resources their lifecycleState matches the given lifecycleState.

filters List<GetsFilter>
name String

A filter to return only resources that match the entire name given.

compartmentId string

The unique identifier (OCID) of the compartment in which to list resources.

bastionId string

The unique identifier (OCID) of the bastion in which to list resources.

bastionLifecycleState string

A filter to return only resources their lifecycleState matches the given lifecycleState.

filters GetBastionsFilter[]
name string

A filter to return only resources that match the entire name given.

compartment_id str

The unique identifier (OCID) of the compartment in which to list resources.

bastion_id str

The unique identifier (OCID) of the bastion in which to list resources.

bastion_lifecycle_state str

A filter to return only resources their lifecycleState matches the given lifecycleState.

filters GetBastionsFilter]
name str

A filter to return only resources that match the entire name given.

compartmentId String

The unique identifier (OCID) of the compartment in which to list resources.

bastionId String

The unique identifier (OCID) of the bastion in which to list resources.

bastionLifecycleState String

A filter to return only resources their lifecycleState matches the given lifecycleState.

filters List<Property Map>
name String

A filter to return only resources that match the entire name given.

getBastions Result

The following output properties are available:

Bastions List<GetBastionsBastion>

The list of bastions.

CompartmentId string

The unique identifier (OCID) of the compartment where the bastion is located.

Id string

The provider-assigned unique ID for this managed resource.

BastionId string
BastionLifecycleState string
Filters List<GetBastionsFilter>
Name string

The name of the bastion, which can't be changed after creation.

Bastions []GetBastionsBastion

The list of bastions.

CompartmentId string

The unique identifier (OCID) of the compartment where the bastion is located.

Id string

The provider-assigned unique ID for this managed resource.

BastionId string
BastionLifecycleState string
Filters []GetBastionsFilter
Name string

The name of the bastion, which can't be changed after creation.

bastions List<Gets>

The list of bastions.

compartmentId String

The unique identifier (OCID) of the compartment where the bastion is located.

id String

The provider-assigned unique ID for this managed resource.

bastionId String
bastionLifecycleState String
filters List<GetsFilter>
name String

The name of the bastion, which can't be changed after creation.

bastions GetBastionsBastion[]

The list of bastions.

compartmentId string

The unique identifier (OCID) of the compartment where the bastion is located.

id string

The provider-assigned unique ID for this managed resource.

bastionId string
bastionLifecycleState string
filters GetBastionsFilter[]
name string

The name of the bastion, which can't be changed after creation.

bastions GetBastionsBastion]

The list of bastions.

compartment_id str

The unique identifier (OCID) of the compartment where the bastion is located.

id str

The provider-assigned unique ID for this managed resource.

bastion_id str
bastion_lifecycle_state str
filters GetBastionsFilter]
name str

The name of the bastion, which can't be changed after creation.

bastions List<Property Map>

The list of bastions.

compartmentId String

The unique identifier (OCID) of the compartment where the bastion is located.

id String

The provider-assigned unique ID for this managed resource.

bastionId String
bastionLifecycleState String
filters List<Property Map>
name String

The name of the bastion, which can't be changed after creation.

Supporting Types

GetBastionsBastion

BastionType string

The type of bastion.

ClientCidrBlockAllowLists List<string>

A list of address ranges in CIDR notation that you want to allow to connect to sessions hosted by this bastion.

CompartmentId string

The unique identifier (OCID) of the compartment in which to list resources.

DefinedTags Dictionary<string, object>

Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

FreeformTags Dictionary<string, object>

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

Id string

The unique identifier (OCID) of the bastion, which can't be changed after creation.

LifecycleDetails string

A message describing the current state in more detail.

MaxSessionTtlInSeconds int

The maximum amount of time that any session on the bastion can remain active.

MaxSessionsAllowed int

The maximum number of active sessions allowed on the bastion.

Name string

A filter to return only resources that match the entire name given.

PhoneBookEntry string

The phonebook entry of the customer's team, which can't be changed after creation. Not applicable to standard bastions.

PrivateEndpointIpAddress string

The private IP address of the created private endpoint.

State string

The current state of the bastion.

StaticJumpHostIpAddresses List<string>

A list of IP addresses of the hosts that the bastion has access to. Not applicable to standard bastions.

SystemTags Dictionary<string, object>

Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}

TargetSubnetId string

The unique identifier (OCID) of the subnet that the bastion connects to.

TargetVcnId string

The unique identifier (OCID) of the virtual cloud network (VCN) that the bastion connects to.

TimeCreated string

The time the bastion was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

TimeUpdated string

The time the bastion was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

BastionType string

The type of bastion.

ClientCidrBlockAllowLists []string

A list of address ranges in CIDR notation that you want to allow to connect to sessions hosted by this bastion.

CompartmentId string

The unique identifier (OCID) of the compartment in which to list resources.

DefinedTags map[string]interface{}

Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

FreeformTags map[string]interface{}

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

Id string

The unique identifier (OCID) of the bastion, which can't be changed after creation.

LifecycleDetails string

A message describing the current state in more detail.

MaxSessionTtlInSeconds int

The maximum amount of time that any session on the bastion can remain active.

MaxSessionsAllowed int

The maximum number of active sessions allowed on the bastion.

Name string

A filter to return only resources that match the entire name given.

PhoneBookEntry string

The phonebook entry of the customer's team, which can't be changed after creation. Not applicable to standard bastions.

PrivateEndpointIpAddress string

The private IP address of the created private endpoint.

State string

The current state of the bastion.

StaticJumpHostIpAddresses []string

A list of IP addresses of the hosts that the bastion has access to. Not applicable to standard bastions.

SystemTags map[string]interface{}

Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}

TargetSubnetId string

The unique identifier (OCID) of the subnet that the bastion connects to.

TargetVcnId string

The unique identifier (OCID) of the virtual cloud network (VCN) that the bastion connects to.

TimeCreated string

The time the bastion was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

TimeUpdated string

The time the bastion was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

bastionType String

The type of bastion.

clientCidrBlockAllowLists List<String>

A list of address ranges in CIDR notation that you want to allow to connect to sessions hosted by this bastion.

compartmentId String

The unique identifier (OCID) of the compartment in which to list resources.

definedTags Map<String,Object>

Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

freeformTags Map<String,Object>

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

id String

The unique identifier (OCID) of the bastion, which can't be changed after creation.

lifecycleDetails String

A message describing the current state in more detail.

maxSessionTtlInSeconds Integer

The maximum amount of time that any session on the bastion can remain active.

maxSessionsAllowed Integer

The maximum number of active sessions allowed on the bastion.

name String

A filter to return only resources that match the entire name given.

phoneBookEntry String

The phonebook entry of the customer's team, which can't be changed after creation. Not applicable to standard bastions.

privateEndpointIpAddress String

The private IP address of the created private endpoint.

state String

The current state of the bastion.

staticJumpHostIpAddresses List<String>

A list of IP addresses of the hosts that the bastion has access to. Not applicable to standard bastions.

systemTags Map<String,Object>

Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}

targetSubnetId String

The unique identifier (OCID) of the subnet that the bastion connects to.

targetVcnId String

The unique identifier (OCID) of the virtual cloud network (VCN) that the bastion connects to.

timeCreated String

The time the bastion was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

timeUpdated String

The time the bastion was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

bastionType string

The type of bastion.

clientCidrBlockAllowLists string[]

A list of address ranges in CIDR notation that you want to allow to connect to sessions hosted by this bastion.

compartmentId string

The unique identifier (OCID) of the compartment in which to list resources.

definedTags {[key: string]: any}

Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

freeformTags {[key: string]: any}

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

id string

The unique identifier (OCID) of the bastion, which can't be changed after creation.

lifecycleDetails string

A message describing the current state in more detail.

maxSessionTtlInSeconds number

The maximum amount of time that any session on the bastion can remain active.

maxSessionsAllowed number

The maximum number of active sessions allowed on the bastion.

name string

A filter to return only resources that match the entire name given.

phoneBookEntry string

The phonebook entry of the customer's team, which can't be changed after creation. Not applicable to standard bastions.

privateEndpointIpAddress string

The private IP address of the created private endpoint.

state string

The current state of the bastion.

staticJumpHostIpAddresses string[]

A list of IP addresses of the hosts that the bastion has access to. Not applicable to standard bastions.

systemTags {[key: string]: any}

Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}

targetSubnetId string

The unique identifier (OCID) of the subnet that the bastion connects to.

targetVcnId string

The unique identifier (OCID) of the virtual cloud network (VCN) that the bastion connects to.

timeCreated string

The time the bastion was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

timeUpdated string

The time the bastion was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

bastion_type str

The type of bastion.

client_cidr_block_allow_lists Sequence[str]

A list of address ranges in CIDR notation that you want to allow to connect to sessions hosted by this bastion.

compartment_id str

The unique identifier (OCID) of the compartment in which to list resources.

defined_tags Mapping[str, Any]

Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

freeform_tags Mapping[str, Any]

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

id str

The unique identifier (OCID) of the bastion, which can't be changed after creation.

lifecycle_details str

A message describing the current state in more detail.

max_session_ttl_in_seconds int

The maximum amount of time that any session on the bastion can remain active.

max_sessions_allowed int

The maximum number of active sessions allowed on the bastion.

name str

A filter to return only resources that match the entire name given.

phone_book_entry str

The phonebook entry of the customer's team, which can't be changed after creation. Not applicable to standard bastions.

private_endpoint_ip_address str

The private IP address of the created private endpoint.

state str

The current state of the bastion.

static_jump_host_ip_addresses Sequence[str]

A list of IP addresses of the hosts that the bastion has access to. Not applicable to standard bastions.

system_tags Mapping[str, Any]

Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}

target_subnet_id str

The unique identifier (OCID) of the subnet that the bastion connects to.

target_vcn_id str

The unique identifier (OCID) of the virtual cloud network (VCN) that the bastion connects to.

time_created str

The time the bastion was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

time_updated str

The time the bastion was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

bastionType String

The type of bastion.

clientCidrBlockAllowLists List<String>

A list of address ranges in CIDR notation that you want to allow to connect to sessions hosted by this bastion.

compartmentId String

The unique identifier (OCID) of the compartment in which to list resources.

definedTags Map<Any>

Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}

freeformTags Map<Any>

Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}

id String

The unique identifier (OCID) of the bastion, which can't be changed after creation.

lifecycleDetails String

A message describing the current state in more detail.

maxSessionTtlInSeconds Number

The maximum amount of time that any session on the bastion can remain active.

maxSessionsAllowed Number

The maximum number of active sessions allowed on the bastion.

name String

A filter to return only resources that match the entire name given.

phoneBookEntry String

The phonebook entry of the customer's team, which can't be changed after creation. Not applicable to standard bastions.

privateEndpointIpAddress String

The private IP address of the created private endpoint.

state String

The current state of the bastion.

staticJumpHostIpAddresses List<String>

A list of IP addresses of the hosts that the bastion has access to. Not applicable to standard bastions.

systemTags Map<Any>

Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud.free-tier-retained": "true"}

targetSubnetId String

The unique identifier (OCID) of the subnet that the bastion connects to.

targetVcnId String

The unique identifier (OCID) of the virtual cloud network (VCN) that the bastion connects to.

timeCreated String

The time the bastion was created. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

timeUpdated String

The time the bastion was updated. Format is defined by RFC3339. Example: 2020-01-25T21:10:29.600Z

GetBastionsFilter

Name string

A filter to return only resources that match the entire name given.

Values List<string>
Regex bool
Name string

A filter to return only resources that match the entire name given.

Values []string
Regex bool
name String

A filter to return only resources that match the entire name given.

values List<String>
regex Boolean
name string

A filter to return only resources that match the entire name given.

values string[]
regex boolean
name str

A filter to return only resources that match the entire name given.

values Sequence[str]
regex bool
name String

A filter to return only resources that match the entire name given.

values List<String>
regex Boolean

Package Details

Repository
https://github.com/pulumi/pulumi-oci
License
Apache-2.0
Notes

This Pulumi package is based on the oci Terraform Provider.