{"id":18806863,"url":"https://github.com/jeevanjoseph/sdf-core-subnet","last_synced_at":"2026-01-25T13:02:32.289Z","repository":{"id":93224844,"uuid":"198719023","full_name":"jeevanjoseph/sdf-core-subnet","owner":"jeevanjoseph","description":null,"archived":false,"fork":false,"pushed_at":"2019-10-11T18:14:58.000Z","size":177,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-22T01:09:49.615Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeevanjoseph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-24T22:44:16.000Z","updated_at":"2019-10-11T18:15:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"fee5b5b1-2541-445a-94ac-b9f5bb03c769","html_url":"https://github.com/jeevanjoseph/sdf-core-subnet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jeevanjoseph/sdf-core-subnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeevanjoseph%2Fsdf-core-subnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeevanjoseph%2Fsdf-core-subnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeevanjoseph%2Fsdf-core-subnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeevanjoseph%2Fsdf-core-subnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeevanjoseph","download_url":"https://codeload.github.com/jeevanjoseph/sdf-core-subnet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeevanjoseph%2Fsdf-core-subnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28753411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T10:25:12.305Z","status":"ssl_error","status_checked_at":"2026-01-25T10:25:11.933Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T22:49:50.412Z","updated_at":"2026-01-25T13:02:32.261Z","avatar_url":"https://github.com/jeevanjoseph.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Oracle Cloud Infrastructure (OCI) Terraform Subnet Module\n\n## Introduction\n\n\nThis module assist in building one or more new Subnet(s) in OCI.\n\n## Solution\n\nSubnets are the home for many IP-based resources in OCI.  Much like a VLAN in traditional on-prem LANs, it's a foundational component in a OCI cloud environment.\n\n| Resource | Created by Default? |\n|---|---|\n| Subnet(s) | No |\n\n### Prerequisites\nThis module does not create any dependencies or prerequisites (these must be created prior to using this module):\n\n* VCN\n* Security List(s)\n  * The *network_security* module may be used to create and manage Security Lists.\n* Route Table\n  * Often times only a couple of routing policies exist and are created in the *network* module.\n* DHCP Options\n  * Often times only a couple of DHCP Options (DNS profiles) exist and are created in the *network* module.\n\n### Resource-specific inputs\n\n#### Subnet\n\n| Attribute | Data Type | Required | Default Value | Valid Values | Description |\n|---|---|---|---|---|---|\n| default\\_compartment\\_id | string | yes | none | string of the compartment OCID | This is the default OCID that will be used when creating objects (unless overridden for any specific object).  This needs to be the OCID of a pre-existing compartment (it will not create the compartment. |\n| vcn\\_id | string | yes | N/A (no default) | The OCID of the VCN in which the subnet(s) are to be created. |\n| vcn\\_cidr | string | no | N/A (no default) | The CIDR used by the VCN.  This is only needed when dynamically generating subnet CIDRs.\n| default\\_defined\\_tags | map(string) | {} | Any map of tag names and values that is acceptable to the OCI API. | These are the Defined Tags that will be set on resources (unless they're overridden at the resource level). |\n| default\\_freeform\\_tags | map(string) | {} | Any map of tag names and values that is acceptable to the OCI API. | These are the Freeform Tags that will be set on resources (unless they're overridden at the resource level). |\n| subnets | map | no | see below | see below | The parameters used to create the subnets. |\n\n**subnets**\n\nThe `subnets` attribute is an optional map object attribute.  Note that if this attribute is used, all keys/values must be specified (Terraform does not allow for default or optional map keys/values).\n\nEach entry's key specifies the name to be given to the subnet, with its attributes specified as values in a sub-map.\n\nEach entry has the following defined keys (and default values):\n\n| Key | Data Type | Default Value | Valid Values | Description |\n|---|---|---|---|---|\n| compartment\\_id | string | null | Compartment OCID | Pre-existing compartment OCID (if default compartment is not to be used).  If this value is null, the default compartment OCID will be used. |\n| defined\\_tags | map(string) | var.default\\_defined\\_tags | Any map of tag names and values that is acceptable to the OCI API. | If any Defined Tags should be set on this resource, do so with this attribute (otherwise the default Defined Tags will be used). |\n| freeform\\_tags | map(string) | var.default\\_freeform\\_tags | Any map of tag names and values that is acceptable to the OCI API. | If any Freeform Tags should be set on this resource, do so with this attribute (otherwise the default Freeform Tags will be used). |\n| dynamic_cidr | bool | false | true/false | Whether or not the CIDR should be dynamically calculated (true) or statically set (false). |\n| cidr | string | static cidr: null, dynamic_cidr: VCN CIDR | IPv4 CIDR | Specify the IPv4 CIDR to be used for the Subnet.  If dynamic_cidr is true, the CIDR specified here will be used in the subnet calculation.  If dynamic_cidr is false, the CIDR specified here will be the one used by the subnet. |\n| cidr\\_len | number | 28 | Any number between 16 and 30 | This is the desired bit length (number of bits in the subnet mask) for the new, dynamically generated subnet CIDR.  Only applicable if dynamic_cidr is true. |\n| cidr\\_num | number | Defaults to the index number of the subnet being defined | This is the zero-indexed network number that should be used for the subnet.  For example, let's say that cidr is 192.168.0.0/16 and cidr\\_len is 24.  For cidr\\_num of 1, a dynamically generated CIDR of 192.168.1.0/24 would be given.  In the same scenario, with a cidr\\_num of 0, 192.168.0.0/24 would result and cidr\\_num of 240 would yield 192.168.240.0/24. |\n| enable\\_dns | bool | true | Whether or not DNS should be enabled for the subnet. |\n| dns\\_label | string | \"vcn\" | Valid DNS name. | Specify the DNS label to be used for the VCN.  If this value is null, a dynamically generated value of *subnet\u003cindex_num\u003e* will be used.  For example, the third subnet definition, if DNS is enabled, but no dns_label is provided (a null value is given), a value of *subnet2* will be generated (remembering that index numbers are zero-indexed). |\n| private | bool | true | true/false | If set to true, the subnet will be a private subnet.  If set to false, a public subnet will be created. |\n| ad | number | null | null, 0, 1 or 2 (dependent upon the number of available Availability Domains (ADs) in the specific region being used) | If a regional subnet is desired, leave this value as null, otherwise specify the AD number (zero-index, meaning AD1 = 0, AD2 = 1, AD3 = 2) to create an AD-specific subnet. |\n| dhcp\\_options\\_id | string | null | null or OCID | Specify the OCID of the DHCP Options to use for the subnet. |\n| route\\_table\\_id | string | null | null or OCID | Specify the OCID of the Route Table to use for the subnet. |\n| security\\_list\\_ids | list of strings | null | null or list of OCID(s) | Specify the OCID(s) of the Security List(s) to use for the subnet, in list form. |\n\nExample:\n\n```\nmodule \"oci_subnets\" {\n  ... /snip - shortened for brevity...\n\n  default_compartment_id  = var.default_compartment_id\n  # vcn_id = data.terraform_remote_state.network.outputs.vcn.id\n  vcn_id                  = oci_core_vcn.this.id\n  vcn_cidr                = oci_core_vcn.this.cidr_block\n  \n  subnets = {\n    test1 = {\n      compartment_id    = null\n      defined_tags      = null\n      freeform_tags     = null\n      dynamic_cidr      = false\n      cidr              = \"192.168.0.0/30\"\n      cidr_len          = null\n      cidr_num          = null\n      enable_dns        = true\n      dns_label         = \"test1\"\n      private           = true\n      ad                = null\n      dhcp_options_id   = null\n      route_table_id    = null\n      security_list_ids = null\n    },\n    test2 = {\n      compartment_id    = null\n      defined_tags      = null\n      freeform_tags     = null\n      dynamic_cidr      = false\n      cidr              = \"192.168.0.4/30\"\n      cidr_len          = null\n      cidr_num          = null\n      enable_dns        = true\n      dns_label         = \"test2\"\n      private           = true\n      ad                = 0\n      dhcp_options_id   = null\n      route_table_id    = null\n      security_list_ids = null\n    }\n  }\n}\n```\n\nThe above example will create two subnets, *test1* and *test2*.  Each of these will use the default compartment OCID (not shown in the above example) and will use statically-defined CIDRs.\n\n### Outputs\n\nA map containing each subnet is returned in the *subnets* output.  The outer map key is the name of the subnet, with all subnet attributes (as a map) being returned as the value.\n\n## Getting Started\n\nSeveral fully-functional examples have been provided in the `examples` directory.  For a quick-start guide, at minimum, you need the following (for the most basic deployment):\n\n```\nmodule \"oci_subnets\" {\n  source           = \"../../\"\n  #source          = \"oracle-terraform-modules/default-vcn/oci\"\n  \n  default_compartment_id  = var.default_compartment_id\n  vcn_id                  = oci_core_vcn.this.id\n  vcn_cidr                = oci_core_vcn.this.cidr_block\n  \n  subnets = {}\n}\n```\n\nThe above example won't actually deploy any subnets (because the *subnets* attribute is an empty map), however if you populate this map with entries (keys = name, values = subnet attributes), subnets would be deployed.\n\n## Accessing the Solution\n\nThis is a core service module that is foundational to many other resources in OCI, so there is really nothing to directly access.\n\n## Summary\n\nThis serves as a foundational component in an OCI environment, providing the ability to provision subnets as-needed OCI.\n\n## Notes/Issues\n\n* Note that if you provide any single element in the different resource maps (`subnets`), you must provide all of them.  Maps do not have a notion of an optional (or default value) for keys within the map, requiring that all keys/values be passed (if one key is passed, all keys must be passed).\n\n## Release Notes\n\nSee [./docs/release_notes.md](release notes) for release notes information.\n\n## URLs\n\n* Nothing at this time\n\n## Contributing\n\nThis project is open source. Oracle appreciates any contributions that are made by the open source community.\n\n## License\n\nCopyright (c) 2018, Oracle and/or its affiliates. All rights reserved.\n\nLicensed under the Universal Permissive License 1.0 or Apache License 2.0.\n\nSee [LICENSE](LICENSE.txt) for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeevanjoseph%2Fsdf-core-subnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeevanjoseph%2Fsdf-core-subnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeevanjoseph%2Fsdf-core-subnet/lists"}