Skip to content

Commit cbcb47d

Browse files
hanwen-clusterhanwen-pcluste
authored andcommitted
Regenerate external-slurmdbd.json
This file is automatically generated from `cdk synth --no-version-reporting` Signed-off-by: Hanwen <hanwenli@amazon.com>
1 parent d455bdd commit cbcb47d

File tree

1 file changed

+66
-46
lines changed

1 file changed

+66
-46
lines changed

cloudformation/external-slurmdbd/external-slurmdbd.json

Lines changed: 66 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,17 @@
174174
"Fn::Join": [
175175
"-",
176176
[
177-
"/aws/parallelcluster/external-slurmdbd/ExternalSlurmdbdStack",
177+
{
178+
"Fn::Join": [
179+
"",
180+
[
181+
"/aws/parallelcluster/external-slurmdbd/",
182+
{
183+
"Ref": "AWS::StackName"
184+
}
185+
]
186+
]
187+
},
178188
{
179189
"Fn::Select": [
180190
4,
@@ -212,7 +222,17 @@
212222
"ExternalSlurmdbdS3Bucket": {
213223
"Type": "AWS::S3::Bucket",
214224
"Properties": {
215-
"BucketName": "externalslurmdbdstack-430789882085f1c9",
225+
"BucketName": {
226+
"Fn::Join": [
227+
"",
228+
[
229+
{
230+
"Ref": "AWS::StackName"
231+
},
232+
"-cf55004ab3dc0560"
233+
]
234+
]
235+
},
216236
"PublicAccessBlockConfiguration": {
217237
"BlockPublicAcls": true,
218238
"BlockPublicPolicy": true,
@@ -291,11 +311,22 @@
291311
"Sid": "CloudWatchLogsPolicy"
292312
},
293313
{
294-
"Action": [
295-
"ec2:AssignPrivateIpAddresses",
296-
"ec2:DescribeInstances",
297-
"ec2:DescribeNetworkInterfaces"
298-
],
314+
"Action": "ec2:AssignPrivateIpAddresses",
315+
"Condition": {
316+
"StringLike": {
317+
"ec2:Subnet": {
318+
"Fn::Join": [
319+
"",
320+
[
321+
"*",
322+
{
323+
"Ref": "SubnetId"
324+
}
325+
]
326+
]
327+
}
328+
}
329+
},
299330
"Effect": "Allow",
300331
"Resource": "*",
301332
"Sid": "IPAssignmentPolicy"
@@ -405,12 +436,14 @@
405436
"UserData": {
406437
"Fn::Base64": {
407438
"Fn::Sub": [
408-
"Content-Type: multipart/mixed; boundary=\"==BOUNDARY==\"\nMIME-Version: 1.0\n\n--==BOUNDARY==\nContent-Type: text/cloud-config; charset=us-ascii\nMIME-Version: 1.0\n\npackage_update: false\npackage_upgrade: false\nrepo_upgrade: none\ndatasource_list: [ Ec2, None ]\n\n--==BOUNDARY==\nContent-Type: text/x-shellscript; charset=\"us-ascii\"\nMIME-Version: 1.0\n#!/bin/bash -x\n\nfunction vendor_cookbook\n{\n mkdir /tmp/cookbooks\n cd /tmp/cookbooks\n tar -xzf /etc/chef/aws-parallelcluster-cookbook.tgz\n HOME_BAK=\"${!HOME}\"\n export HOME=\"/tmp\"\n for d in /tmp/cookbooks/*; do\n cd \"$d\" || continue\n LANG=en_US.UTF-8 /opt/cinc/embedded/bin/berks vendor /etc/chef/cookbooks --delete\n done;\n export HOME=\"${!HOME_BAK}\"\n}\n\nfunction wait_for_private_ip_assignment\n{\n rc=1\n retries=10\n retry=1\n sleeptime=1\n while [ \\( $rc -eq 1 \\) -a \\( $retry -le $retries \\) ]; do\n aws ec2 describe-network-interfaces --network-interface-ids \"${!ENI_ID}\" --region \"${AWS::Region}\" | jq .NetworkInterfaces[0].PrivateIpAddresses | grep -q '\"PrivateIpAddress\": \"${PrivateIp}\"'\n rc=$?\n retry=$((retry+1))\n sleep $sleeptime\n done\n return $rc\n}\n\nTOKEN=`curl -X PUT \"http://169.254.169.254/latest/api/token\" -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\"`\nINSTANCE_ID=$(curl -H \"X-aws-ec2-metadata-token: $TOKEN\" -v http://169.254.169.254/latest/meta-data/instance-id)\nENI_ID=$(aws ec2 describe-instances --instance-ids ${!INSTANCE_ID} --region \"${AWS::Region}\" | jq .Reservations[0].Instances[0].NetworkInterfaces[0].NetworkInterfaceId | tr -d '\"')\n\naws ec2 assign-private-ip-addresses --region \"${AWS::Region}\" --network-interface-id \"${!ENI_ID}\" --private-ip-addresses ${PrivateIp} --allow-reassignment\n\nwait_for_private_ip_assignment || echo \"Assignment of private IP ${PrivateIp} was not successful.\"\n\nip addr add ${PrivateIp}/${SubnetPrefix} dev eth0\n\nif [ \"${CustomCookbookUrl}\" != \"NONE\" ]; then\n curl --retry 3 -v -L -o /etc/chef/aws-parallelcluster-cookbook.tgz ${CustomCookbookUrl}\n vendor_cookbook\nfi\n\n# This is necessary to find the cfn-init application\nexport PATH=/opt/aws/bin:${!PATH}\n[ -f /etc/profile.d/pcluster.sh ] && . /etc/profile.d/pcluster.sh\n\ncfn-init -s ${AWS::StackName} -v -c default -r LaunchTemplate --region \"${AWS::Region}\"\n",
439+
"Content-Type: multipart/mixed; boundary=\"==BOUNDARY==\"\nMIME-Version: 1.0\n\n--==BOUNDARY==\nContent-Type: text/cloud-config; charset=us-ascii\nMIME-Version: 1.0\n\npackage_update: false\npackage_upgrade: false\nrepo_upgrade: none\ndatasource_list: [ Ec2, None ]\n\n--==BOUNDARY==\nContent-Type: text/x-shellscript; charset=\"us-ascii\"\nMIME-Version: 1.0\n#!/bin/bash -x\n\nfunction vendor_cookbook\n{\n mkdir /tmp/cookbooks\n cd /tmp/cookbooks\n tar -xzf /etc/chef/aws-parallelcluster-cookbook.tgz\n HOME_BAK=\"${!HOME}\"\n export HOME=\"/tmp\"\n for d in /tmp/cookbooks/*; do\n cd \"$d\" || continue\n LANG=en_US.UTF-8 /opt/cinc/embedded/bin/berks vendor /etc/chef/cookbooks --delete\n done;\n export HOME=\"${!HOME_BAK}\"\n}\n\nfunction wait_for_private_ip_assignment\n{\n rc=1\n retries=10\n retry=1\n sleeptime=1\n while [ \\( $rc -eq 1 \\) -a \\( $retry -le $retries \\) ]; do\n number_of_ips=$(curl -H \"X-aws-ec2-metadata-token: $TOKEN\" -v http://169.254.169.254/latest/meta-data/network/interfaces/macs/\"$MAC\"/local-ipv4s | wc -l)\n ((number_of_ips>0))\n rc=$?\n retry=$((retry+1))\n sleep $sleeptime\n done\n return $rc\n}\n\nTOKEN=`curl -X PUT \"http://169.254.169.254/latest/api/token\" -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\"`\nMAC=$(curl -H \"X-aws-ec2-metadata-token: $TOKEN\" -v http://169.254.169.254/latest/meta-data/mac)\nENI_ID=$(curl -H \"X-aws-ec2-metadata-token: $TOKEN\" -v http://169.254.169.254/latest/meta-data/network/interfaces/macs/\"$MAC\"/interface-id)\n\naws ec2 assign-private-ip-addresses --region \"${AWS::Region}\" --network-interface-id \"${!ENI_ID}\" --private-ip-addresses ${PrivateIp} --allow-reassignment\n\nwait_for_private_ip_assignment || echo \"Assignment of private IP ${PrivateIp} was not successful.\"\n\nip addr add ${PrivateIp}/${SubnetPrefix} dev eth0\n\nif [ \"${CustomCookbookUrl}\" != \"NONE\" ]; then\n curl --retry 3 -v -L -o /etc/chef/aws-parallelcluster-cookbook.tgz ${CustomCookbookUrl}\n vendor_cookbook\nfi\n\n# This is necessary to find the cfn-init application\nexport PATH=/opt/aws/bin:${!PATH}\n[ -f /etc/profile.d/pcluster.sh ] && . /etc/profile.d/pcluster.sh\n\ncfn-init -s ${AWS::StackName} -v -c default -r LaunchTemplate --region \"${AWS::Region}\"\n",
409440
{
410441
"CustomCookbookUrl": {
411442
"Ref": "CustomCookbookUrl"
412443
},
413-
"StackName": "ExternalSlurmdbdStack",
444+
"StackName": {
445+
"Ref": "AWS::StackName"
446+
},
414447
"Region": {
415448
"Ref": "AWS::Region"
416449
},
@@ -431,8 +464,7 @@
431464
"AWS::CloudFormation::Init": {
432465
"configSets": {
433466
"default": [
434-
"setup",
435-
"configure"
467+
"setup"
436468
]
437469
},
438470
"setup": {
@@ -470,15 +502,23 @@
470502
{
471503
"Ref": "MungeKeySecretArn"
472504
},
473-
"\", \"region\": \"",
505+
"\", \"slurmdbd_conf_bucket\": \"",
506+
{
507+
"Ref": "AWS::StackName"
508+
},
509+
"-cf55004ab3dc0560\", \"cluster\": {\"region\": \"",
474510
{
475511
"Ref": "AWS::Region"
476512
},
477513
"\", \"log_group_name\": \"",
478514
{
479515
"Ref": "SlurmdbdLogGroup7510BC34"
480516
},
481-
"\", \"stack_name\": \"ExternalSlurmdbdStack\", \"is_external_slurmdbd\": true, \"slurmdbd_conf_bucket\": \"externalslurmdbdstack-430789882085f1c9\"}"
517+
"\", \"stack_name\": \"",
518+
{
519+
"Ref": "AWS::StackName"
520+
},
521+
"\", \"node_type\": \"ExternalSlurmDbd\"}}"
482522
]
483523
]
484524
},
@@ -493,36 +533,6 @@
493533
"cwd": "/etc/chef"
494534
}
495535
}
496-
},
497-
"configure": {
498-
"files": {
499-
"/etc/cfn/hooks.d/cfn-auto-reloader.conf": {
500-
"content": {
501-
"Fn::Sub": "[cfn-auto-reloader-hook]\ntriggers=post.update\npath=Resources.LaunchTemplate.Metadata.AWS::CloudFormation::Init\naction=/usr/bin/echo 'I was triggered by a change in AWS::CloudFormation::Init metadata!' > /tmp/cfn_init_metadata_update.log\nrunas=root\n"
502-
},
503-
"mode": "000400",
504-
"owner": "root",
505-
"group": "root"
506-
},
507-
"/etc/cfn/cfn-hup.conf": {
508-
"content": {
509-
"Fn::Sub": [
510-
"[main]\nstack=${StackId}\nregion=${Region}\ninterval=2\n",
511-
{
512-
"StackId": {
513-
"Ref": "AWS::StackId"
514-
},
515-
"Region": {
516-
"Ref": "AWS::Region"
517-
}
518-
}
519-
]
520-
},
521-
"mode": "000400",
522-
"owner": "root",
523-
"group": "root"
524-
}
525-
}
526536
}
527537
}
528538
}
@@ -568,21 +578,31 @@
568578
"Ref": "SlurmdbdPort"
569579
}
570580
},
571-
"AccountingClientSg": {
581+
"AccountingClientSecurityGroup": {
572582
"Description": "Security Group ID that allows traffic from the slurmctld to slurmdbd",
573583
"Value": {
574584
"Ref": "SlurmdbdClientSecurityGroup"
575585
}
576586
},
577-
"SshClientSg": {
587+
"SshClientSecurityGroup": {
578588
"Description": "Security Group ID that allows SSH traffic from the HeadNode to slurmdbd instance",
579589
"Value": {
580590
"Ref": "SSHClientSecurityGroup"
581591
}
582592
},
583593
"SlurmdbdConfigS3BucketName": {
584594
"Description": "S3 Bucket where a copy of the slurmdbd configuration files can be stored and re-used when re-provisioning the slurmdbd instance",
585-
"Value": "externalslurmdbdstack-430789882085f1c9"
595+
"Value": {
596+
"Fn::Join": [
597+
"",
598+
[
599+
{
600+
"Ref": "AWS::StackName"
601+
},
602+
"-cf55004ab3dc0560"
603+
]
604+
]
605+
}
586606
}
587607
}
588608
}

0 commit comments

Comments
 (0)