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
const aws = require('aws-sdk'); | |
const config = new aws.ConfigService(); | |
/** | |
* Get the configurationItem for the resource using the getResourceConfigHistory API. | |
*/ | |
async function getConfigurationFromHistory(configurationHistory, callback) { | |
const params = { | |
resourceType: configurationHistory.resourceType, | |
resourceId: configurationHistory.resourceId, |
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
const aws = require('aws-sdk'); | |
const utility = require('./utility'); | |
const config = new aws.ConfigService(); | |
/** | |
* In this example, the resource is compliant if it is an instance and its type matches the type specified as the desired type. | |
* If the resource is not an instance, then this resource is not applicable. | |
*/ | |
function evaluateChangeNotificationCompliance(configurationItem, ruleParameters) { | |
if (configurationItem.resourceType !== 'AWS::EC2::Instance') { |
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' | |
Transform: 'AWS::Serverless-2016-10-31' | |
Resources: | |
MyFunction: | |
Type: 'AWS::Serverless::Function' | |
Properties: | |
Handler: index.handler | |
# ... | |
# all the other properties here | |
# ... |
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' | |
Transform: AWS::Serverless-2016-10-31 | |
Resources: | |
DeliveryBucket: | |
Type: AWS::S3::Bucket | |
StreamProcessFunction: | |
Type: AWS::Serverless::Function | |
Properties: |
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 | |
Transform: AWS::Serverless-2016-10-31 | |
Resources: | |
MyProcessingFunction: | |
Type: AWS::Serverless::Function | |
Properties: | |
Handler: index.handler | |
Runtime: python2.7 | |
# ... |
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 | |
Transform: MyUniqueMacroName | |
Resources: | |
MyWebsite: | |
Type: MyCompany::StaticWebsite |
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 | |
Resources: | |
MyWebsite: | |
Type: MyCompany::StaticWebsite | |
'Fn::Transform': | |
- Name: MyUniqueMacroName | |
Parameters: | |
# your macro 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 os | |
import boto3 | |
import datetime | |
region = os.environ.get('AWS_DEFAULT_REGION', 'us-west-2') | |
dynamodb = boto3.client('dynamodb', region_name=region) | |
class DailyResize(object): | |
FIRST_DAY_RCU, FIRST_DAY_WCU = 300, 1000 |
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 os | |
from resizer import DailyResize | |
def daily_resize(event, context): | |
operation = event['Operation'] | |
resizer = DailyResize(table_prefix=os.environ['TABLE_NAME']) | |
if operation == 'create_new': | |
resizer.create_new() | |
elif operation == 'resize_old': | |
resizer.resize_old() |
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' | |
Transform: AWS::Serverless-2016-10-31 | |
Parameters: | |
TablePrefix: | |
Type: String | |
Resources: | |
TableDailyResize: | |
Type: AWS::Serverless::Function | |
Properties: | |
Handler: handler.daily_resize |