Skip to content

Instantly share code, notes, and snippets.

@ormam
ormam / Replicate_target_groups_Lambda.py
Created May 5, 2020 06:41
Replicate target groups via a Lambda function
import boto3
def lambda_handler(event, context):
#-------------------- Debug ---------------------------
print( 'Hello {}'.format(event))
# -------------- Parameters --------------
loadBalancersList = {
"arn:aws:elasticloadbalancing:ap-southeast-1:027065296145:targetgroup/bluegreen-tg/b93ed9788fb7b344": "arn:aws:elasticloadbalancing:ap-southeast-1:027065296145:targetgroup/bluegreen-tg-internal/cb7a4a08b50a099e",
@ormam
ormam / Terraform_provisiong_dynamic_multiple_disks_on_VMware.tf
Created May 5, 2020 06:56
Terraform provisiong dynamic multiple disks on VMware
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
# = = = = = = = Variables initialization = = = = = = =
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
variable "example_vm_name" {
default = ""
}
variable "example_template_name" {
default = ""
}
@ormam
ormam / AWS_auto_tagging_via_Lambda.py
Last active July 2, 2022 09:16
AWS auto tagging via Lambda
import boto3
def lambda_handler(event, context):
#-------------------- Debug ---------------------------
#print( 'Hello {}'.format(event))
#print( 'User Name- {}'.format(event['detail']['userIdentity']['principalId']))
#print( 'Instance ID- {}'.format(event['detail']['responseElements']['instancesSet']['items'][0]['instanceId']))
# Variables