Skip to content

Latest commit

 

History

History

subnet

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

SUBNET Module Example

This module is used to create a Subnet

Example Usage

data "ibm_is_vpc" "vpc" {
  name = var.vpc
}

data "ibm_resource_group" "resource_group" {
  name = (var.resource_group != null ? var.resource_group : "default")
}

module "subnet" {
  source = "terraform-ibm-modules/vpc/ibm//modules/subnet"

  name                       = var.name
  vpc_id                     = data.ibm_is_vpc.vpc.id
  resource_group_id          = data.ibm_resource_group.resource_group.id
  location                   = var.location
  ip_range                   = var.ip_range
  number_of_addresses        = var.number_of_addresses
  subnet_access_control_list = var.subnet_access_control_list
  public_gateway             = var.public_gateway
  routing_table              = var.routing_table
}

Requirements

Name Version
terraform >= 1.3.0
ibm >= 1.64.0, <2.0.0

Modules

No modules.

Resources

Name Type
ibm_is_subnet.subnet resource

Inputs

Name Description Type Default Required
ip_range IP range or CIDR block string null no
location location of the subnet string n/a yes
name Name of the subnet string n/a yes
number_of_addresses Number of IPV4 Addresses number null no
public_gateway Public Gateway ID string null no
resource_group_id Resource group ID string null no
routing_table Routing Table ID string null no
subnet_access_control_list Network ACL ID string null no
vpc_id VPC ID string n/a yes

Outputs

Name Description
subnet_id The ID of the subnet
subnet_ipv4_cidr IPV4 subnet CIDR block