Documentation
¶
Index ¶
- func NewFloatingIP(ctx *pulumi.Context, args *FloatingIPArgs) (*ibmcloud.IsFloatingIp, error)
- func NewSecurityGroupWithSSH(ctx *pulumi.Context, args *SecurityGroupArgs) (*ibmcloud.IsSecurityGroup, error)
- func ValidateNetworkMode(vpcID, subnetID, subnetCIDR string) error
- type FloatingIPArgs
- type Mode
- type Network
- type NetworkArgs
- type SecurityGroupArgs
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
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
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.