-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- var.public_ip and var.public_ip_display_name are added to control this new feature - var.public_ip accept a string with value NONE, RESERVED or EPHEMERAL. each keyword does what it says. - var.assign_public_ip becomes deprecated - rename terraform resources from <this> to more meaningful name fix #55
- Loading branch information
Showing
16 changed files
with
426 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Creating Compute Instances using Flex shape | ||
|
||
This example illustrates how to use this module to creates compute instances with a reserved public IP. | ||
|
||
One modules will be configured: | ||
|
||
- 1 instance (1 OCPU, 1GB RAM) with a reserved public IP associated with the Primary IP of the primary VNIC. | ||
|
||
## Prerequisites | ||
|
||
You will need to collect the following information before you start: | ||
|
||
1. your OCI provider authentication values | ||
2. a compartment OCID in which the instances will be created | ||
3. a source OCID to deploy the instance, usually an image ocid from [OCI Platform Images list] | ||
4. a subnet OCID to which the instance's primary VNICs will be attached | ||
|
||
For detailed instructions, see [docs/prerequisites.adoc] | ||
|
||
## Using this example with Terraform cli | ||
|
||
Prepare one [Terraform Variable Definition file] named `terraform.tfvars` with the required authentication information. | ||
|
||
*TIP: You can rename and configure `terraform.tfvars.example` from this example's folder.* | ||
|
||
Then apply the example using the following commands: | ||
|
||
```shell | ||
> terraform init | ||
> terraform plan | ||
> terraform apply | ||
``` | ||
|
||
See [Provisioning Infrastructure with Terraform] for more details about Terraform CLI and the available subcommands. | ||
|
||
[Terraform Variable Definition file]:https://www.terraform.io/docs/language/values/variables.html#variable-definitions-tfvars-files | ||
[docs/prerequisites.adoc]:https://github.com/oracle-terraform-modules/terraform-oci-compute-instance/blob/main/docs/prerequisites.adoc | ||
[Provisioning Infrastructure with Terraform]:https://www.terraform.io/docs/cli/run/index.html | ||
[OCI Platform Images list]:https://docs.oracle.com/en-us/iaas/images/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Copyright (c) 2018, 2021 Oracle and/or its affiliates. | ||
|
||
terraform { | ||
required_version = ">= 0.13" // terraform version below 0.12 is not tested/supported with this module | ||
required_providers { | ||
oci = { | ||
version = ">= 4.0.0" // force downloading oci-provider compatible with terraform v0.12 | ||
} | ||
} | ||
} | ||
|
||
provider "oci" { | ||
tenancy_ocid = var.tenancy_ocid | ||
user_ocid = var.user_ocid | ||
fingerprint = var.fingerprint | ||
private_key_path = var.private_key_path | ||
region = var.region | ||
} | ||
|
||
# # * This module will create 1 Flex Compute Instances, with a reserved public IP | ||
module "instance_reserved_ip" { | ||
source = "oracle-terraform-modules/compute-instance/oci" | ||
# general oci parameters | ||
compartment_ocid = var.compartment_ocid | ||
freeform_tags = var.freeform_tags | ||
defined_tags = var.defined_tags | ||
# compute instance parameters | ||
ad_number = null | ||
instance_count = 1 | ||
instance_display_name = "instance_reserved_ip" | ||
shape = var.shape | ||
source_ocid = var.source_ocid | ||
source_type = var.source_type | ||
instance_flex_memory_in_gbs = 1 # only used if shape is Flex type | ||
instance_flex_ocpus = 1 # only used if shape is Flex type | ||
# operating system parameters | ||
ssh_authorized_keys = var.ssh_authorized_keys | ||
# networking parameters | ||
public_ip = var.public_ip # NONE, RESERVED or EPHEMERAL | ||
subnet_ocids = var.subnet_ocids | ||
# storage parameters | ||
block_storage_sizes_in_gbs = [] # no block volume will be created | ||
preserve_boot_volume = false | ||
} | ||
|
||
output "instance_reserved_ip" { | ||
description = "IP information of the instances provisioned by this module." | ||
value = module.instance_reserved_ip.instances_summary | ||
} |
Oops, something went wrong.