base64 encode aws user data before send

This commit is contained in:
mbecker20
2024-06-03 00:44:45 -07:00
parent ea4ae7651c
commit 9b1d32ebdf
4 changed files with 11 additions and 4 deletions
Generated
+1
View File
@@ -2200,6 +2200,7 @@ dependencies = [
"aws-sdk-ec2",
"axum 0.7.5",
"axum-extra",
"base64 0.22.1",
"bcrypt",
"derive_variants",
"dotenv",
+4 -3
View File
@@ -76,11 +76,12 @@ envy = "0.4.2"
# CRYPTO
uuid = { version = "1.8.0", features = ["v4", "fast-rng", "serde"] }
urlencoding = "2.1.3"
rand = "0.8.5"
jwt = "0.16.0"
bcrypt = "0.15.1"
base64 = "0.22.1"
hmac = "0.12.1"
sha2 = "0.10.8"
bcrypt = "0.15.1"
rand = "0.8.5"
jwt = "0.16.0"
hex = "0.4.3"
# SYSTEM
+1
View File
@@ -46,6 +46,7 @@ futures.workspace = true
anyhow.workspace = true
dotenv.workspace = true
bcrypt.workspace = true
base64.workspace = true
tokio.workspace = true
tower.workspace = true
serde.workspace = true
+5 -1
View File
@@ -12,6 +12,7 @@ use aws_sdk_ec2::{
},
Client,
};
use base64::Engine;
use monitor_client::entities::{
alert::{Alert, AlertData},
monitor_timestamp,
@@ -92,7 +93,10 @@ pub async fn launch_ec2_instance(
)
.min_count(1)
.max_count(1)
.user_data(user_data);
.user_data(
base64::engine::general_purpose::STANDARD_NO_PAD
.encode(user_data),
);
for volume in volumes {
let ebs = EbsBlockDevice::builder()