Bastion Abstractions
cloudspells.core.abstractions.bastion
Cloud-neutral bastion abstractions for CloudSpells multi-cloud support.
Different providers implement secure shell access differently:
- OCI —
Bastionuses the OCI Bastion Service (managed endpoint with ephemeral session tokens). - AWS — AWS Systems Manager Session Manager or EC2 Instance Connect.
- GCP — Identity-Aware Proxy (IAP) TCP forwarding.
All implementations satisfy AbstractBastion.
Exports
AbstractBastion: Interface for a secure shell access mechanism.
AbstractBastion
Bases: ABC
Interface for a provider-agnostic secure shell access mechanism.
Provider implementations (OCI Bastion,
AWS AwsSessionManagerBastion, GCP GcpIapBastion) satisfy this
interface.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
Output[str]
|
Provider resource ID of the bastion resource. |
Example
def export_bastion(b: AbstractBastion, label: str) -> None:
pulumi.export(f"{label}_bastion_endpoint",
b.get_access_endpoint())
export_bastion(oci_bastion, "mgmt")
Source code in packages/cloudspells-core/src/cloudspells/core/abstractions/bastion.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
get_access_endpoint() -> pulumi.Output[str]
abstractmethod
Return the access endpoint for establishing SSH proxy sessions.
For OCI this is the bastion's private endpoint IP. For AWS it may be the SSM endpoint URL. For GCP it is the IAP tunnel address.
Returns:
| Type | Description |
|---|---|
Output[str]
|
|
Source code in packages/cloudspells-core/src/cloudspells/core/abstractions/bastion.py
45 46 47 48 49 50 51 52 53 54 | |
export() -> None
abstractmethod
Publish standard bastion stack outputs.
Source code in packages/cloudspells-core/src/cloudspells/core/abstractions/bastion.py
56 57 58 | |