Skip to content

Instantly share code, notes, and snippets.

+-------------+--------------------------+
| Key | Value |
+-------------+--------------------------+
| Patch Group | ProdWebApp1-Ubuntu |
| | ProdWebApp2-AWSLinux1 |
| | StagingWebApp1-Ubuntu |
| | StagingWebApp2-AWSLinux1 |
+-------------+--------------------------+
+---------------------+-------------------------+----------------------+
| Development | Staging | Production |
+---------------------+-------------------------+----------------------+
| LinuxDevPatchLogs | LinuxStagingPatchLogs | LinuxProdPatchLogs |
| WindowsDevPatchLogs | WindowsStagingPatchLogs | WindowsProdPatchLogs |
+---------------------+-------------------------+----------------------+
import boto3
import os
import datetime
"""
This portion will obtain the Environment variables from AWS Lambda.
"""
GROUP_NAME = os.environ['GROUP_NAME']
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "logs.YOUR-REGION.amazonaws.com"
},
"Action": "s3:GetBucketAcl",
"Resource": "arn:aws:s3:::BUCKET_NAME_HERE"
{
"agent": {
"metrics_collection_interval": 60,
"run_as_user": "root"
},
"logs": {
"logs_collected": {
"files": {
"collect_list": [
{
# vpc.tf
# VPC & Subnet Creation
#############################
# VPC
#############################
resource "aws_vpc" "custom_vpc" {
cidr_block = var.custom_vpc.vpc_cidr_block
instance_tenancy = var.custom_vpc.vpc_instance_tenancy
#############################
# Region
#############################
variable "region" {
description = "AWS region"
default = "us-east-1"
}
#############################