-
Notifications
You must be signed in to change notification settings - Fork 69
add reserved public ip #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kral2
merged 4 commits into
oracle-terraform-modules:main
from
kral2:55_add_reserved_public_ip
Sep 20, 2021
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 | ||
kral2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.