diff options
| author | Seth Flynn <[email protected]> | 2025-02-06 18:11:46 -0500 |
|---|---|---|
| committer | Seth Flynn <[email protected]> | 2025-02-06 18:12:01 -0500 |
| commit | 72ce5493e34d1f3ce271682cfb3435946f038dca (patch) | |
| tree | 1921c846340fa241f9fbd11fb3373a122d931eb9 /terraform/oci.tf | |
| parent | 178d5606278b5e4bfcb9e3cb8296c4392850b2a8 (diff) | |
terraform: import oci infra into state
Diffstat (limited to 'terraform/oci.tf')
| -rw-r--r-- | terraform/oci.tf | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/terraform/oci.tf b/terraform/oci.tf new file mode 100644 index 0000000..704ff2c --- /dev/null +++ b/terraform/oci.tf @@ -0,0 +1,58 @@ +# Create everything from an existing tenancy + +resource "oci_identity_compartment" "borealis" { + compartment_id = var.oracle_tenancy_ocid + description = "For my personal infra" + name = "borealis" +} + +data "oci_identity_availability_domains" "borealis" { + compartment_id = oci_identity_compartment.borealis.id +} + +output "borealis-first-availability-domain" { + value = data.oci_identity_availability_domains.borealis.availability_domains[0].name +} + +resource "oci_core_vcn" "borealis" { + compartment_id = oci_identity_compartment.borealis.id + display_name = "borealis" +} + +resource "oci_core_subnet" "borealis_global" { + cidr_block = "10.0.0.0/24" + compartment_id = oci_core_vcn.borealis.compartment_id + vcn_id = oci_core_vcn.borealis.id + + display_name = "global" +} + +resource "oci_core_security_list" "borealis_global" { + compartment_id = oci_core_vcn.borealis.compartment_id + vcn_id = oci_core_vcn.borealis.id + + display_name = "default" + + egress_security_rules { + destination = "0.0.0.0/0" + protocol = "all" + } + + ingress_security_rules { + icmp_options { + code = "4" + type = "3" + } + protocol = "1" + source = "0.0.0.0/0" + } + + ingress_security_rules { + icmp_options { + code = "-1" + type = "3" + } + protocol = "1" + source = "10.0.0.0/16" + } +} |
