-
Notifications
You must be signed in to change notification settings - Fork 6
Add cloud formation script #258
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
base: main
Are you sure you want to change the base?
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Management-Utilities/ec2-user-data-iscsi-create-and-mount/EC2-cloud_formation.yaml
Outdated
Show resolved
Hide resolved
Management-Utilities/ec2-user-data-iscsi-create-and-mount/EC2-cloud_formation.yaml
Outdated
Show resolved
Hide resolved
Management-Utilities/ec2-user-data-iscsi-create-and-mount/EC2-cloud_formation.yaml
Outdated
Show resolved
Hide resolved
Management-Utilities/ec2-user-data-iscsi-create-and-mount/EC2-cloud_formation.yaml
Outdated
Show resolved
Hide resolved
Management-Utilities/ec2-user-data-iscsi-create-and-mount/EC2-cloud_formation.yaml
Outdated
Show resolved
Hide resolved
Management-Utilities/ec2-user-data-iscsi-create-and-mount/EC2-cloud_formation.yaml
Outdated
Show resolved
Hide resolved
Management-Utilities/ec2-user-data-iscsi-create-and-mount/EC2-cloud_formation.yaml
Outdated
Show resolved
Hide resolved
Management-Utilities/ec2-user-data-iscsi-create-and-mount/EC2-cloud_formation.yaml
Outdated
Show resolved
Hide resolved
Management-Utilities/ec2-user-data-iscsi-create-and-mount/EC2-cloud_formation.yaml
Show resolved
Hide resolved
Management-Utilities/ec2-user-data-iscsi-create-and-mount/EC2-cloud_formation.yaml
Show resolved
Hide resolved
Management-Utilities/ec2-user-data-iscsi-create-and-mount/EC2-cloud_formation.yaml
Outdated
Show resolved
Hide resolved
Management-Utilities/ec2-user-data-iscsi-create-and-mount/EC2-cloud_formation.yaml
Outdated
Show resolved
Hide resolved
kcantrel
left a comment
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.
Just a little cleanup work and it will be prefect!
Management-Utilities/ec2-user-data-iscsi-create-and-mount/EC2-cloud_formation.yaml
Outdated
Show resolved
Hide resolved
kcantrel
left a comment
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.
Two items I found:
- The username isn't prompted for by the CF template.
- The Secret infor is inconsistent between the two scripts.
| curl -o /tmp/userdata-script.sh ${LinuxUserDataUrl} | ||
| chmod +x /tmp/userdata-script.sh | ||
| # Pass parameters to the script | ||
| /tmp/userdata-script.sh "${SecretName}" "${AWSRegion}" "${ManagementEndpointIP }" "${VolumeName}" "${VolumeSize}" "${SvmName}" |
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.
I can't believe I didn't notice this before, but the CloudFormation template doesn't prompt for the username to run under. Please add a prompt for the username.
| <powershell> | ||
| Invoke-WebRequest -Uri ${WindowsUserDataUrl} -OutFile C:\userdata-script.ps1 | ||
| (Get-Content 'C:\userdata-script.ps1') | Where-Object { $_ -notmatch '^<powershell>$|^</powershell>$' } | Set-Content 'C:\userdata-script.ps1' | ||
| powershell.exe -ExecutionPolicy Bypass -File C:\userdata-script.ps1 -SecretIdParam "${SecretName}" -FSxNAdminIpParam "${ManagementEndpointIP }" -VolumeNameParam "${VolumeName}" -VolumeSizeParam "${VolumeSize}" -DriveLetterParam "${DriveLetter}" -SvmNameParam "${SvmName}" |
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.
This doesn't pass the AWSRegion parameter. This is the region where the secret is so not necessarily in the same region where the instance is running. Looking at the Windows version of the script it looks like it is expecting the SecretID to be the entire ARN, but the Linux version expects just the name and the region is separate. Personally, I prefer to just prompting for the ARN so you have one less prompt.
Of course it also doesn't pass the username.
Adding cloud formation script for creating EC2 instance using current scripts (powershell/bash)