This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: "2010-09-09" | |
Description: Lambda RDS Demo CloudFormation Template | |
Metadata: | |
AWS::CloudFormation::Interface: | |
ParameterGroups: | |
- Label: | |
default: RDS Parameters | |
Parameters: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import cfnresponse | |
import json | |
import psycopg2 | |
import os | |
def lambda_handler(event, context): | |
# Get the properties from the event | |
# properties = event['ResourceProperties'] | |
# resource_id = event['LogicalResourceId'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWSTemplateFormatVersion: "2010-09-09" | |
Description: Cruddur DB Schema Load Lambda Function CFN | |
Parameters: | |
LambdaSchemaLoadFunctionName: | |
Type: String | |
MinLength: '1' | |
MaxLength: '64' | |
AllowedPattern: '[a-zA-Z][a-zA-Z0-9_-]*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import psycopg2 | |
import os | |
def lambda_handler(event, context): | |
# Create a connection to the database | |
conn = psycopg2.connect(os.getenv('CONNECTION_URL')) | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt update | |
sudo apt-get -y install ca-certificates curl gnupg lsb-release | |
sudo mkdir -p /etc/apt/keyrings | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
sudo apt-get update | |
sudo apt-get -y install docker-ce docker-ce-cli containerd.io docker-compose-plugin | |
sudo usermod -aG docker ${USER} | |
sudo service docker start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Task 1: Create a project jumphost instance | |
Navigation menu > Compute engine > VM Instance | |
Task 2: Create a Kubernetes service cluster | |
gcloud config set compute/zone us-east1-b | |
gcloud container clusters create nucleus-webserver1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This snippet gets all the IP routes | |
# | |
# Import-Module PowerNSX and run | |
# Connect-NsxServer before running this. | |
$edges = Get-NsxEdge | |
foreach($edge in $edges) | |
{ | |
Write-Host "Getting routes for Edge $($edge.name) ($($edge.id))" |