terraform-oci-ampere-a1-netmaker
所属分类:ASP/.NET编程
开发工具:HCL
文件大小:0KB
下载次数:0
上传日期:2023-11-27 18:50:24
上 传 者:
sh-1993
说明: 地形oci安培a1制网器
(terraform oci ampere a1 netmaker)
文件列表:
LICENSE (11357, 2023-11-27)
availability_domain.tf (275, 2023-11-27)
main.tf (644, 2023-11-27)
metadata.tf (384, 2023-11-27)
network.tf (1356, 2023-11-27)
output.tf (399, 2023-11-27)
provider.tf (354, 2023-11-27)
region.tf (328, 2023-11-27)
security.tf (976, 2023-11-27)
templates/ (0, 2023-11-27)
templates/cloud-init.yaml.tpl (599, 2023-11-27)
ubuntu2004.tf (717, 2023-11-27)
variables.tf (1423, 2023-11-27)
virtual_machine.tf (954, 2023-11-27)
![Ampere Computing](https://avatars2.githubusercontent.com/u/34519842?s=400&u=1d29afaac44f477cbb0226139ec83f73faefe154&v=4)
This repo will be archived in 30 days from 11/27. This is in an effort to keep a clean and timely Github presence for Ampere computing. As a result of the archiving any issues, pull requests, code, labels, milestones, projects, wiki, releases, commits, tags, branches, reactions, code scanning alerts, comments and permissions become read-only.
Please plan accordingly or reach out to repo owner with concerns.
Thank you.
-Ampere Computing
# terraform-oci-ampere-a1-netmaker
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
## Description
Terraform code to launch a Ampere A1 Shape on Oracle Cloud Infrastructure (OCI) Free-Tier running [NetMaker](https://github.com/gravitl/netmaker).
## Requirements
* [Terraform](https://www.terraform.io/downloads.html)
* [Oracle OCI "Always Free" Account](https://www.oracle.com/cloud/free/#always-free)
## What exactly is Terraform doing
The goal of this code is to supply the minimal ammount of information to quickly have working Ampere A1 instances on OCI ["Always Free"](https://www.oracle.com/cloud/free/#always-free).
This instance is confured with metadata to install required software, configure itself, and launch a running instance of [NetMaker](https://github.com/gravitl/netmaker).
To keep things simple, The root compartment will be used (compartment id and tenancy id are the same) when launching the instance.
Addtional tasks performed by this code:
* Dynamically creating sshkeys to use when logging into the instance.
* Dynamically getting region, availability zone and image id..
* Creating necessary core networking configurations for the tenancy
* Rendering metadata to pass into the Ampere A1 instance to launch NetMaker via docker-compose
* Launch Ampere A1 instance with metadata and ssh keys.
* Output IP information to connect to the instance.
To get started clone this repository from GitHub locally.
## Configuration with terraform.tfvars
The easiest way to configure is to use a terraform.tfvars in the project directory.
Please note that Compartment OCID are the same as Tenancy OCID for Root Compartment.
The following is an example of what terraform.tfvars should look like:
```
tenancy_ocid = "ocid1.tenancy.oc1..aaaaaaaabcdefghijklmnopqrstuvwxyz1234567890abcdefghijklmnopq"
user_ocid = "ocid1.user.oc1..aaaaaaaabcdefghijklmnopqrstuvwxyz0987654321zyxwvustqrponmlkj"
fingerprint = "a1:01:b2:02:c3:03:e4:04:10:11:12:13:14:15:16:17"
```
### Using as a Module
This can also be used as a terraform module. The following is example code for module usage:
```
variable "tenancy_ocid" {}
variable "user_ocid" {}
variable "fingerprint" {}
variable "private_key_path" {}
module "oci-ampere-netmaker" {
source = "github.com/amperecomputing/terraform-oci-ampere-netmaker"
tenancy_ocid = var.tenancy_ocid
user_ocid = var.user_ocid
fingerprint = var.fingerprint
private_key_path = var.private_key_path
# Optional
# oci_vcn_cidr_block = "10.2.0.0/16"
# oci_vcn_cidr_subnet = "10.2.1.0/24"
# instance_prefix = "oci-a1-netmaker"
# oci_vm_count = "1"
# ampere_a1_vm_memory = "24"
# ampere_a1_cpu_core_count = "4"
}
output "oci_ampere_a1_private_ips" {
value = module.oci-ampere-a1.AmpereA1_PrivateIPs
}
output "oci_ampere_a1_public_ips" {
value = module.oci-ampere-a1.AmpereA1_PublicIPs
}
```
### Running Terraform
```
terraform init && terraform plan && terraform apply -auto-approve
```
## References
* [https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm)
* [Where to Get the Tenancy's OCID and User's OCID](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five)
* [API Key Authentication](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm#APIKeyAuth)
* [Instance Principal Authorization](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm#instancePrincipalAuth)
* [Security Token Authentication](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/terraformproviderconfiguration.htm#securityTokenAuth)
* [How to Generate an API Signing Key](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#two)
* [Bootstrapping a VM image in Oracle Cloud Infrastructure using Cloud-Init](https://martincarstenbach.wordpress.com/2018/11/30/bootstrapping-a-vm-image-in-oracle-cloud-infrastructure-using-cloud-init/)
* [Oracle makes building applications on Ampere A1 Compute instances easy](https://blogs.oracle.com/cloud-infrastructure/post/oracle-makes-building-applications-on-ampere-a1-compute-instances-easy?source=:ow:o:p:nav:062520CloudComputeBC)
* [scross01/oci-linux-instance-cloud-init.tf](https://gist.github.com/scross01/5a66207fdc731dd99869a91461e9e2b8)
* [scross01/autonomous_linux_7.7.tf](https://gist.github.com/scross01/bcd21c12b15787f3ae9d51d0d9b2df06)
* [Oracle Cloud Always Free](https://www.oracle.com/cloud/free/#always-free)
* [OCI Terraform Level 200](https://www.oracle.com/a/ocom/docs/terraform-200.pdf)
* [Netmaker](https://github.com/gravitl/netmaker)
近期下载者:
相关文件:
收藏者: