Skip to content

Commit

Permalink
0.6.0-beta.0: better logging
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <[email protected]>
  • Loading branch information
gyuho committed May 15, 2023
1 parent cf0496c commit e30ae00
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 38 deletions.
2 changes: 1 addition & 1 deletion avalanche-kms/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "avalanche-kms"
version = "0.5.5-beta.0" # https://github.com/ava-labs/avalanche-ops/releases
version = "0.6.0-beta.0" # https://github.com/ava-labs/avalanche-ops/releases
edition = "2021"
rust-version = "1.69"

Expand Down
2 changes: 1 addition & 1 deletion avalanche-ops/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "avalanche-ops"
version = "0.5.5-beta.0" # https://crates.io/crates/avalanche-ops
version = "0.6.0-beta.0" # https://crates.io/crates/avalanche-ops
edition = "2021"
rust-version = "1.69"
publish = true
Expand Down
2 changes: 1 addition & 1 deletion avalanched-aws/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "avalanched-aws"
version = "0.5.5-beta.0" # https://github.com/ava-labs/avalanche-ops/releases
version = "0.6.0-beta.0" # https://github.com/ava-labs/avalanche-ops/releases
edition = "2021"
rust-version = "1.69"

Expand Down
2 changes: 1 addition & 1 deletion avalancheup-aws/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "avalancheup-aws"
version = "0.5.5-beta.0" # https://github.com/ava-labs/avalanche-ops/releases
version = "0.6.0-beta.0" # https://github.com/ava-labs/avalanche-ops/releases
edition = "2021"
rust-version = "1.69"

Expand Down
56 changes: 27 additions & 29 deletions avalancheup-aws/src/apply/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,21 +377,21 @@ pub async fn execute(log_level: &str, spec_file_path: &str, skip_prompt: bool) -

let regional_shared_config =
aws_manager::load_config(Some(region.clone()), Some(Duration::from_secs(30))).await;

let regional_kms_manager = kms::Manager::new(&regional_shared_config);

sleep(Duration::from_secs(1)).await;
execute!(
stdout(),
SetForegroundColor(Color::Green),
Print(format!(
"\n\n\nSTEP: create KMS encrypt key in '{region}'\n"
)),
ResetColor
)?;
if regional_resource
.kms_symmetric_default_encrypt_key
.is_none()
{
sleep(Duration::from_secs(1)).await;
execute!(
stdout(),
SetForegroundColor(Color::Green),
Print(format!(
"\n\n\nSTEP: create encryption KMS key in '{region}'\n"
)),
ResetColor
)?;
let key = regional_kms_manager
.create_symmetric_default_key(format!("{}-kms-key", spec.id).as_str(), false)
.await
Expand All @@ -413,7 +413,7 @@ pub async fn execute(log_level: &str, spec_file_path: &str, skip_prompt: bool) -
.await
.unwrap();
} else {
log::info!("skipping creating kms default encrypt key");
log::info!("skipping creating KMS default encrypt key");
}

let regional_envelope_manager = envelope::Manager::new(
Expand Down Expand Up @@ -492,19 +492,18 @@ pub async fn execute(log_level: &str, spec_file_path: &str, skip_prompt: bool) -
aws_manager::load_config(Some(region.clone()), Some(Duration::from_secs(30))).await;
let regional_cloudformation_manager = cloudformation::Manager::new(&regional_shared_config);

execute!(
stdout(),
SetForegroundColor(Color::Green),
Print(format!(
"\n\n\nSTEP: creating EC2 instance role in the region '{region}'\n"
)),
ResetColor
)?;
if regional_resource
.cloudformation_ec2_instance_profile_arn
.is_none()
{
execute!(
stdout(),
SetForegroundColor(Color::Green),
Print(format!(
"\n\n\nSTEP: creating EC2 instance role in the region '{region}'\n"
)),
ResetColor
)?;

let ec2_instance_role_tmpl =
avalanche_ops::aws::artifacts::ec2_instance_role_yaml().unwrap();
let ec2_instance_role_stack_name = regional_resource
Expand Down Expand Up @@ -618,6 +617,14 @@ pub async fn execute(log_level: &str, spec_file_path: &str, skip_prompt: bool) -
aws_manager::load_config(Some(region.clone()), Some(Duration::from_secs(30))).await;
let regional_cloudformation_manager = cloudformation::Manager::new(&regional_shared_config);

execute!(
stdout(),
SetForegroundColor(Color::Green),
Print(format!(
"\n\n\nSTEP: creating a VPC in the region '{region}'\n"
)),
ResetColor
)?;
if regional_resource.cloudformation_vpc_id.is_none()
&& regional_resource
.cloudformation_vpc_security_group_id
Expand All @@ -626,15 +633,6 @@ pub async fn execute(log_level: &str, spec_file_path: &str, skip_prompt: bool) -
.cloudformation_vpc_public_subnet_ids
.is_none()
{
execute!(
stdout(),
SetForegroundColor(Color::Green),
Print(format!(
"\n\n\nSTEP: creating a VPC in the region '{region}'\n"
)),
ResetColor
)?;

let vpc_tmpl = avalanche_ops::aws::artifacts::vpc_yaml().unwrap();
let vpc_stack_name = regional_resource.cloudformation_vpc.clone().unwrap();
let vpc_params = Vec::from([
Expand Down
2 changes: 1 addition & 1 deletion blizzard-aws/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "blizzard-aws"
version = "0.5.5-beta.0" # https://github.com/ava-labs/avalanche-ops/releases
version = "0.6.0-beta.0" # https://github.com/ava-labs/avalanche-ops/releases
edition = "2021"
rust-version = "1.69"

Expand Down
2 changes: 1 addition & 1 deletion blizzardup-aws/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "blizzardup-aws"
version = "0.5.5-beta.0" # https://github.com/ava-labs/avalanche-ops/releases
version = "0.6.0-beta.0" # https://github.com/ava-labs/avalanche-ops/releases
edition = "2021"
rust-version = "1.69"

Expand Down
2 changes: 1 addition & 1 deletion devnet-faucet/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "devnet-faucet"
version = "0.5.5-beta.0" # https://github.com/ava-labs/avalanche-ops/releases
version = "0.6.0-beta.0" # https://github.com/ava-labs/avalanche-ops/releases
edition = "2021"
license = "MIT OR Apache-2.0"

Expand Down
2 changes: 1 addition & 1 deletion staking-key-cert-s3-downloader/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "staking-key-cert-s3-downloader"
version = "0.5.5-beta.0" # https://github.com/ava-labs/avalanche-ops/releases
version = "0.6.0-beta.0" # https://github.com/ava-labs/avalanche-ops/releases
edition = "2021"
rust-version = "1.69"

Expand Down
2 changes: 1 addition & 1 deletion staking-signer-key-s3-downloader/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "staking-signer-key-s3-downloader"
version = "0.5.5-beta.0" # https://github.com/ava-labs/avalanche-ops/releases
version = "0.6.0-beta.0" # https://github.com/ava-labs/avalanche-ops/releases
edition = "2021"
rust-version = "1.69"

Expand Down

0 comments on commit e30ae00

Please sign in to comment.