-
Notifications
You must be signed in to change notification settings - Fork 7
Ds terraform intel gcm linux tdx vm #44
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
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
eeb93e7
Enabled Intel Confidential Compute vm TDX example
daveshrestha-intel c498ca9
Completed Intel TDX VM example and updated main and readme
daveshrestha-intel 3feef1f
fixed issues discovered in PR request
daveshrestha-intel 21def36
deleted local]example copy of versions.tf as it's not needed
daveshrestha-intel e8afbcc
updated version.tf on root
daveshrestha-intel 2881467
terraform-docs: automated action
github-actions[bot] e4fe9a0
Merge branch 'main' into ds-terraform-intel-gcm-linux-tdx-vm
kevinbleckmann 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<p align="center"> | ||
<img src="https://github.com/intel/terraform-intel-gcp-vm/blob/main/images/logo-classicblue-800px.png?raw=true" alt="Intel Logo" width="250"/> | ||
</p> | ||
|
||
# Intel Cloud Optimization Modules for Terraform | ||
|
||
© Copyright 2023, Intel Corporation | ||
|
||
## Intel GCP VM on default network | ||
|
||
This module creates a Intel Confiddential Compute Linux VM on the default network with Intel Xeon 4th Generation Scalable processors (code-named Sapphire Rapids) VM with Confidential Computing and Intel Trust Domain Extension (Intel TDX) technology. | ||
|
||
Update the project with a your project id in GCP. It is located on the variables.tf file under this example folder for "GCP-Linux-VM" | ||
|
||
## Usage | ||
|
||
**See examples folder for complete examples.** | ||
|
||
variables.tf | ||
|
||
```hcl | ||
variable "project" { | ||
type = string | ||
description = "The ID of the project in which the resource resides." | ||
} | ||
``` | ||
|
||
main.tf | ||
```hcl | ||
# You will need to provide value of the variable project, which is your GCP project id when you do terraform apply | ||
|
||
module "linux_vm" { | ||
source = "intel/gcp-vm/intel" | ||
project = var.project | ||
name = "intel-tdx-linux01" | ||
|
||
#required for Intel Confidential Compute VM with TDX | ||
enable_confidential_compute = var.enable_confidential_compute | ||
confidential_instance_type = var.confidential_instance_type | ||
on_host_maintenance = "TERMINATE" | ||
|
||
access_config = [{ | ||
nat_ip = null | ||
public_ptr_domain_name = null | ||
network_tier = "PREMIUM" | ||
}, ] | ||
} | ||
``` | ||
|
||
|
||
|
||
Run Terraform | ||
|
||
```hcl | ||
terraform init | ||
terraform plan | ||
terraform apply -var="project=<your_your_gcp_project_id>" | ||
``` | ||
|
||
## Considerations | ||
Add additional considerations here: | ||
- The GCP zone can be updated in the providers.tf file under this example folder for "GCP-Linux-VM" | ||
- Update the project with a your project id in GCP. It is located on the variables.tf file under this example folder for "GCP-Linux-VM" | ||
- The VM is created using the default network in the GCP zone configured in the providers.tf file. Please make sure you have a default network in the GCP zone of your choice |
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,26 @@ | ||
# -------------------------------------------------------- | ||
# _ _ _ | ||
# (_) | | | | | ||
# _ _ __ | |_ ___| | | ||
# | | '_ \| __/ _ \ | | ||
# | | | | | || __/ | | ||
# |_|_| |_|\__\___|_| | ||
# -------------------------------------------------------- | ||
# Provision GCP virtual machine on Intel Xeon 4th Generation Scalable processors (code-named Sapphire Rapids) VM which supports Confidential Computing with Intel Trust Domain Extension (Intel TDX) technology | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 5th Generation Emerald Rapids |
||
# You will need to provide value of the variable project, which is your GCP project id when you do terraform apply | ||
module "linux_vm" { | ||
source = "intel/gcp-vm/intel" | ||
project = var.project | ||
name = "intel-tdx-linux01" | ||
|
||
#required for Intel Confidential Compute VM with TDX | ||
enable_confidential_compute = var.enable_confidential_compute | ||
confidential_instance_type = var.confidential_instance_type | ||
on_host_maintenance = "TERMINATE" | ||
|
||
access_config = [{ | ||
nat_ip = null | ||
public_ptr_domain_name = null | ||
network_tier = "PREMIUM" | ||
}, ] | ||
} |
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,62 @@ | ||
output "cpu_platform" { | ||
value = module.linux_vm.cpu_platform | ||
description = "The CPU platform of the VM instance" | ||
} | ||
|
||
output "current_status" { | ||
value = module.linux_vm.current_status | ||
description = "Current status of the VM instance" | ||
} | ||
|
||
output "id" { | ||
value = module.linux_vm.id | ||
description = "An identifier for the resource" | ||
} | ||
|
||
output "instance_id" { | ||
value = module.linux_vm.instance_id | ||
description = "The server-assigned unique identifier of this instance" | ||
} | ||
|
||
output "machine_type" { | ||
value = module.linux_vm.machine_type | ||
description = "Type of the machine created" | ||
} | ||
|
||
output "min_cpu_platform" { | ||
value = module.linux_vm.min_cpu_platform | ||
description = "Minimum CPU platform for the VM instance" | ||
} | ||
|
||
output "name" { | ||
value = module.linux_vm.name | ||
description = "Unique name of the instance created" | ||
} | ||
|
||
output "self_link" { | ||
value = module.linux_vm.self_link | ||
description = "The URI of the created resource" | ||
} | ||
|
||
output "boot_disk_size" { | ||
value = module.linux_vm.boot_disk_size | ||
description = "Size of the boot disk of the instance" | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
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,3 @@ | ||
provider "google" { | ||
zone = "us-central1-a" | ||
} |
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,17 @@ | ||
variable "project" { | ||
type = string | ||
description = "The ID of the project in which the resource resides." | ||
} | ||
|
||
#required for Intel Confidential Compute VM with TDX | ||
variable "enable_confidential_compute" { | ||
description = "Enable confidential computing" | ||
type = bool | ||
default = true | ||
} | ||
|
||
variable "confidential_instance_type" { | ||
description = "Type of confidential instance" | ||
type = string | ||
default = "TDX" | ||
} |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intel® Optimized Cloud Modules for Terraform