Skip to content

Commit ee246ae

Browse files
authored
Merge pull request os-autoinst#25031 from grisu48/nitro
Add capability to enable Nitro Enclave
2 parents f99b04e + a84f6b2 commit ee246ae

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

data/publiccloud/terraform/ec2.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ variable "ssh_public_key" {
8888
default = "/root/.ssh/id_ed25519.pub"
8989
}
9090

91+
variable "nitro_enclave" {
92+
default = false
93+
}
94+
9195
data "aws_iam_instance_profile" "ec2_cloudwatch" {
9296
name = "OpenQAEC2CloudWatchLogsRole"
9397
}
@@ -139,6 +143,11 @@ resource "aws_instance" "openqa" {
139143
}
140144
}
141145

146+
# AWS Nitro Enclave
147+
enclave_options {
148+
enabled = var.nitro_enclave
149+
}
150+
142151
user_data = var.cloud_init != "" ? file(var.cloud_init) : null
143152
}
144153

lib/publiccloud/provider.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ sub terraform_apply {
515515
$vars{vpc_security_group_ids} = script_output("aws ec2 describe-security-groups --region '" . $self->provider_client->region . "' --filters 'Name=group-name,Values=tf-sg' --query 'SecurityGroups[0].GroupId' --output text");
516516
$vars{subnet_id} = script_output("aws ec2 describe-subnets --region '" . $self->provider_client->region . "' --filters 'Name=tag:Name,Values=tf-subnet' 'Name=availabilityZone,Values=" . $vars{availability_zone} . "' --query 'Subnets[0].SubnetId' --output text");
517517
$vars{ipv6_address_count} = get_var('PUBLIC_CLOUD_EC2_IPV6_ADDRESS_COUNT', 0);
518+
$vars{nitro_enclave} = "true" if check_var("PUBLIC_CLOUD_EC2_NITRO_ENCLAVE", "1");
518519
} elsif (is_azure) {
519520
my $subnet_id = script_output("az network vnet subnet list -g 'tf-" . $self->provider_client->region . "-rg' --vnet-name 'tf-network' --query '[0].id' --output 'tsv'");
520521
$vars{subnet_id} = $subnet_id if ($subnet_id);

variables.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ PUBLIC_CLOUD_EC2_ACCOUNT_ID | string | `aws sts get-caller-identity --query "Acc
332332
PUBLIC_CLOUD_EC2_UPLOAD_AMI | string | "" | Needed to decide which image will be used for helper VM for upload some image. When not specified some predefined value will be used. Overwrite the value for `ec2uploadimg --ec2-ami`.
333333
PUBLIC_CLOUD_EC2_UPLOAD_SECGROUP | string | "" | Allow to instruct ec2uploadimg script to use some existing security group instead of creating new one. If given, the parameter `--security-group-ids` is passed to `ec2uploadimg`.
334334
PUBLIC_CLOUD_EC2_UPLOAD_VPCSUBNET | string | "" | Allow to instruct ec2uploadimg script to use some existing VPC instead of creating new one.
335+
PUBLIC_CLOUD_EC2_NITRO_ENCLAVE | boolean | false | Enable the AWS Nitro Enclave for this instance.
335336
PUBLIC_CLOUD_EMBARGOED_UPDATES_DETECTED | boolean | true | Internal variable written by the code and readed by the code . Should NOT be set manually
336337
PUBLIC_CLOUD_FORCE_REGISTRATION | boolean | false | If set, tests/publiccloud/registration.pm will register cloud guest
337338
PUBLIC_CLOUD_GCE_STACK_TYPE | string | IPV4_ONLY | Network stack type, possible values: IPV4_IPV6 or IPV4_ONLY

0 commit comments

Comments
 (0)