-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixing linter issues introduced by rdk examples (#495)
Authored-by: Javy de Koning
- Loading branch information
1 parent
8c8fc95
commit 5d3c8ec
Showing
8 changed files
with
147 additions
and
156 deletions.
There are no files selected for viewing
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
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
26 changes: 13 additions & 13 deletions
26
samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINIATION_PROTECTION_ADF/parameters.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
{ | ||
"Version": "1.0", | ||
"Parameters": { | ||
"RuleName": "EC2_CHECKS_TERMINIATION_PROTECTION_ADF", | ||
"Description": "EC2_CHECKS_TERMINIATION_PROTECTION_ADF", | ||
"SourceRuntime": "python3.8", | ||
"CodeKey": "EC2_CHECKS_TERMINIATION_PROTECTION_ADFeu-central-1.zip", | ||
"InputParameters": "{}", | ||
"OptionalParameters": "{}", | ||
"SourceEvents": "AWS::EC2::Instance", | ||
"SourcePeriodic": "One_Hour" | ||
}, | ||
"Tags": "[]" | ||
} | ||
"Version": "1.0", | ||
"Parameters": { | ||
"RuleName": "EC2_CHECKS_TERMINIATION_PROTECTION_ADF", | ||
"Description": "EC2_CHECKS_TERMINIATION_PROTECTION_ADF", | ||
"SourceRuntime": "python3.8", | ||
"CodeKey": "EC2_CHECKS_TERMINIATION_PROTECTION_ADFeu-central-1.zip", | ||
"InputParameters": "{}", | ||
"OptionalParameters": "{}", | ||
"SourceEvents": "AWS::EC2::Instance", | ||
"SourcePeriodic": "One_Hour" | ||
}, | ||
"Tags": "[]" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
|
||
{ | ||
"Type": "AWS::Lambda::Function", | ||
"DependsOn": "RuleNameStrippedLambdaRole", | ||
"Properties": { | ||
"FunctionName": "RDK-Rule-Function-RuleNameStripped", | ||
"Code": { | ||
"S3Bucket": { | ||
"Ref": "SourceBucket" | ||
}, | ||
"S3Key": "RuleName/RuleName.zip" | ||
}, | ||
"Description": "Function for AWS Config Rule RuleName", | ||
"Handler": "RuleName.lambda_handler", | ||
"MemorySize": "256", | ||
"Role": { | ||
"Fn::GetAtt": [ | ||
"RuleNameStrippedLambdaRole", | ||
"Arn" | ||
] | ||
}, | ||
"Runtime": "RuleRuntime", | ||
"Timeout": "60", | ||
"Tags": [] | ||
} | ||
"Type": "AWS::Lambda::Function", | ||
"DependsOn": "RuleNameStrippedLambdaRole", | ||
"Properties": { | ||
"FunctionName": "RDK-Rule-Function-RuleNameStripped", | ||
"Code": { | ||
"S3Bucket": { | ||
"Ref": "SourceBucket" | ||
}, | ||
"S3Key": "RuleName/RuleName.zip" | ||
}, | ||
"Description": "Function for AWS Config Rule RuleName", | ||
"Handler": "RuleName.lambda_handler", | ||
"MemorySize": "256", | ||
"Role": { | ||
"Fn::GetAtt": [ | ||
"RuleNameStrippedLambdaRole", | ||
"Arn" | ||
] | ||
}, | ||
"Runtime": "RuleRuntime", | ||
"Timeout": "60", | ||
"Tags": [] | ||
} | ||
} |
25 changes: 12 additions & 13 deletions
25
samples/sample-rdk-rules/templates/lambda-permission.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
|
||
{ | ||
"Type": "AWS::Lambda::Permission", | ||
"DependsOn": "RuleNameStrippedLambdaFunction", | ||
"Properties": { | ||
"FunctionName": { | ||
"Fn::GetAtt": [ | ||
"RuleNameStrippedLambdaFunction", | ||
"Arn" | ||
] | ||
}, | ||
"Action": "lambda:InvokeFunction", | ||
"Principal": "config.amazonaws.com" | ||
} | ||
"Type": "AWS::Lambda::Permission", | ||
"DependsOn": "RuleNameStrippedLambdaFunction", | ||
"Properties": { | ||
"FunctionName": { | ||
"Fn::GetAtt": [ | ||
"RuleNameStrippedLambdaFunction", | ||
"Arn" | ||
] | ||
}, | ||
"Action": "lambda:InvokeFunction", | ||
"Principal": "config.amazonaws.com" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,75 @@ | ||
|
||
{ | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"Path": "/rdk/", | ||
"AssumeRolePolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "AllowLambdaAssumeRole", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "lambda.amazonaws.com" | ||
}, | ||
"Action": "sts:AssumeRole" | ||
} | ||
] | ||
}, | ||
"Policies": [ | ||
{ | ||
"PolicyName": "ConfigRulePolicy", | ||
"PolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"Path": "/rdk/", | ||
"AssumeRolePolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "AllowLambdaAssumeRole", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "lambda.amazonaws.com" | ||
}, | ||
"Action": "sts:AssumeRole" | ||
} | ||
] | ||
}, | ||
"Policies": [ | ||
{ | ||
"Sid": "1", | ||
"Action": [ | ||
"s3:GetObject" | ||
], | ||
"Effect": "Allow", | ||
"Resource": { | ||
"Fn::Sub": "arn:aws:s3:::${SourceBucket}/${SourceBucketFolder}/*" | ||
} | ||
}, | ||
{ | ||
"Sid": "2", | ||
"Action": [ | ||
"logs:CreateLogGroup", | ||
"logs:CreateLogStream", | ||
"logs:PutLogEvents", | ||
"logs:DescribeLogStreams" | ||
], | ||
"Effect": "Allow", | ||
"Resource": "*" | ||
}, | ||
{ | ||
"Sid": "3", | ||
"Action": [ | ||
"config:PutEvaluations" | ||
], | ||
"Effect": "Allow", | ||
"Resource": "*" | ||
}, | ||
{ | ||
"Sid": "4", | ||
"Action": [ | ||
"iam:List*", | ||
"iam:Describe*", | ||
"iam:Get*" | ||
], | ||
"Effect": "Allow", | ||
"Resource": "*" | ||
}, | ||
"PolicyName": "ConfigRulePolicy", | ||
"PolicyDocument": { | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "1", | ||
"Action": ["s3:GetObject"], | ||
"Effect": "Allow", | ||
"Resource": { | ||
"Fn::Sub": "arn:aws:s3:::${SourceBucket}/${SourceBucketFolder}/*" | ||
} | ||
}, | ||
{ | ||
"Sid": "2", | ||
"Action": [ | ||
"logs:CreateLogGroup", | ||
"logs:CreateLogStream", | ||
"logs:PutLogEvents", | ||
"logs:DescribeLogStreams" | ||
], | ||
"Effect": "Allow", | ||
"Resource": "*" | ||
}, | ||
{ | ||
"Sid": "3", | ||
"Action": ["config:PutEvaluations"], | ||
"Effect": "Allow", | ||
"Resource": "*" | ||
}, | ||
{ | ||
"Sid": "4", | ||
"Action": [ | ||
"iam:List*", | ||
"iam:Describe*", | ||
"iam:Get*" | ||
], | ||
"Effect": "Allow", | ||
"Resource": "*" | ||
}, | ||
{ | ||
"Sid": "5", | ||
"Action": ["sts:AssumeRole"], | ||
"Effect": "Allow", | ||
"Resource": "${ConfigRoleArnToAssume}" | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"ManagedPolicyArns": [ | ||
{ | ||
"Sid": "5", | ||
"Action": [ | ||
"sts:AssumeRole" | ||
], | ||
"Effect": "Allow", | ||
"Resource": "${ConfigRoleArnToAssume}" | ||
"Fn::Sub": "arn:aws:iam::aws:policy/ReadOnlyAccess" | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"ManagedPolicyArns": [ | ||
{ | ||
"Fn::Sub": "arn:aws:iam::aws:policy/ReadOnlyAccess" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
|
||
{ | ||
"SourceBucket": { | ||
"Description": "Name of the S3 bucket that you have stored the rule zip files in.", | ||
"Type": "String", | ||
"MinLength": "1", | ||
"MaxLength": "255" | ||
}, | ||
"SourceBucketFolder": { | ||
"Description": "Folder in the s3 bucket all the lambda function code stored", | ||
"Type": "String", | ||
"MinLength": "1", | ||
"MaxLength": "255" | ||
}, | ||
"LambdaAccountId": { | ||
"Description": "Account ID that contains Lambda functions for Config Rules.", | ||
"Type": "String", | ||
"MinLength": "12", | ||
"MaxLength": "12" | ||
}, | ||
"ConfigRoleArnToAssume": { | ||
"Description": "Lambda function required to assume this config role in target accounts to put evaluations", | ||
"Type": "String" | ||
} | ||
"SourceBucket": { | ||
"Description": "Name of the S3 bucket that you have stored the rule zip files in.", | ||
"Type": "String", | ||
"MinLength": "1", | ||
"MaxLength": "255" | ||
}, | ||
"SourceBucketFolder": { | ||
"Description": "Folder in the s3 bucket all the lambda function code stored", | ||
"Type": "String", | ||
"MinLength": "1", | ||
"MaxLength": "255" | ||
}, | ||
"LambdaAccountId": { | ||
"Description": "Account ID that contains Lambda functions for Config Rules.", | ||
"Type": "String", | ||
"MinLength": "12", | ||
"MaxLength": "12" | ||
}, | ||
"ConfigRoleArnToAssume": { | ||
"Description": "Lambda function required to assume this config role in target accounts to put evaluations", | ||
"Type": "String" | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
|
||
{ | ||
"AWSTemplateFormatVersion": "2010-09-09", | ||
"Description": "AWS CloudFormation template to create Lambda functions for backing custom AWS Config rules. You will be billed for the AWS resources used if you create a stack from this template.", | ||
"Resources": {} | ||
"AWSTemplateFormatVersion": "2010-09-09", | ||
"Description": "AWS CloudFormation template to create Lambda functions for backing custom AWS Config rules. You will be billed for the AWS resources used if you create a stack from this template.", | ||
"Resources": {} | ||
} |