Skip to content

Commit

Permalink
integration-test: enforce IMDSv2 calls when launching instances
Browse files Browse the repository at this point in the history
  • Loading branch information
gthao313 committed Jan 30, 2023
1 parent 64704db commit 19c778d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion integ/src/nodegroup_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ use aws_sdk_eks::model::IpFamily;
use aws_config::meta::region::RegionProviderChain;
use aws_sdk_ec2::error::DescribeLaunchTemplatesError;
use aws_sdk_ec2::model::{
ArchitectureValues, InstanceType, LaunchTemplateTagSpecificationRequest,
ArchitectureValues, InstanceType, LaunchTemplateHttpTokensState,
LaunchTemplateInstanceMetadataOptionsRequest, LaunchTemplateTagSpecificationRequest,
RequestLaunchTemplateData, ResourceType, Tag,
};

Expand Down Expand Up @@ -205,6 +206,11 @@ async fn create_launch_template(
cluster.dns_ip_info.clone(),
)?)
.tag_specifications(tag_specifications(&cluster.name))
.metadata_options(
LaunchTemplateInstanceMetadataOptionsRequest::builder()
.http_tokens(LaunchTemplateHttpTokensState::Required)
.build(),
)
.build(),
)
.send()
Expand Down

0 comments on commit 19c778d

Please sign in to comment.