network

package
v0.14.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFloatingIP

func NewFloatingIP(ctx *pulumi.Context, args *FloatingIPArgs) (*ibmcloud.IsFloatingIp, error)

NewFloatingIP creates an IBM Cloud VPC floating IP. RG may be nil to use the account default resource group.

func NewSecurityGroupWithSSH

func NewSecurityGroupWithSSH(ctx *pulumi.Context, args *SecurityGroupArgs) (*ibmcloud.IsSecurityGroup, error)

NewSecurityGroupWithSSH creates a security group with inbound SSH (port 22) and unrestricted outbound rules. RG may be nil to use the account default.

func ValidateNetworkMode added in v0.14.8

func ValidateNetworkMode(vpcID, subnetID, subnetCIDR string) error

ValidateNetworkMode checks the network mode flag combinations. It is called from the cmd layer before Pulumi starts, and again from New as defense in depth.

Types

type FloatingIPArgs

type FloatingIPArgs struct {
	Prefix      string
	ComponentID string
	Name        string
	Zone        pulumi.StringInput
	RG          *ibmcloud.ResourceGroup
	Tags        pulumi.StringArray
}

FloatingIPArgs defines the inputs for NewFloatingIP.

type Mode added in v0.14.8

type Mode int

Mode is the network provisioning mode selected by the target flags.

const (
	// ModeCreate is the default mode: mapt creates and owns the VPC, subnet,
	// public gateway, security group, and floating IP.
	ModeCreate Mode = iota
	// ModeReuseVPC reuses an existing VPC (--vpc-id): mapt creates its own
	// subnet, security group, and floating IP inside it. No public gateway is
	// created — a real VPC typically has a public gateway in every zone
	// already, and IBM Cloud allows only one per zone per VPC.
	ModeReuseVPC
	// ModeReuseSubnet reuses an existing subnet (--subnet-id): the VPC and
	// zone are discovered from the subnet, and mapt only creates a security
	// group and a floating IP. mapt never modifies or destroys the VPC or the
	// subnet.
	ModeReuseSubnet
)

func NetworkMode added in v0.14.8

func NetworkMode(vpcID, subnetID, subnetCIDR string) (Mode, error)

NetworkMode returns the provisioning mode for the --vpc-id, --subnet-id and --subnet-cidr flag values. It only validates the local flag combinations; cloud-dependent checks (subnet existence, zone consistency) happen in New.

type Network

type Network struct {
	// VPCID is the resolved VPC ID — set regardless of whether the VPC was
	// created by mapt, reused via VpcID, or discovered from the subnet.
	VPCID pulumi.StringOutput
	// SubnetID is the resolved subnet ID — the subnet created by mapt or the
	// one reused via SubnetID.
	SubnetID pulumi.StringOutput
	// Zone is the resolved availability zone — the Zone argument, or the zone
	// of the reused subnet. Consumers must use it instead of the raw IC_ZONE
	// value.
	Zone          pulumi.StringOutput
	SecurityGroup *ibmcloud.IsSecurityGroup
	Floatingip    *ibmcloud.IsFloatingIp
}

func New

func New(ctx *pulumi.Context, args *NetworkArgs) (*Network, error)

New provisions the network context for an IBM Cloud target. Exactly one of three modes runs, selected by VpcID / SubnetID (see Mode). Resources not created by mapt are resolved through Pulumi data-source lookups, which are never destroyed — mapt never modifies or destroys externally managed network resources.

type NetworkArgs

type NetworkArgs struct {
	Prefix      string
	ComponentID string
	Name        string
	RG          *ibmcloud.ResourceGroup
	// Zone is the availability zone, resolved from the IC_ZONE environment
	// variable by the caller. It is required unless SubnetID is set; in
	// subnet mode the zone is discovered from the subnet, and Zone, when
	// set, must match it.
	Zone *string
	Tags pulumi.StringArray
	// VpcID, when set, reuses an existing VPC instead of creating one. A new
	// subnet, security group, and floating IP are still created inside the
	// existing VPC. Mutually exclusive with SubnetID.
	VpcID *string
	// SubnetID, when set, reuses an existing subnet instead of creating one.
	// The VPC and zone are discovered from the subnet. Mutually exclusive
	// with VpcID and SubnetCIDR.
	SubnetID *string
	// SubnetCIDR, when set, overrides the default subnet CIDR (10.0.2.0/24)
	// of the subnet created inside an existing VPC. It requires VpcID.
	SubnetCIDR *string
}

type SecurityGroupArgs

type SecurityGroupArgs struct {
	Prefix      string
	ComponentID string
	Name        string
	VPC         pulumi.StringInput
	RG          *ibmcloud.ResourceGroup
	Tags        pulumi.StringArray
}

SecurityGroupArgs defines the inputs for NewSecurityGroupWithSSH.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL