View IAM policy for example CICD app
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"iam:*", | |
"lambda:*", | |
"cloudformation:*", | |
"sns:CreateTopic", |
View template.yaml
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: 'AWS::Serverless-2016-10-31' | |
Description: An example SAM template for a Lambda function that's invoked by a CloudWatch Event. | |
Resources: | |
MyFunction: | |
Type: 'AWS::Serverless::Function' | |
Properties: | |
FunctionName: MyFunction | |
Handler: MyFunction.lambda_handler |
View template.yaml
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: 'AWS::Serverless-2016-10-31' | |
Description: An example SAM template for a Lambda function invoked by API Gateway. | |
Resources: | |
MyFunction: | |
Type: 'AWS::Serverless::Function' | |
Properties: | |
FunctionName: MyFunction | |
Handler: MyFunction.lambda_handler |
View template.yaml
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: 'AWS::Serverless-2016-10-31' | |
Description: An example SAM template for a Lambda & API Gateway app that sends messages using SNS. | |
Parameters: | |
# For any variables you don't want stored in your repo, you can pass them through the SAM deploy command | |
# Ie, sam deploy .... --parameter-overrides MyEmail=myemail@gmail.com | |
MyEmail: | |
Type: String | |
Resources: |
View template.yaml
AWSTemplateFormatVersion: '2010-09-09' | |
Transform: 'AWS::Serverless-2016-10-31' | |
Description: An app that includes a DynamoDB table, Lambda function that writes to DynamoDB, and CloudWatch Event trigger | |
Resources: | |
LambdaWriteToDynamoDB: | |
# A function that writes to a DynamoDB table on a schedule | |
Type: 'AWS::Serverless::Function' | |
Properties: | |
FunctionName: LambdaWriteToDynamoDB |
View dynamodb-data-to-s3.py
import os | |
import json | |
import boto3 | |
from datetime import datetime | |
# Import resources using AWS Python SDK (boto3) and specify the DynamoDB table to scan and S3 bucket to write file to | |
# Table and bucket name are passed as environment variables in SAM template | |
s3 = boto3.resource('s3') | |
bucket = s3.Bucket(os.environ['BUCKET_NAME']) | |
table = boto3.resource('dynamodb').Table(os.environ['TABLE_NAME']) |
View quicksight-manifest.json
{ | |
"fileLocations": [ | |
{ | |
"URIPrefixes": [ | |
"s3://my-bucket-name" | |
] | |
} | |
], | |
"globalUploadSettings": { | |
"format": "JSON" |