Skip to content

Instantly share code, notes, and snippets.

nivleshc

Block or report user

Report or block nivleshc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View tps-serverless-05.yml
functions:
tpsFindVehiclePositionsCron:
handler: src.tps_vehiclepos.run
memorySize: 3008
timeout: 900
environment:
BUCKET: ${self:custom.s3.websiteBucket}
TRANSPORTPOSITION_TABLE: ${self:custom.dynamodb.transportPositionTableName}
events:
- schedule:
View tps-serverless-04.yml
# you can add packaging information here
package:
include:
- src/csv/*.csv
exclude:
- __cache__/**
- __pycache__/**
- events/**
- node_modules/**
- 'conf/**/*'
View tps-serverless-03.yml
# define IAM roles
iamRoleStatements:
- Effect: Allow
Action:
- s3:HeadObject
- s3:GetObject
- s3:GetObjectAcl
- s3:PutObject
- s3:PutObjectAcl
- s3:CreateMultiPartUpload
View tps-serverless-02.yml
provider:
name: aws
runtime: python3.7
endpointType: regional
stage: ${self:custom.stage}
region: ${self:custom.region}
memorySize: 256
timeout: 300
versionFunctions: false
deploymentBucket: sls-${self:custom.application}-deploymentbucket
View tps-serverless-01.yml
service: sls-${self:custom.application}
plugins:
- serverless-python-requirements
- serverless-prune-plugin
custom:
pythonRequirements:
dockerizePip: true
slim: true
noDeploy:
@nivleshc
nivleshc / ansible-aws-inventory-main-03.yml
Created Apr 16, 2019
Part 3 of ansible-aws-inventory-main.yml file
View ansible-aws-inventory-main-03.yml
#define output file names. These will be prepended with run date/time in iso6801 format
- output_root_folder: /Users/nivleshc/Documents/OneDrive/Personal/Studies/AWS/output/raw/
- outputfile_variablename_suffix: "_outputfile"
- outputfileheader_variablename_suffix: "_outputfile_header"
- vpc_outputfile: "{{ output_root_folder }}{{ ansible_date_time.iso8601 }}_vpc.csv"
- subnet_outputfile: "{{ output_root_folder }}{{ ansible_date_time.iso8601 }}_subnet.csv"
- igw_outputfile: "{{ output_root_folder }}{{ ansible_date_time.iso8601 }}_igw.csv"
- cgw_outputfile: "{{ output_root_folder }}{{ ansible_date_time.iso8601 }}_cgw.csv"
- vgw_outputfile: "{{ output_root_folder }}{{ ansible_date_time.iso8601 }}_vgw.csv"
- ami_outputfile: "{{ output_root_folder }}{{ ansible_date_time.iso8601 }}_ami.csv"
@nivleshc
nivleshc / ansible-aws-inventory-main-04.yml
Created Apr 16, 2019
Part 4 of ansible-aws-inventory-main.yml file
View ansible-aws-inventory-main-04.yml
#the following variables are used to enable or disable inventory for a particular resource. Use true to enable and false to disable
- inventory_vpc: true
- inventory_subnet: true
- inventory_igw: true
- inventory_cgw: true
- inventory_vgw: true
- inventory_ami: true
- inventory_eip: true
- inventory_snapshot: true
- inventory_volume: true
@nivleshc
nivleshc / ansible-aws-inventory-main-05.yml
Created Apr 16, 2019
Part 5 of ansible-aws-inventory-main.yml file
View ansible-aws-inventory-main-05.yml
tasks:
- name: initialise output files with headers
lineinfile:
state: present
create: yes
path: "{{ lookup('vars', item + outputfile_variablename_suffix) }}"
line: "{{ lookup('vars', item + outputfileheader_variablename_suffix) }}"
insertbefore: BOF
with_items:
- vpc
@nivleshc
nivleshc / ansible-aws-inventory-main-06.yml
Created Apr 16, 2019
Part 6 of ansible-aws-inventory-main.yml file
View ansible-aws-inventory-main-06.yml
- name: find all applicable resources within region
include_tasks: ansible-aws-inventory-worker.yml
loop: "{{ aws_regions }}"
loop_control:
loop_var: aws_region
label: "{{ aws_region }}"
@nivleshc
nivleshc / ansible-aws-inventory-main-07.yml
Created Apr 16, 2019
Part 7 of ansible-aws-inventory-main.yml file
View ansible-aws-inventory-main-07.yml
- name: print out the output filenames for each of the resoureces inventoried
debug:
msg:
- "{{ item }} output filename: {{ lookup('vars', item + outputfile_variablename_suffix) }}"
with_items:
- vpc
- subnet
- igw
- cgw
- vgw
You can’t perform that action at this time.