This repository provides Terraform configurations for deploying resources in Oracle Cloud Infrastructure (OCI) Free Tier.
- Terraform installed on your local machine.
- Oracle Cloud Infrastructure (OCI) account.
- OCI CLI configured with your credentials.
-
Clone the repository:
git clone https://github.com/filippolmt/terraform-oci-free-tier.git cd terraform-oci-free-tier
-
Configure your variables: Copy the
terraform.tfvars.template
toterraform.tfvars
and fill in the required variables.cp terraform.tfvars.template terraform.tfvars
-
Initialize Terraform:
terraform init
-
Plan the deployment:
terraform plan
-
Apply the deployment:
terraform apply
-
Destroy the deployment:
terraform destroy
main.tf
: Main Terraform configuration file.outputs.tf
: Defines the outputs of the Terraform configuration.variables.tf
: Defines the variables used in the Terraform configuration.versions.tf
: Specifies the required Terraform version and provider versions.terraform.tfvars.template
: Template for user-specific variables..github/workflows/
: Contains GitHub Actions workflows for CI/CD.documentation.yml
: Workflow for generating documentation.tfsec.yml
: Workflow for running TFsec security scans.
scripts/startup.sh
: Script for initial setup and configuration.
This project is licensed under the MIT License. See the LICENSE file for details.
Name | Version |
---|---|
terraform | >=1.3 |
oci | 5.45.0 |
Name | Version |
---|---|
oci | 5.45.0 |
No modules.
Name | Type |
---|---|
oci_core_default_route_table.default_route_table | resource |
oci_core_instance.instance | resource |
oci_core_internet_gateway.internet_gateway | resource |
oci_core_public_ip.public_ip | resource |
oci_core_security_list.security_list | resource |
oci_core_subnet.subnet | resource |
oci_core_vcn.vcn | resource |
oci_core_volume.docker_volume | resource |
oci_core_volume_attachment.docker_volume_attachment | resource |
oci_core_volume_backup_policy.docker_volume_backup_policy | resource |
oci_core_volume_backup_policy_assignment.docker_volume_backup_policy_assignment | resource |
oci_core_private_ips.instance_private_ip | data source |
oci_core_vnic.instance_vnic | data source |
oci_core_vnic_attachments.instance_vnics | data source |
oci_identity_availability_domain.ad | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
additional_ssh_public_key | Additional public key to use for SSH access example: < /home/ubuntu/.ssh/authorized_keys ssh-rsa AAAAB3NzaC1yc2EAA EOF | string |
"" |
no |
availability_domain_number | The availability domain number | number |
1 |
no |
compartment_ocid | The OCID of the compartment | string |
n/a | yes |
fault_domain | The fault domain to deploy to | string |
"FAULT-DOMAIN-2" |
no |
instance_display_name | The display name of the instance | string |
"DockerHost" |
no |
instance_image_ocid | The OCID of the image to use for the instance | map(any) |
{ |
no |
instance_shape | The shape of the instance | string |
"VM.Standard.A1.Flex" |
no |
instance_shape_boot_volume_size_in_gbs | The size of the boot volume in GBs | string |
"50" |
no |
instance_shape_config_memory_in_gbs | The amount of memory in GBs for the instance | string |
"24" |
no |
instance_shape_config_ocpus | The number of OCPUs for the instance | string |
"4" |
no |
instance_shape_docker_volume_size_in_gbs | The size of the docker volume in GBs | string |
"150" |
no |
oracle_api_key_fingerprint | The fingerprint of the public key | string |
n/a | yes |
oracle_api_private_key_path | The path to the private key | string |
"~/.oci/oci_api_key.pem" |
no |
region | The region to deploy to | string |
"eu-milan-1" |
no |
ssh_public_key | The public key to use for SSH access | string |
n/a | yes |
tenancy_ocid | The OCID of the tenancy | string |
n/a | yes |
user_ocid | The OCID of the user to use for authentication | string |
n/a | yes |
vcn_cidr_block | The CIDR block for the VCN | string |
"10.1.0.0/16" |
no |
Name | Description |
---|---|
instance_id | The OCID of the instance |
private_ip | The private IP of the instance |
public_ip | The public IP of the instance |