Approach | Pros | Cons |
---|
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
parameters: | |
FunctionName: | |
type: "String" | |
description: "The name of the lambda function to add the layer" | |
LayerArn: | |
type: "String" | |
description: "The ARN of the layer to add to the lambda function" | |
AliasName: | |
type: "String" | |
description: "(Optional) The name of the lambda alias needs to be updated." |
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
def handler(event, context): | |
# Parse the input event to an internal class | |
config: DocumentConfig = DocumentConfig.from_event(event) | |
if config.chaos_mode == 'ENABLED': | |
enable_chaos(config) | |
else: | |
disable_chaos(config) | |
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
{ | |
"description": "Inject Lambda failures using Lambda extension", | |
"targets": {}, | |
"actions": { | |
"S00_AttachExtensionToLambda": { | |
"actionId": "aws:ssm:start-automation-execution", | |
"description": "Attach chaos extension to lambda function", | |
"parameters": { | |
"documentArn": "[ARN of the SSM document we created above]", | |
"documentParameters": "{\"AutomationAssumeRole\": \"[ARN of an IAM role with permissions to update a Lambda function]\" , \"FunctionName\": \"[The name of the function we want to inject failures to]\", \"LayerArn\": \"arn:aws:lambda:us-east-1:871265522301:layer:chaos-lambda-extension-x86_64-unknown-linux-gnu-release:12\", \"AliasName\": \"[The alias of the function we want to update]\" }", |
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
schemaVersion: "0.3" | |
description: "Enable fault injection (Chaos) to a given lambda function by attaching a Lambda extension" | |
assumeRole: "{{ AutomationAssumeRole }}" | |
parameters: | |
FunctionName: | |
type: "String" | |
description: "The name of the lambda function to add the layer" | |
LayerArn: | |
type: "String" | |
description: "The ARN of the layer to add to the lambda function" |
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
.vagrant/ |
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
var casper = require('casper').create(); | |
var system = require('system'); | |
var username = [ENTER_EMAIL_HERE]; | |
var userpass = [ENTER_PASSWORD_HERE]; | |
function enterUsername(username) { | |
document.getElementById("Email").value=username; | |
document.getElementById("next").click(); | |
} |
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
def configStr = ''' | |
installer.dir="${installerDir()}" | |
dist.dir="${installerDir()}/Incubator" | |
def installerDir() { | |
'/home/test' | |
} | |
''' | |
def config = new ConfigSlurper().parse(configStr) |