• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Search

add

Add Snapshot Schedules to Disks

May 24, 2023

How to add Snapshot Schedules to disks in Terraform. Add this to your existing VM.

resource "google_compute_disk_resource_policy_attachment" "hourly_attachment" {
  name = "hourly-snapshots"
  disk = google_compute_instance.test.name
  zone = "us-central1-c"
}
 
resource "google_compute_disk_resource_policy_attachment" "daily_attachment" {
  name = "daily-snapshots"
  disk = google_compute_instance.test.name
  zone = "us-central1-c"
}

resource "google_compute_disk_resource_policy_attachment" "hourly_attachment" { name = "hourly-snapshots" disk = google_compute_instance.test.name zone = "us-central1-c" } resource "google_compute_disk_resource_policy_attachment" "daily_attachment" { name = "daily-snapshots" disk = google_compute_instance.test.name zone = "us-central1-c" }

Filed Under: Cloud Tagged With: add, policy, resource, schedules, snapshot, terraform

GCP Create Scheduled Snapshots

February 2, 2022

How to create scheduled snapshots in GCP.

gcloud compute resource-policies create snapshot-schedule hourly \
--description "my hourly schedule" \
--max-retention-days 7 \
--start-time 00:00 \
--hourly-schedule 1 \
--region us-central1 \
--on-source-disk-delete keep-auto-snapshots \
--storage-location US

gcloud compute resource-policies create snapshot-schedule hourly \ --description "my hourly schedule" \ --max-retention-days 7 \ --start-time 00:00 \ --hourly-schedule 1 \ --region us-central1 \ --on-source-disk-delete keep-auto-snapshots \ --storage-location US

Add snapshot schedule to a disk.

gcloud compute disks add-resource-policies disk-name \
--resource-policies hourly \
--zone us-central1-a

gcloud compute disks add-resource-policies disk-name \ --resource-policies hourly \ --zone us-central1-a

gcloud compute disks create disk-name \
--resource-policies hourly \
--zone us-central1-a

gcloud compute disks create disk-name \ --resource-policies hourly \ --zone us-central1-a

List snapshot schedules.

gcloud compute resource-policies list

gcloud compute resource-policies list

Describe snapshot schedule.

gcloud compute resource-policies describe hourly

gcloud compute resource-policies describe hourly

Filed Under: Cloud Tagged With: add, create, gcp, list, schedule, snapshot

GCP Compute add startup-script to metadata

February 2, 2022

How to add a startup-script to metadata. The script executes every time VM is started.

gcloud compute instances add-metadata instance-name \
--project your-project-id \
--zone us-central1-c \
--metadata=startup-script='#! /bin/bash
sudo -i
echo "Time: $(date)" >> /tmp/date.txt'

gcloud compute instances add-metadata instance-name \ --project your-project-id \ --zone us-central1-c \ --metadata=startup-script='#! /bin/bash sudo -i echo "Time: $(date)" >> /tmp/date.txt'

Filed Under: Cloud Tagged With: add, boot, compute, gcp, metadata, startup-script

AWS ELB SSL Listener

January 31, 2022

Here’s how to update SSL certificates to AWS ELB.

Import SSL certificate

aws acm import-certificate \
--certificate fileb://example.crt \
--private-key fileb://example.key \
--certificate-chain fileb://example-bundle.crt \
--tags Key=Name,Value=mydomain.com_20220107 \
--profile default

aws acm import-certificate \ --certificate fileb://example.crt \ --private-key fileb://example.key \ --certificate-chain fileb://example-bundle.crt \ --tags Key=Name,Value=mydomain.com_20220107 \ --profile default

Add SSL to a listener.

aws elbv2 add-listener-certificates \
--listener-arn arn:aws:elasticloadbalancing:us-east-1:xxxxxxxxxxxxx:listener/app/elbname/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx \
--certificates CertificateArn=arn:aws:acm:us-east-1:xxxxxxxxxxxx:certificate/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
--profile default

aws elbv2 add-listener-certificates \ --listener-arn arn:aws:elasticloadbalancing:us-east-1:xxxxxxxxxxxxx:listener/app/elbname/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx \ --certificates CertificateArn=arn:aws:acm:us-east-1:xxxxxxxxxxxx:certificate/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ --profile default

Modify listener. Set SSL certificate as default.

aws elbv2 modify-listener \
--listener-arn arn:aws:elasticloadbalancing:us-east-1:xxxxxxxxxxxxx:listener/app/elbname/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx \
--certificates CertificateArn=arn:aws:acm:us-east-1:xxxxxxxxxxxx:certificate/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
--profile default

aws elbv2 modify-listener \ --listener-arn arn:aws:elasticloadbalancing:us-east-1:xxxxxxxxxxxxx:listener/app/elbname/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx \ --certificates CertificateArn=arn:aws:acm:us-east-1:xxxxxxxxxxxx:certificate/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ --profile default

Remove SSL from a listener.

aws elbv2 remove-listener-certificates \
--listener-arn arn:aws:elasticloadbalancing:us-east-1:xxxxxxxxxxxxx:listener/app/elbname/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx \
--certificates CertificateArn=arn:aws:acm:us-east-1:xxxxxxxxxxxx:certificate/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \
--profile default

aws elbv2 remove-listener-certificates \ --listener-arn arn:aws:elasticloadbalancing:us-east-1:xxxxxxxxxxxxx:listener/app/elbname/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx \ --certificates CertificateArn=arn:aws:acm:us-east-1:xxxxxxxxxxxx:certificate/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx \ --profile default

Filed Under: Linux Tagged With: add, aws, certificate, default, elb, listener, remove, ssl

Adding path in csh

January 8, 2022

How to add path in csh. Open or create .cshrc file. Add to an existing path.

set path = ( /home/ubuntu $path )

set path = ( /home/ubuntu $path )

Activate.

source .cshrc

source .cshrc

Filed Under: Linux Tagged With: add, csh, path

  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Interim pages omitted …
  • Go to page 6
  • Go to Next Page »
  • Home
  • About
  • Search

Copyright © 2023