このリポジトリでは,Amazon EventBridge Scheduler で,EC2 インスタンスの定時起動,定時シャットダウンをする.
npx npm run test
npx npm run test -- -u
npx cdk synth
npx cdk deploy --all --require-approval never
npx cdk destroy --all --force
EC2_INSTANCE_ID=$(aws ec2 describe-instances \
--filters "Name=tag:Name,Values=AwsCdkTemplate-AwsCdkTemplateStack/AwsCdkTemplate-AwsCdkTemplateStack-general_purpose_ec2" \
--query "Reservations[].Instances[?State.Name=='running'].InstanceId[]" \
--output text)
ssh -i ~/.ssh/ec2/id_ed25519 admis@$EC2_INSTANCE_ID