Skip to content

Commit 1fd87a7

Browse files
authored
Merge pull request #791 from maherthomsi/integration-test
Add EBS CSI driver policy to nodegroup IAM role in integration tests
2 parents 874e4ea + 74743a0 commit 1fd87a7

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

integ/src/nodegroup_provider.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ const EKS_CNI_ARN: &str = "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy";
4646
const EC2_CONTAINER_REGISTRY_ARN: &str =
4747
"arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly";
4848
const SSM_MANAGED_INSTANCE_CORE_ARN: &str = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore";
49+
const EBS_CSI_DRIVER_POLICY_ARN: &str =
50+
"arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy";
4951
const EKS_ROLE_POLICY_DOCUMENT_CN: &str = "ec2.amazonaws.com.cn";
5052
const EKS_ROLE_POLICY_DOCUMENT: &str = "ec2.amazonaws.com";
5153
const CHINA_REGION_PREFIX: &str = "cn-";
@@ -304,6 +306,13 @@ async fn create_iam_instance_profile(
304306
.send()
305307
.await
306308
.context("Unable to attach AmazonEC2ContainerRegistry policy")?;
309+
iam_client
310+
.attach_role_policy()
311+
.role_name(iam_instance_profile_name.clone())
312+
.policy_arn(EBS_CSI_DRIVER_POLICY_ARN)
313+
.send()
314+
.await
315+
.context("Unable to attach AmazonEBSCSIDriver policy")?;
307316
iam_client
308317
.create_instance_profile()
309318
.instance_profile_name(iam_instance_profile_name.clone())

0 commit comments

Comments
 (0)